/* Alongside+ Self-Production Studio: Environment Switcher & Mobile Auto-Mode */
/* Clean modular stylesheet - zero conflicts with mobile-teleprompter.css */

/* 1. TOP ENVIRONMENT SWITCHER BAR */
.fc-env-bar {
  position: relative;
  margin: 0 0 16px 0;
  padding: 18px 20px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(13, 25, 52, 0.96), rgba(8, 16, 34, 0.98));
  border: 1px solid rgba(244, 213, 127, 0.38);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  color: #F8FAFC;
  box-sizing: border-box;
}

.fc-env-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.fc-env-bar-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fc-env-bar-kicker {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #F4D57F;
}

.fc-env-bar-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(244, 213, 127, 0.14);
  border: 1px solid rgba(244, 213, 127, 0.36);
  color: #FDE68A;
}

.fc-env-bar-utils {
  display: none;
  align-items: center;
  gap: 8px;
}

body.fc-is-mobile-viewport .fc-env-bar-utils,
body.fc-env-quick .fc-env-bar-utils {
  display: inline-flex;
}

.fc-env-util-btn {
  appearance: none;
  background: rgba(15, 29, 60, 0.9);
  border: 1px solid rgba(244, 213, 127, 0.35);
  color: #F4D57F;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.fc-env-util-btn:hover {
  background: rgba(244, 213, 127, 0.16);
  border-color: #F4D57F;
}

/* 3 BIG ENVIRONMENT BUTTONS GRID */
.fc-env-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.fc-env-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* ANIMATED GOLD POINTING ARROW TO SIMPLE STUDIO */
.fc-simple-arrow-callout {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(244, 213, 127, 0.22), rgba(212, 169, 74, 0.14));
  border: 1px solid rgba(244, 213, 127, 0.65);
  color: #FEF08A;
  font-size: 12.5px;
  font-weight: 800;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 4px 16px rgba(244, 213, 127, 0.18);
  transition: opacity 0.28s ease, max-height 0.28s ease, margin 0.28s ease, padding 0.28s ease;
  overflow: hidden;
  max-height: 60px;
}

.fc-simple-arrow-svg {
  flex: 0 0 auto;
  color: #F4D57F;
  animation: fcGoldArrowBounce 1.4s ease-in-out infinite;
}

@keyframes fcGoldArrowBounce {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(4px); }
}

body.fc-env-simple .fc-simple-arrow-callout,
body.fc-simple-arrow-dismissed .fc-simple-arrow-callout {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  pointer-events: none;
}

/* BIG ENVIRONMENT BUTTONS */
.fc-env-btn {
  appearance: none;
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 15px 16px;
  min-height: 96px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 30, 62, 0.92), rgba(10, 20, 44, 0.96));
  border: 1.5px solid rgba(244, 213, 127, 0.26);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

.fc-env-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 213, 127, 0.68);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
}

.fc-env-btn:focus-visible {
  outline: 2px solid #F4D57F;
  outline-offset: 2px;
}

.fc-env-btn.is-active {
  background: linear-gradient(135deg, rgba(244, 213, 127, 0.24), rgba(18, 36, 74, 0.96) 62%);
  border: 2px solid #F4D57F;
  box-shadow: 0 0 0 3px rgba(244, 213, 127, 0.18), 0 12px 28px rgba(0, 0, 0, 0.42);
}

.fc-env-btn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.fc-env-btn-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.fc-env-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(244, 213, 127, 0.14);
  border: 1px solid rgba(244, 213, 127, 0.34);
  color: #F4D57F;
  font-size: 15px;
  flex-shrink: 0;
}

.fc-env-btn.is-active .fc-env-btn-icon {
  background: #F4D57F;
  color: #0B152C;
  border-color: #F4D57F;
}

.fc-env-btn-title {
  font-size: 16.5px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
}

.fc-env-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fc-env-mode-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(244, 213, 127, 0.35);
  color: #F4D57F;
  white-space: nowrap;
}

.fc-env-active-pill {
  display: none;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #F6DC8C, #D4A94A);
  color: #0B152C;
  white-space: nowrap;
}

.fc-env-btn.is-active .fc-env-active-pill {
  display: inline-flex;
}

.fc-env-btn-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: #CBD5E1;
  font-weight: 500;
}

.fc-env-btn.is-active .fc-env-btn-sub {
  color: #F8FAFC;
}

/* 2. SMOOTH TRANSITION & TOAST */
main.st-shell {
  transition: opacity 0.22s ease, transform 0.22s ease;
}

main.st-shell.fc-env-switching {
  opacity: 0.55;
  transform: translateY(4px);
}

.fc-env-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(18px);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0D1B38, #162B54);
  border: 1.5px solid #F4D57F;
  color: #FEF08A;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.fc-env-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 3. SIMPLE STUDIO MODE (5TH-GRADE CLEAN, ZERO CLUTTER) */
.fc-simple-banner {
  display: none;
  margin: 0 0 14px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15, 29, 60, 0.88);
  border: 1px solid rgba(244, 213, 127, 0.34);
  color: #F8FAFC;
}

body.fc-env-simple .fc-simple-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.fc-simple-steps-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 700;
}

.fc-simple-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(244, 213, 127, 0.14);
  border: 1px solid rgba(244, 213, 127, 0.35);
  color: #FEF08A;
  font-size: 12.5px;
}

.fc-simple-more-btn {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(244, 213, 127, 0.45);
  color: #F4D57F;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  min-height: 38px;
}

.fc-simple-more-btn:hover {
  background: rgba(244, 213, 127, 0.15);
}

/* Hide heavy pro-only sections in Simple Studio */
body.fc-env-simple #fcProductionRigPanel,
body.fc-env-simple #stLeadSheetCard,
body.fc-env-simple #stLoopPadsHost,
body.fc-env-simple #fcaVaultSection,
body.fc-env-simple #fcPdfLibrarySection,
body.fc-env-simple #fcpvAiPortfolioVoiceSection,
body.fc-env-simple #stRightColVideoCard,
body.fc-env-simple .fc-adv-only-block {
  display: none !important;
}

/* 4. MOBILE QUICK STUDIO MODE PANEL + TELEPROMPTER MOUNT */
.fc-mqs-panel {
  margin: 0 0 16px 0;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 27, 56, 0.96), rgba(8, 16, 34, 0.98));
  border: 1.5px solid rgba(244, 213, 127, 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  color: #F8FAFC;
  box-sizing: border-box;
}

.fc-mqs-panel[hidden] {
  display: none !important;
}

body.fc-env-quick .fc-mqs-panel {
  display: block !important;
}

.fc-mqs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.fc-mqs-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #F4D57F;
}

.fc-mqs-sub {
  margin: 4px 0 0 0;
  font-size: 13.5px;
  color: #CBD5E1;
}

.fc-mqs-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.fc-mqs-action-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(18, 35, 72, 0.95);
  border: 1px solid rgba(244, 213, 127, 0.38);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.fc-mqs-action-btn:hover {
  background: rgba(244, 213, 127, 0.18);
  border-color: #F4D57F;
}

.fc-mqs-action-btn.is-primary {
  background: linear-gradient(135deg, #F6DC8C, #D4A94A);
  color: #0B152C;
  border-color: #F4D57F;
  font-weight: 800;
}

.fc-mqs-teleprompter-wrap {
  margin-top: 8px;
  border-radius: 14px;
}

#fc-mobile-teleprompter-mount:empty::before {
  content: "Phone Teleprompter & QR Handoff Ready. Tap Open Camera & Mic or Pair Phone QR above to start recording.";
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(10, 20, 42, 0.72);
  border: 1px dashed rgba(244, 213, 127, 0.35);
  color: #CBD5E1;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

/* Desktop preview of Mobile Quick Studio constrains deck cleanly */
body.fc-env-quick:not(.fc-is-mobile-viewport) .fc-mqs-panel,
body.fc-env-quick:not(.fc-is-mobile-viewport) #studioDeck,
body.fc-env-quick:not(.fc-is-mobile-viewport) #how-to-self-produce,
body.fc-env-quick:not(.fc-is-mobile-viewport) #artist-intake {
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

body.fc-env-quick:not(.fc-is-mobile-viewport) #studioDeck {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

body.fc-env-quick #fcProductionRigPanel,
body.fc-env-quick #stLeadSheetCard,
body.fc-env-quick #stLoopPadsHost,
body.fc-env-quick #fcaVaultSection,
body.fc-env-quick #fcPdfLibrarySection,
body.fc-env-quick #fcpvAiPortfolioVoiceSection,
body.fc-env-quick #stRightColVideoCard {
  display: none !important;
}

/* 5. COLLAPSIBLE MOBILE DRAWERS (RETRACTED BY DEFAULT ON MOBILE <= 900px & QUICK STUDIO) */
.fc-mob-drawer-head {
  display: none;
}

body.fc-is-mobile-viewport .fc-mob-drawer,
body.fc-env-quick .fc-mob-drawer {
  position: relative;
}

body.fc-is-mobile-viewport .fc-mob-drawer > .fc-mob-drawer-head,
body.fc-env-quick .fc-mob-drawer > .fc-mob-drawer-head {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(18, 34, 70, 0.96), rgba(11, 21, 44, 0.98));
  border: 1px solid rgba(244, 213, 127, 0.35);
  color: #FFFFFF;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  margin: 0;
}

body.fc-is-mobile-viewport .fc-mob-drawer:not(.fc-mob-collapsed) > .fc-mob-drawer-head,
body.fc-env-quick .fc-mob-drawer:not(.fc-mob-collapsed) > .fc-mob-drawer-head {
  margin-bottom: 12px;
  border-color: #F4D57F;
  background: linear-gradient(135deg, rgba(244, 213, 127, 0.16), rgba(16, 30, 62, 0.98));
}

.fc-mob-drawer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.fc-mob-drawer-title {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
}

.fc-mob-drawer-hint {
  font-size: 12px;
  color: #CBD5E1;
  line-height: 1.3;
}

.fc-mob-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(244, 213, 127, 0.16);
  border: 1px solid rgba(244, 213, 127, 0.48);
  color: #F4D57F;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  white-space: nowrap;
}

.fc-mob-drawer-chev {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.2s ease;
}

body.fc-is-mobile-viewport .fc-mob-drawer:not(.fc-mob-collapsed) .fc-mob-drawer-chev,
body.fc-env-quick .fc-mob-drawer:not(.fc-mob-collapsed) .fc-mob-drawer-chev {
  transform: rotate(180deg);
}

/* Retract all inner children when collapsed on mobile or quick studio */
body.fc-is-mobile-viewport .fc-mob-drawer.fc-mob-collapsed > *:not(.fc-mob-drawer-head),
body.fc-env-quick .fc-mob-drawer.fc-mob-collapsed > *:not(.fc-mob-drawer-head) {
  display: none !important;
}

body.fc-is-mobile-viewport .fc-mob-drawer.fc-mob-collapsed,
body.fc-env-quick .fc-mob-drawer.fc-mob-collapsed {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 0 !important;
  margin-bottom: 10px !important;
}

/* 6. AUTOMATIC MOBILE VIEWPORT UX (<= 900px) */
@media (max-width: 900px) {
  html,
  body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Sticky, clean top header that fits inside 390px with zero clipping */
  .st-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 95 !important;
  }

  .st-nav-in {
    padding: 8px 10px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }

  .st-brand {
    gap: 7px !important;
    min-width: 0 !important;
    flex-shrink: 1 !important;
  }

  .st-brand img {
    width: 30px !important;
    height: 30px !important;
    flex-shrink: 0 !important;
  }

  .st-brand-title {
    font-size: 14px !important;
  }

  .st-brand-sub {
    font-size: 9px !important;
    letter-spacing: 0.03em !important;
  }

  .st-nav-right {
    gap: 5px !important;
    flex-shrink: 0 !important;
  }

  .st-nav-right .st-btn-dark,
  .st-nav-right .st-mobile-toggle {
    min-height: 38px !important;
    padding: 6px 9px !important;
    font-size: 12px !important;
  }

  #stHeaderTourBtn {
    display: none !important;
  }

  main.st-shell {
    padding: 12px 12px 48px !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }

  .fc-env-bar {
    padding: 14px 12px !important;
    border-radius: 14px !important;
    margin-bottom: 12px !important;
  }

  .fc-env-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .fc-env-btn {
    min-height: 70px !important;
    padding: 12px 13px !important;
  }

  .fc-env-btn-title {
    font-size: 15.5px !important;
  }

  .fc-env-btn-sub {
    font-size: 12.5px !important;
  }

  .fc-mqs-quick-actions {
    grid-template-columns: 1fr !important;
  }

  /* Single-column stacked workspace */
  #studioDeck,
  .st-workspace {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .st-col-soundboard,
  .st-col-prompter {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .st-steps-grid,
  .st-device-grid,
  .st-sliders-grid {
    grid-template-columns: 1fr !important;
  }

  /* Touch-friendly 44px+ tap buttons & 16px inputs (prevents iOS zoom) */
  main.st-shell button:not(.fc-env-util-btn),
  main.st-shell .st-btn-lime,
  main.st-shell .st-play-btn,
  main.st-shell .st-ctrl-btn,
  main.st-shell .st-pdf-read-btn,
  main.st-shell .st-pdf-dl-btn {
    min-height: 44px;
  }

  main.st-shell input,
  main.st-shell select,
  main.st-shell textarea {
    font-size: 16px !important;
  }

  /* Keep floating chat/bot widgets compact on mobile so they don't cover controls */
  .fc-env-toast {
    bottom: 16px;
    font-size: 13px;
  }
}
