/* ================================================================
   PHX APP — shared.css
   Demo Nav Bar + Mobile Responsive Overrides
   Injected into all 4 PHX App pages
   ================================================================ */

/* ── DEMO NAV BAR ──────────────────────────────────────────────── */
#demo-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99990;
  background: rgba(7, 7, 15, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(249, 115, 22, 0.2);
}

.demo-nav-inner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.demo-nav-inner::-webkit-scrollbar { display: none; }

.demo-nav-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #F97316;
  white-space: nowrap;
  padding-right: 0.6rem;
  border-right: 1px solid rgba(249, 115, 22, 0.25);
  margin-right: 0.1rem;
  flex-shrink: 0;
}

.demo-nav-pages {
  display: flex;
  gap: 0.35rem;
  flex: 1;
}

.demo-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.38rem 0.8rem;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: rgba(240, 240, 245, 0.5);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.07);
  white-space: nowrap;
  transition: all 0.16s ease;
  cursor: pointer;
}

.demo-nav-btn:hover {
  background: rgba(249, 115, 22, 0.12);
  color: #F97316;
  border-color: rgba(249, 115, 22, 0.35);
}

.demo-nav-btn.active {
  background: rgba(249, 115, 22, 0.18);
  color: #FB923C;
  border-color: rgba(249, 115, 22, 0.5);
  font-weight: 700;
}

.demo-nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  margin: 0 0.2rem;
}

.demo-nav-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.38rem 0.8rem;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  color: rgba(240, 240, 245, 0.4);
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  white-space: nowrap;
  transition: all 0.16s;
  flex-shrink: 0;
}

.demo-nav-switch:hover {
  color: #C9A84C;
  border-color: rgba(201, 168, 76, 0.5);
  background: rgba(201, 168, 76, 0.15);
}

.demo-nav-close {
  background: none;
  border: none;
  color: rgba(240, 240, 245, 0.25);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.38rem 0.5rem;
  margin-left: 0.1rem;
  flex-shrink: 0;
  transition: color 0.16s;
  border-radius: 5px;
}

.demo-nav-close:hover {
  color: rgba(240, 240, 245, 0.7);
  background: rgba(255, 255, 255, 0.06);
}

/* Push page content up so demo bar doesn't cover it */
body { padding-bottom: 52px; }

/* ── HAMBURGER BUTTON ──────────────────────────────────────────── */
.hamburger {
  display: none;
  position: fixed;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 1100;
  background: rgba(7, 7, 15, 0.96);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 9px;
  padding: 0.5rem 0.55rem;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  backdrop-filter: blur(10px);
  transition: border-color 0.16s;
}

.hamburger:hover { border-color: rgba(249, 115, 22, 0.6); }

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #F0F0F5;
  border-radius: 2px;
  transition: all 0.22s;
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.sidebar-overlay.active { display: block; }

/* ── MOBILE BREAKPOINT ─────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Show hamburger */
  .hamburger { display: flex !important; }

  /* ── Sidebar → slide-out drawer ── */
  .app-shell {
    display: block !important;
    grid-template-columns: none !important;
  }

  .sidebar {
    position: fixed !important;
    left: -270px !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 252px !important;
    z-index: 1001 !important;
    transition: left 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    overflow-y: auto;
  }

  .sidebar.mobile-open {
    left: 0 !important;
    box-shadow: 6px 0 32px rgba(0, 0, 0, 0.6);
  }

  /* Push topbar content past hamburger */
  .topbar {
    padding-left: 3.6rem !important;
  }

  /* ── KPI grids: 2-col on mobile ── */
  .kpi-row,
  .kpi-row-4,
  .kpi-row-3 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  /* ── General grids → single col ── */
  .grid-2,
  .grid-3,
  .pass-grid,
  .plan-cards,
  .eats-grid,
  .cuts-grid,
  .drop-grid,
  .pod-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Content padding */
  .content,
  .main > .content {
    padding: 1rem 0.85rem 110px !important;
  }

  /* Tables: horizontal scroll */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    width: 100%;
    font-size: 0.78rem !important;
  }

  /* Mini player: full width */
  .mini-player {
    left: 0 !important;
    right: 0 !important;
    padding: 0.6rem 1rem !important;
  }

  /* ── Landing page / index.html ── */
  .hero-inner {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 2rem;
  }

  .vert-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .pass-grid {
    grid-template-columns: 1fr !important;
  }

  .partner-cards {
    grid-template-columns: 1fr !important;
  }

  .founding-banner {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 1.5rem;
  }

  .approach-steps {
    grid-template-columns: 1fr !important;
  }

  .founder-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr !important;
    gap: 2rem;
  }

  .section-h2 {
    font-size: clamp(2rem, 8vw, 3rem) !important;
  }

  .phx-hero-h1 {
    font-size: clamp(4rem, 18vw, 7rem) !important;
  }

  section {
    padding: 4rem 1.2rem !important;
  }

  /* Nav */
  .nav-links {
    display: none !important;
  }

  .nav-ctas .btn-secondary {
    display: none !important;
  }

  /* Charts */
  canvas {
    max-height: 200px !important;
  }

  /* KPI values */
  .kpi-val {
    font-size: 1.3rem !important;
  }

  /* Modals full-screen */
  .modal-box {
    width: 95vw !important;
    max-height: 88vh !important;
    overflow-y: auto;
  }

  /* Partner type toggle */
  .type-toggle {
    margin: 0.6rem !important;
  }

  /* Tab bars: scrollable */
  .partner-tabs,
  .tab-bar,
  .plan-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .partner-tabs::-webkit-scrollbar,
  .tab-bar::-webkit-scrollbar,
  .plan-tabs::-webkit-scrollbar { display: none; }

  /* Pass card: no transform on featured */
  .pass-card.featured {
    transform: none !important;
  }
}

@media (max-width: 480px) {
  .kpi-row,
  .kpi-row-4 {
    grid-template-columns: 1fr !important;
  }

  .vert-grid {
    grid-template-columns: 1fr !important;
  }

  .footer-cols {
    grid-template-columns: 1fr !important;
  }

  .phx-hero-h1 {
    font-size: clamp(3.5rem, 20vw, 5rem) !important;
  }
}

/* ── APP.HTML MOBILE — New elements ───────────────────────────── */
@media (max-width: 768px) {

  /* Topbar: shrink CTA text on small screens */
  #topbar-cta { font-size: .76rem !important; padding: .4rem .7rem !important; }
  #plays-left-badge { font-size: .72rem !important; padding: .3rem .55rem !important; }
  .topbar-right { gap: .4rem !important; }

  /* Music stats bar: stack to 1-col */
  .music-stats-bar {
    grid-template-columns: 1fr !important;
    gap: .6rem !important;
  }
  .mstat { padding: .75rem 1rem !important; }

  /* Expanded player: stack art + info vertically */
  .music-player-expanded {
    padding: 1rem !important;
  }
  .np-body {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: .75rem !important;
  }
  .np-art-big {
    width: 130px !important;
    height: 130px !important;
    font-size: 3.5rem !important;
    flex-shrink: 0 !important;
  }
  .np-details { min-width: unset !important; width: 100% !important; }
  .np-side-actions {
    flex-direction: row !important;
    justify-content: center !important;
    gap: 1rem !important;
  }
  .np-title-big { font-size: 1.2rem !important; }

  /* Controls: larger tap targets */
  .np-controls { gap: .3rem !important; flex-wrap: wrap !important; justify-content: center !important; }
  .ctrl-btn { min-width: 44px !important; min-height: 44px !important; font-size: 1rem !important; }
  .ctrl-btn.play { min-width: 54px !important; min-height: 54px !important; font-size: 1.4rem !important; }

  /* Queue: tighter on mobile */
  .queue-section { margin-top: .75rem !important; padding: .75rem !important; }
  .track-row { padding: .65rem .5rem !important; }
  .track-time { display: none !important; } /* hide duration, show streams */

  /* Fan payout card */
  .fan-payout-card { padding: 1rem !important; }
  .fan-payout-title { font-size: .9rem !important; }

  /* Artist stat grid: 2-col on tablet */
  .a-stat-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Track management rows: hide earnings col */
  .tm-earnings { display: none !important; }

  /* Admin KPI grid: 2-col */
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .admin-kpi-val { font-size: 1.4rem !important; }

  /* System settings: stack value above button */
  .sys-setting-row { flex-wrap: wrap !important; gap: .5rem !important; }
  .sys-setting-val { margin-right: 0 !important; }

  /* Submit form */
  .submit-form-card { padding: 1rem !important; }
  .upload-zone { padding: 1.2rem !important; }

  /* Earnings hero */
  .earnings-main { font-size: 2rem !important; }

  /* Artist spotlight on music view */
  .artist-banner { flex-direction: column !important; align-items: flex-start !important; }

  /* Pass chip in sidebar */
  .pass-chip { margin: .6rem .8rem !important; }

  /* Demo bar: move to TOP on mobile so it doesn't conflict with bottom tabs */
  #demo-nav {
    top: 0 !important;
    bottom: auto !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(249,115,22,.2) !important;
  }
  body {
    padding-bottom: 0 !important;
    padding-top: 48px !important;  /* demo nav height */
  }
  #demo-nav .demo-nav-inner {
    padding: .35rem .6rem !important;
    gap: .3rem !important;
  }
  .demo-nav-btn, .demo-role-btn {
    font-size: .7rem !important;
    padding: .28rem .5rem !important;
  }
  .demo-nav-label { display: none !important; }

  /* Mini player: full-width, sits above bottom tabs */
  .mini-player {
    left: 0 !important;
    right: 0 !important;
    bottom: 60px !important;
    padding: .6rem 1rem !important;
    border-radius: 14px 14px 0 0 !important;
    gap: .7rem !important;
  }
  .mp-time { display: none !important; }
  .mp-bar { display: none !important; }
  /* Give title/artist real room; single line each, ellipsis overflow */
  .mp-info { flex: 1 1 auto !important; min-width: 80px !important; }
  .mp-artist {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .mp-controls { gap: .6rem !important; flex-shrink: 0 !important; }

  /* Content: space for mini player + bottom tabs */
  .content, .main > .content {
    padding-bottom: 150px !important;
  }

  /* Upgrade gate card */
  .upgrade-gate-card { padding: 1.2rem !important; }
}

/* ── BOTTOM TAB BAR — mobile only ─────────────────────────────── */
.bottom-tabs { display: none; }

@media (max-width: 768px) {
  .bottom-tabs {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg2, #0A0A12);
    border-top: 1px solid rgba(241,241,248,.07);
    z-index: 400;
    /* safe area for iPhone home indicator */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .bt-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    color: #6B7280;
    border: none;
    background: transparent;
    padding: .5rem 0 .4rem;
    transition: color .15s, transform .1s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  .bt-item .bt-icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .bt-item .bt-lbl {
    font-family: 'Space Grotesk', sans-serif;
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1;
  }

  .bt-item .bt-icon {
    filter: grayscale(1) brightness(1.2);
    opacity: .75;
  }

  .bt-item.active .bt-icon {
    filter: none;
    opacity: 1;
  }

  .bt-item.active {
    color: #F97316;
  }

  /* Active indicator dot under icon */
  .bt-item.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #F97316;
    border-radius: 50%;
  }

  .bt-item:active {
    transform: scale(.88);
    color: #F97316;
  }
}

@media (max-width: 480px) {
  /* Single col everything on phone */
  .admin-kpi-grid { grid-template-columns: 1fr !important; }
  .a-stat-grid { grid-template-columns: 1fr !important; }

  /* Topbar: compact — keep Log In/Out + bell, shrink labels */
  .topbar-right .tb-btn:not(#topbar-cta):not(#plays-left-badge):not(#auth-btn):not(#notif-bell) { display: none !important; }
  #auth-btn { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem !important; padding: .35rem .55rem !important; }
  #notif-bell { font-size: .8rem !important; padding: .35rem .5rem !important; }
  .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

  /* Music player: bigger art on small screen */
  .np-art-big { width: 120px !important; height: 120px !important; font-size: 3rem !important; }
  .music-player-expanded { padding: .75rem !important; border-radius: 12px !important; }
  .np-controls .ctrl-skip { display: none !important; }

  /* Artist stats: stack */
  .a-stat-grid { gap: .6rem !important; }
  .a-stat-val { font-size: 1.4rem !important; }
}
