/* ═══════════════════════════════════════════════════════════════
   Dancefloor — enhancements.css
   Features: dark/light theme · theme toggle · page transitions ·
             upload FAB · hero upgrades · onboarding polish
   Load AFTER main.css and brand.css on every page.
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   1. SMOOTH THEME TRANSITIONS
   ───────────────────────────────────────────────────────────── */
html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

*,
*::before,
*::after {
  transition:
    background-color .22s ease,
    border-color .22s ease,
    color .18s ease,
    box-shadow .22s ease;
}
/* Never animate these — would look wrong */
img, video, svg, canvas,
.style-tile, .style-tile-bg, .style-tile-icon,
.spb-bg, .music-bar,
.vid-skeleton, [class*="skeleton"] { transition: none !important; }


/* ─────────────────────────────────────────────────────────────
   2. DARK THEME (explicit — mirrors :root values in main.css)
   ───────────────────────────────────────────────────────────── */
html[data-theme="dark"] {
  --bg-primary:       #0e0c0a;
  --bg-secondary:     #161310;
  --bg-tertiary:      #1e1a16;
  --bg-card:          rgba(255,255,255,.05);
  --bg-card-hover:    rgba(255,255,255,.08);
  --text-primary:     #f0ede8;
  --text-secondary:   rgba(240,237,232,.58);
  --text-tertiary:    rgba(240,237,232,.32);
  --border:           rgba(255,255,255,.08);
  --border-secondary: rgba(255,255,255,.14);
  --coral:            #CC5500;
  --coral-light:      rgba(204,85,0,.11);
  --coral-border:     rgba(204,85,0,.28);
  /* theme toggle internals */
  --tt-bg:    rgba(255,255,255,.08);
  --tt-hover: rgba(255,255,255,.14);
  --tt-icon:  rgba(240,236,230,.75);
}


/* ─────────────────────────────────────────────────────────────
   3. LIGHT THEME
   ───────────────────────────────────────────────────────────── */
html[data-theme="light"] {
  --bg-primary:       #f7f4f0;
  --bg-secondary:     #edeae5;
  --bg-tertiary:      #e3dfd8;
  --bg-card:          rgba(255,255,255,.9);
  --bg-card-hover:    #ffffff;
  --text-primary:     #1c1a17;
  --text-secondary:   #5a5450;
  --text-tertiary:    #9a9490;
  --border:           rgba(0,0,0,.09);
  --border-secondary: rgba(0,0,0,.15);
  --coral:            #CC5500;
  --coral-light:      rgba(204,85,0,.10);
  --coral-border:     rgba(204,85,0,.28);
  --tt-bg:    rgba(0,0,0,.06);
  --tt-hover: rgba(0,0,0,.10);
  --tt-icon:  #5a5450;
}

/* Light — component-level overrides for things using hard-coded colours */
html[data-theme="light"] body {
  background: var(--bg-primary);
  color: var(--text-primary);
}
html[data-theme="light"] .topnav {
  background: rgba(247,244,240,.97) !important;
  border-bottom-color: rgba(0,0,0,.08) !important;
}
html[data-theme="light"] .hero-section {
  background: linear-gradient(160deg, #f7f4f0 0%, #edeae5 100%);
}
html[data-theme="light"] .hero-sub { color: var(--text-secondary) !important; }
html[data-theme="light"] .hero-cta-secondary {
  background: rgba(0,0,0,.06) !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
}
html[data-theme="light"] .fcard {
  background: rgba(0,0,0,.05) !important;
  border-color: rgba(0,0,0,.1) !important;
}
html[data-theme="light"] .vid-card,
html[data-theme="light"] .dancer-card { background: #fff; border-color: var(--border); }
html[data-theme="light"] .vid-card:hover,
html[data-theme="light"] .dancer-card:hover { background: var(--bg-card-hover); }
html[data-theme="light"] .vid-thumb,
html[data-theme="light"] .vid-skeleton { background: var(--bg-tertiary); }
html[data-theme="light"] .challenge-banner { border-color: var(--coral-border) !important; }
html[data-theme="light"] .site-footer {
  background: rgba(237,234,229,.9);
  border-top-color: var(--border);
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #fff;
  border-color: var(--border-secondary);
  color: var(--text-primary);
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: var(--text-tertiary); }
html[data-theme="light"] select option { background: #fff; color: #1c1a17; }
html[data-theme="light"] .filter-chip,
html[data-theme="light"] .nav-btn { background: transparent; color: var(--text-secondary); }
html[data-theme="light"] .nav-btn:hover { background: rgba(0,0,0,.05); color: var(--text-primary); }
html[data-theme="light"] .nav-auth-btn {
  background: rgba(0,0,0,.05) !important;
  border-color: rgba(0,0,0,.12) !important;
}
html[data-theme="light"] .nav-auth-btn .signin { color: var(--text-secondary); }
html[data-theme="light"] .auth-card {
  background: rgba(255,255,255,.92);
  border-color: var(--border-secondary);
}
html[data-theme="light"] .auth-divider span { background: var(--bg-primary); }
html[data-theme="light"] .upload-zone {
  background: #fff;
  border-color: var(--border-secondary);
}
html[data-theme="light"] .upload-zone:hover,
html[data-theme="light"] .upload-zone.dragover {
  background: rgba(204,85,0,.04);
  border-color: rgba(204,85,0,.4);
}
html[data-theme="light"] .ob-card {
  background: rgba(255,255,255,.88);
  border-color: var(--border-secondary);
}
html[data-theme="light"] .follow-item { background: #fff; border-color: var(--border); }
html[data-theme="light"] .launch-card { background: var(--bg-secondary); border-color: var(--border); }
html[data-theme="light"] #music-toast {
  background: rgba(255,255,255,.97) !important;
  color: #1c1a17 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.15) !important;
}
/* Keep the mobile nav drawer always dark — it's a dark surface by design */
html[data-theme="light"] .mobile-nav-drawer { background: #1a1714 !important; }
html[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg-secondary); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); }


/* ─────────────────────────────────────────────────────────────
   4. THEME TOGGLE BUTTON  (injected into #nav-right by JS)
   ───────────────────────────────────────────────────────────── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--tt-bg, rgba(255,255,255,.08));
  color: var(--tt-icon, rgba(240,236,230,.75));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s, transform .18s !important;
}
.theme-toggle:hover { background: var(--tt-hover, rgba(255,255,255,.14)) !important; }
.theme-toggle:active { transform: scale(.9); }
.theme-toggle:focus-visible { outline: 2px solid #CC5500; outline-offset: 2px; }

.theme-toggle .tt-moon,
.theme-toggle .tt-sun {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .2s ease, transform .3s cubic-bezier(.34,1.56,.64,1) !important;
}
/* Dark: show moon */
html:not([data-theme]) .tt-moon,
html[data-theme="dark"]  .tt-moon { opacity: 1; transform: rotate(0deg) scale(1); }
html:not([data-theme]) .tt-sun,
html[data-theme="dark"]  .tt-sun  { opacity: 0; transform: rotate(90deg) scale(.5); }
/* Light: show sun */
html[data-theme="light"] .tt-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
html[data-theme="light"] .tt-sun  { opacity: 1; transform: rotate(0deg) scale(1); }


/* ─────────────────────────────────────────────────────────────
   5. PAGE TRANSITIONS
   ───────────────────────────────────────────────────────────── */
/* Coral progress bar at top of viewport */
#df-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: #CC5500;
  z-index: 9999;
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
}
#df-bar.start { opacity: 1; transform: scaleX(.3); }
#df-bar.mid   { transform: scaleX(.72); transition: transform .5s ease; }
#df-bar.done  { transform: scaleX(1); }
#df-bar.gone  { opacity: 0; transition: opacity .4s .1s; }

/* Page fade-in on load */
.df-fadein { animation: dfIn .3s cubic-bezier(.25,.46,.45,.94) both; }
@keyframes dfIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}


/* ─────────────────────────────────────────────────────────────
   6. FLOATING UPLOAD FAB
   ───────────────────────────────────────────────────────────── */
.df-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 140;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  background: #CC5500;
  color: #fff;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(204,85,0,.45);
  white-space: nowrap;
  transition: transform .2s, box-shadow .2s !important;
  -webkit-tap-highlight-color: transparent;
}
.df-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(204,85,0,.6);
  color: #fff;
}
.df-fab:active { transform: scale(.96); }
@media (max-width: 480px) {
  .df-fab { padding: 14px; border-radius: 50%; bottom: 20px; right: 20px; }
  .df-fab .df-fab-txt { display: none; }
}


/* ─────────────────────────────────────────────────────────────
   7. HERO UPGRADES — video mosaic grid
   ───────────────────────────────────────────────────────────── */
.hero-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 110px 110px 110px;
  gap: 8px;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}
.hero-mosaic-cell {
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-tertiary);
  position: relative;
  animation: mcPop .45s cubic-bezier(.34,1.56,.64,1) both;
}
.hero-mosaic-cell:nth-child(1) { grid-row: span 2; animation-delay: .04s; }
.hero-mosaic-cell:nth-child(2) { animation-delay: .1s; }
.hero-mosaic-cell:nth-child(3) { animation-delay: .16s; }
.hero-mosaic-cell:nth-child(4) { animation-delay: .22s; }
.hero-mosaic-cell:nth-child(5) { grid-column: span 2; animation-delay: .28s; }
@keyframes mcPop {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: scale(1);   }
}
.hero-mosaic-cell img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .4s ease !important;
}
.hero-mosaic-cell:hover img { transform: scale(1.06); }
.hero-mosaic-cell .mc-over {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 55%);
}
.hero-mosaic-cell .mc-label {
  position: absolute; bottom: 8px; left: 10px;
  font-size: 11px; font-weight: 600;
  color: rgba(255,255,255,.9);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.hero-mosaic-cell .mc-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(204,85,0,.8);
  border: 1.5px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s !important;
}
.hero-mosaic-cell:hover .mc-play { opacity: 1; }
/* Shimmer placeholder while loading */
.mc-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    var(--bg-tertiary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: shimmerSlide 1.6s ease-in-out infinite;
}
@keyframes shimmerSlide {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Animated stat counters */
.hstat-num { font-variant-numeric: tabular-nums; }


/* ─────────────────────────────────────────────────────────────
   8. ONBOARDING POLISH
   ───────────────────────────────────────────────────────────── */
/* "♪ hover" audio hint label on style picker buttons */
.spb-hint {
  position: absolute; bottom: 8px; right: 8px; z-index: 4;
  font-size: 9px; font-weight: 600; color: rgba(255,255,255,.7);
  background: rgba(0,0,0,.4); border-radius: 8px;
  padding: 2px 7px; letter-spacing: .03em;
  opacity: 0; pointer-events: none;
  transition: opacity .2s !important;
}
.style-pick-btn:hover .spb-hint { opacity: 1; }
.style-pick-btn.sel .spb-hint   { display: none; }

/* Glowing selection ring */
.style-pick-btn.sel {
  box-shadow: 0 0 0 2px #CC5500, 0 0 16px rgba(204,85,0,.35) !important;
}

/* Soft pulsing halo on active progress dot */
.prog-step.active {
  animation: dotHalo 1.8s ease-in-out infinite;
}
@keyframes dotHalo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204,85,0,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(204,85,0,0); }
}

/* Follow item slide */
.follow-item { transition: transform .15s, border-color .15s !important; }
.follow-item:hover { transform: translateX(3px); }

/* Celebration ring on step 3 */
.ob-celebrate-ring {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(204,85,0,.13);
  border: 2px solid rgba(204,85,0,.4);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; font-size: 26px;
  animation: celebBounce .5s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes celebBounce {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
