/* ============================================================
   MEGAHITS VIBEZ — DESIGN TOKENS
   Palette:  #0d0d10 base · #1a1a20 card · #ff0055 neon pink (signal)
             #c9cbd6 → #f4f5fa silver (brand metal) · #f5f5f7 text
   Type:     Display  → 'Rajdhani'      (angular, mechanical, neon-ready)
              Body     → 'Inter'         (quiet workhorse)
              Utility  → 'JetBrains Mono'(live data, badges, timers)
   Signature: the silver "MEGA" wordmark bleeds into a live neon
              waveform underline that reacts to whatever is currently
              playing in the Draggable Audio Player.
   ============================================================ */

:root {
  --bg-base: #0d0d10;
  --bg-elevated: #131318;
  --card-bg: rgba(28, 28, 34, 0.92);
  --card-bg-solid: #1c1c22;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-strong: rgba(255, 255, 255, 0.16);

  --accent: #ff0055;
  --accent-dim: rgba(255, 0, 85, 0.16);
  --accent-glow: rgba(255, 0, 85, 0.45);

  --silver-1: #eef0f7;
  --silver-2: #b9bcc9;
  --silver-3: #7d8092;

  --text-primary: #f5f5f7;
  --text-secondary: #b3b3bc;
  --text-muted: #74747f;

  --success: #22c55e;
  --live-red: #ff2d55;
  --warning: #ffb020;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --header-height: 65px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
input, select { font-family: inherit; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon { width: 20px; height: 20px; stroke-width: 1.75; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   1. TOP HEADER BAR
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  background: rgba(13, 13, 16, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
}

.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand-mega {
  background: linear-gradient(180deg, var(--silver-1), var(--silver-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-hits { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
}
.search-input {
  width: 100%;
  height: 40px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0 40px 0 40px;
  font-size: 0.9rem;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.08); }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--card-bg-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-height: 60vh;
  overflow-y: auto;
  display: none;
  z-index: 1001;
}
.search-results.active { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(255, 255, 255, 0.04); }
.search-result-category {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
}

/* Mobile search toggle — hidden by default; CSS below swaps it in under 640px */
.search-toggle-btn { display: none; }

.search-modal-overlay { align-items: flex-start; }
.search-modal-panel {
  width: 100%;
  max-width: 640px;
  margin-top: 12px;
  max-height: 90vh;
}
.search-wrap-mobile { flex: 1; max-width: none; margin: 0; }
#search-results-mobile { padding: 0; }
#search-results-mobile .search-result-item { padding: 14px 20px; }
#search-results-mobile:empty::after {
  content: 'Start typing to search across every category…';
  display: block;
  padding: 24px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  #search-wrap-desktop { display: none; }
  .search-toggle-btn { display: grid; }
  .brand span.brand-text { display: none; }
}

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.signin-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: #1f1f1f;
  font-weight: 600;
  font-size: 0.85rem;
  transition: transform 0.15s var(--ease);
}
.signin-btn:hover { transform: translateY(-1px); }

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
}

/* ============================================================
   2. HERO SLIDER
   ============================================================ */
.hero-slider {
  position: relative;
  height: 340px;
  margin: 10px 16px 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  isolation: isolate;
}
@media (min-width: 900px) { .hero-slider { height: 440px; margin: 16px auto 32px; max-width: 1200px; } }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease);
  background-size: cover;
  background-position: center;
}
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13,13,16,0.15) 0%, rgba(13,13,16,0.55) 55%, rgba(13,13,16,0.96) 100%);
}

.hero-content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(255, 0, 85, 0.35);
  margin-bottom: 12px;
}
.hero-badge.live { background: rgba(255, 45, 85, 0.18); color: var(--live-red); border-color: rgba(255, 45, 85, 0.4); }
.hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  letter-spacing: 0.01em;
  margin-bottom: 8px;
  max-width: 640px;
}
.hero-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 480px;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions { display: flex; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.85rem;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 24px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); border: 1px solid var(--border-color-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }

.hero-dots {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  gap: 6px;
  z-index: 2;
}
.hero-dot {
  width: 22px; height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.25);
  transition: background 0.3s var(--ease), width 0.3s var(--ease);
}
.hero-dot.active { background: var(--accent); width: 32px; }

/* ============================================================
   3. CATEGORY GRID
   ============================================================ */
.section { max-width: 1200px; margin: 0 auto; padding: 0 16px 36px; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .icon { color: var(--accent); }
.section-link { font-size: 0.8rem; color: var(--text-muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 0, 85, 0.3);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
}

.card-media {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bg-elevated);
  margin-bottom: 10px;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }

.rating-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(13, 13, 16, 0.75);
  backdrop-filter: blur(6px);
  color: var(--warning);
}
.rating-badge .icon { width: 12px; height: 12px; }

.live-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--live-red);
  color: #fff;
}
.live-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: pulse-dot 1.4s infinite; }

.card-title { font-weight: 600; font-size: 0.92rem; margin-bottom: 2px; }
.card-sub { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 10px; }

.card-actions { display: flex; gap: 8px; }
.chip-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 500;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip-btn:hover { background: var(--accent-dim); border-color: rgba(255,0,85,0.4); color: var(--accent); }
.chip-btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.chip-btn.primary:hover { filter: brightness(1.1); }

/* Sports scoreboard card variant */
.score-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.score-team { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.85rem; }
.score-team img { width: 24px; height: 24px; object-fit: contain; }
.score-value { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700; }
.score-minute { font-family: var(--font-mono); font-size: 0.72rem; color: var(--live-red); text-align: center; }

/* Weather card variant */
.weather-temp { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 700; }
.weather-meta { display: flex; gap: 14px; font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }

/* Crypto card variant */
.crypto-row { display: flex; align-items: center; justify-content: space-between; }
.crypto-price { font-family: var(--font-mono); font-weight: 700; }
.crypto-change.up { color: var(--success); }
.crypto-change.down { color: var(--live-red); }

/* ============================================================
   4. DRAGGABLE FLOATING AUDIO PLAYER
   ============================================================ */
.audio-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 340px;
  max-width: calc(100vw - 32px);
  height: 74px;
  border-radius: var(--radius-lg);
  background: rgba(23, 23, 28, 0.98);
  border: 1px solid rgba(255, 0, 85, 0.35);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  z-index: 9999;
  touch-action: none;
  transform: translate(var(--px, 0), var(--py, 0));
  transition: box-shadow 0.2s var(--ease);
}
.audio-player.dragging { box-shadow: 0 26px 60px rgba(255, 0, 85, 0.25); cursor: grabbing; }
.audio-player.hidden { display: none; }

.drag-handle {
  color: var(--text-muted);
  cursor: grab;
  padding: 4px;
  touch-action: none;
}

.player-cover {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  animation: spin-disc 9s linear infinite;
  animation-play-state: paused;
  border: 2px solid var(--card-bg-solid);
}
.audio-player.playing .player-cover { animation-play-state: running; }
@keyframes spin-disc { to { transform: rotate(360deg); } }

.player-meta { flex: 1; min-width: 0; }
.player-track { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-artist { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-progress {
  width: 100%; height: 3px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.12); margin-top: 6px; overflow: hidden;
}
.player-progress-fill { height: 100%; width: 32%; background: var(--accent); }

.player-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.player-play-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
}

/* Minimized bubble state */
.audio-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 0 10px 26px rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
}
.audio-bubble.active { display: block; }
.audio-bubble img { width: 100%; height: 100%; object-fit: cover; animation: spin-disc 9s linear infinite; }

/* ============================================================
   5. SIDEBAR NAVIGATION
   ============================================================ */
.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1999;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  max-width: 82vw;
  height: 100vh;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-color);
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.3s var(--ease);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar.active { transform: translateX(0); }

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 18px 8px;
}

.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  position: relative;
}
.sidebar-link:hover, .sidebar-link.active { background: rgba(255, 0, 85, 0.08); color: var(--text-primary); }
.sidebar-link.active { border-right: 3px solid var(--accent); }
.sidebar-link .icon { color: var(--text-muted); }
.sidebar-link:hover .icon, .sidebar-link.active .icon { color: var(--accent); }

.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.04em;
}
.nav-badge.live { background: rgba(255,45,85,0.18); color: var(--live-red); }

.sidebar-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px;
}
.toggle-switch {
  width: 42px; height: 24px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.12);
  position: relative;
  transition: background 0.2s var(--ease);
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
}
.toggle-switch.on { background: var(--success); }
.toggle-switch.on::after { transform: translateX(18px); }

.sidebar-footer { margin-top: auto; padding: 16px 18px; font-size: 0.72rem; color: var(--text-muted); border-top: 1px solid var(--border-color); }

/* ============================================================
   6. MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 3000;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-panel {
  background: var(--card-bg-solid);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: 86vh;
  overflow-y: auto;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s var(--ease);
}
.modal-overlay.active .modal-panel { transform: translateY(0) scale(1); }

.modal-panel.wide { max-width: 720px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}
.modal-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.modal-title .icon { color: var(--accent); }
.modal-body { padding: 20px; }

.field { margin-bottom: 18px; }
.field-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 8px; display: block; }

.option-row { display: flex; gap: 8px; }
.option-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.option-btn.selected { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.select-input {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0 12px;
}

.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border-color); }
.btn-block { width: 100%; justify-content: center; }

/* Join Us drawer variant slides from bottom */
.drawer-overlay { align-items: flex-end; }
.drawer-panel {
  max-width: 560px;
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transform: translateY(100%);
}
.modal-overlay.active .drawer-panel { transform: translateY(0); }

.social-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.social-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 500;
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease);
}
.social-link:hover { transform: translateY(-2px); border-color: var(--accent); }

/* Toast notifications — replace native browser alerts */
.toast-container {
  position: fixed;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(90vw, 360px);
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--card-bg-solid);
  border: 1px solid var(--border-color-strong);
  font-size: 0.85rem;
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
  animation: toast-in 0.25s var(--ease);
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.success .icon { color: var(--success); }
.toast.error { border-color: rgba(255,45,85,0.4); }
.toast.error .icon { color: var(--live-red); }
.toast.leaving { animation: toast-out 0.2s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ============================================================
   7. FOOTER
   ============================================================ */
.app-footer {
  margin-top: 40px;
  padding: 28px 20px 100px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-social { display: flex; gap: 14px; }
.footer-social a {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.footer-social a:hover { background: var(--accent); color: #fff; }
.footer-copy { font-size: 0.78rem; color: var(--text-muted); }
.pwa-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--success);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.3);
}

/* ============================================================
   HOME PREVIEW ROWS (lite homepage)
   ============================================================ */
.preview-row-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.view-all-link {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
}
.preview-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
}
.preview-row .card { scroll-snap-align: start; }
.preview-row::-webkit-scrollbar { height: 6px; }
.preview-row::-webkit-scrollbar-thumb { background: var(--border-color-strong); border-radius: var(--radius-pill); }

/* ============================================================
   CATEGORY PAGE
   ============================================================ */
.back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-secondary);
  padding: 8px 4px; margin-bottom: 14px;
  transition: color 0.2s var(--ease);
}
.back-btn:hover { color: var(--accent); }

.category-page-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
}
.category-page-header .icon { color: var(--accent); }
.category-page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.toolbar-search {
  position: relative;
  margin-bottom: 16px;
}
.toolbar-search input {
  width: 100%; height: 44px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0 16px 0 42px;
  font-size: 0.9rem;
}
.toolbar-search input:focus { border-color: var(--accent); }
.toolbar-search .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.filter-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.filter-chip.active, .filter-chip:hover { background: var(--accent-dim); border-color: rgba(255,0,85,0.4); color: var(--accent); }

/* Weather category page */
.weather-hero-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--card-bg); border: 1px solid var(--border-color);
  margin-bottom: 18px;
}
.weather-hero-temp { font-family: var(--font-mono); font-size: 3.2rem; font-weight: 700; }
.forecast-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(90px,1fr); gap: 10px; overflow-x: auto; margin-bottom: 20px; }
.forecast-day-card { text-align: center; padding: 14px 8px; border-radius: var(--radius-md); background: var(--card-bg); border: 1px solid var(--border-color); }
.forecast-day-card .day { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.forecast-day-card .temp { font-family: var(--font-mono); font-weight: 700; }
.city-search-results { margin-top: 8px; }
.city-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--card-bg); border: 1px solid var(--border-color);
  margin-bottom: 6px; font-size: 0.85rem;
}
.city-result-item:hover { border-color: var(--accent); }

/* Sports category page */
.league-select-row { display: flex; gap: 10px; margin-bottom: 18px; }
.standings-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.standings-table th { text-align: left; color: var(--text-muted); font-weight: 500; padding: 8px 6px; border-bottom: 1px solid var(--border-color); }
.standings-table td { padding: 8px 6px; border-bottom: 1px solid var(--border-color); }
.standings-table .team-cell { display: flex; align-items: center; gap: 8px; }
.standings-table img { width: 18px; height: 18px; object-fit: contain; }

/* Finance converter */
.converter-box {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 16px; border-radius: var(--radius-md);
  background: var(--card-bg); border: 1px solid var(--border-color);
  margin-bottom: 20px;
}
.converter-box input, .converter-box select {
  height: 42px; border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05); border: 1px solid var(--border-color);
  color: var(--text-primary); padding: 0 10px;
}
.converter-result { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; }
/* Search bar responsiveness is handled by #search-wrap-desktop /
   .search-toggle-btn rules above. */

/* ============================================================
   FLOATING TRAILER WINDOW — draggable, minimize/maximize, decorative controls
   ============================================================ */
.trailer-window {
  position: fixed;
  top: 90px;
  right: 20px;
  width: 340px;
  max-width: calc(100vw - 32px);
  display: flex;
  flex-direction: column;
  background: rgba(20, 20, 25, 0.98);
  border: 1px solid rgba(255, 0, 85, 0.35);
  border-radius: var(--radius-lg);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
  z-index: 9998;
  overflow: hidden;
}
.trailer-window.hidden { display: none; }
.trailer-window.maximized {
  top: 12px; left: 12px; right: 12px; bottom: 12px;
  width: auto; max-width: none;
}
.trailer-window-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-color);
  cursor: grab;
  touch-action: none;
  flex-shrink: 0;
}
.trailer-window-header.dragging { cursor: grabbing; }
.trailer-window-title-text {
  flex: 1; font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.trailer-window-actions { display: flex; gap: 2px; }
.trailer-window-actions button {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 6px; color: var(--text-secondary);
}
.trailer-window-actions button:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }

.trailer-window-body { position: relative; aspect-ratio: 16 / 9; background: #000; flex-shrink: 0; }
.trailer-window.maximized .trailer-window-body { aspect-ratio: unset; flex: 1; }
.trailer-window-body iframe,
.trailer-window-body video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trailer-window-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 20px; text-align: center; font-size: 0.85rem; color: var(--text-secondary);
}

.trailer-window-controls {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; background: rgba(255, 255, 255, 0.02); flex-shrink: 0;
}
.trailer-window-controls button {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.06); color: var(--text-secondary);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.trailer-window-controls button:hover { background: var(--accent-dim); color: var(--accent); }
.trailer-window-controls button.primary { background: var(--accent); color: #fff; width: 40px; height: 40px; }
.trailer-window-controls button.primary:hover { filter: brightness(1.1); }

.trailer-bubble {
  position: fixed; bottom: 88px; right: 20px;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--card-bg-solid); border: 2px solid var(--accent);
  display: none; align-items: center; justify-content: center;
  color: var(--accent);
  z-index: 9998;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}
.trailer-bubble .icon { width: 26px; height: 26px; }
.trailer-bubble.active { display: flex; }
@media (min-width: 900px) {
  .trailer-bubble { width: 72px; height: 72px; bottom: 104px; }
  .trailer-bubble .icon { width: 30px; height: 30px; }
}
#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-mark { position: relative; width: 110px; height: 110px; display: flex; align-items: center; justify-content: center; }
.preloader-disc {
  width: 72px; height: 72px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #2a2a32, #0d0d10 70%);
  box-shadow: 0 0 34px rgba(255, 0, 85, 0.4), inset 0 0 14px rgba(0, 0, 0, 0.6);
  animation: preloader-pulse 1.7s ease-in-out infinite;
}
@keyframes preloader-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.preloader-arcs { position: absolute; inset: 0; width: 100%; height: 100%; animation: preloader-spin 3s linear infinite; }
.arc { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 0, 85, 0.6)); }
.arc-bottom { stroke: var(--silver-2); opacity: 0.85; }
@keyframes preloader-spin { to { transform: rotate(360deg); } }

.preloader-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  animation: preloader-fade 1.7s ease-in-out infinite;
}
.preloader-mega { background: linear-gradient(180deg, var(--silver-1), var(--silver-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.preloader-hits { color: var(--accent); text-shadow: 0 0 14px var(--accent-glow); }
@keyframes preloader-fade { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.preloader-bar { width: 130px; height: 3px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.preloader-bar-fill { width: 36%; height: 100%; background: var(--accent); border-radius: var(--radius-pill); animation: preloader-bar 1.1s ease-in-out infinite; }
@keyframes preloader-bar { 0% { transform: translateX(-120%); } 100% { transform: translateX(380%); } }

html[data-theme="light"] #preloader { background: var(--bg-base); }
html[data-theme="light"] .preloader-disc { background: radial-gradient(circle at 35% 35%, #e6e6ea, #ffffff 70%); box-shadow: 0 0 34px rgba(255, 0, 85, 0.25), inset 0 0 14px rgba(0, 0, 0, 0.08); }

/* ============================================================
   ACTION-LOADING SPINNER (small, inline — search, tab switches, etc.)
   ============================================================ */
.spinner-sm {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinner-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spinner-spin { to { transform: rotate(360deg); } }
.loading-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 10px 2px;
}
html[data-theme="light"] .spinner-sm { border-color: rgba(13, 13, 16, 0.12); border-top-color: var(--accent); }
.user-menu { position: relative; }
.avatar-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  position: relative;
  background: var(--card-bg-solid);
}
.avatar-btn .avatar {
  width: 100%; height: 100%;
  border: none; border-radius: 0;
  object-fit: cover;
}
.avatar-fallback {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  background: var(--accent);
  color: #fff;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: var(--card-bg-solid);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  padding: 6px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s var(--ease);
  z-index: 1002;
}
.user-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown-name {
  padding: 8px 12px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.user-dropdown-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.user-dropdown-item.logout:hover { background: rgba(255, 45, 85, 0.12); color: var(--live-red); }
html[data-theme="light"] {
  --bg-base: #f4f4f7;
  --bg-elevated: #ffffff;
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-bg-solid: #ffffff;
  --border-color: rgba(13, 13, 16, 0.09);
  --border-color-strong: rgba(13, 13, 16, 0.18);
  --text-primary: #14141a;
  --text-secondary: #4a4a55;
  --text-muted: #82828d;
}
html[data-theme="light"] .app-header { background: rgba(255, 255, 255, 0.88); }
html[data-theme="light"] .hero-slide::after {
  background: linear-gradient(180deg, rgba(244,244,247,0.05) 0%, rgba(244,244,247,0.32) 55%, rgba(244,244,247,0.94) 100%);
}
html[data-theme="light"] .signin-btn { background: #14141a; color: #fff; }
html[data-theme="light"] .search-input,
html[data-theme="light"] .icon-btn:hover,
html[data-theme="light"] .select-input,
html[data-theme="light"] .option-btn { background: rgba(13, 13, 16, 0.04); }
html[data-theme="light"] .chip-btn {
  background: rgba(13, 13, 16, 0.06);
  border-color: rgba(13, 13, 16, 0.16);
  color: var(--text-secondary);
}
html[data-theme="light"] .chip-btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
html[data-theme="light"] .btn-ghost {
  background: rgba(13, 13, 16, 0.06);
  border-color: rgba(13, 13, 16, 0.22);
  color: var(--text-primary);
  backdrop-filter: blur(6px);
}
html[data-theme="light"] .btn-ghost:hover { background: rgba(13, 13, 16, 0.12); }
html[data-theme="light"] .hero-desc { color: #2c2c34; }
html[data-theme="light"] .filter-chip { background: rgba(13, 13, 16, 0.05); }
html[data-theme="light"] .toggle-switch { background: rgba(13, 13, 16, 0.14); }
html[data-theme="light"] .audio-bubble,
html[data-theme="light"] .audio-player { background: rgba(255, 255, 255, 0.98); }

/* ============================================================
   SOCIAL ICON GRID (Join Us drawer) — icon-only, no labels
   ============================================================ */
.social-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.social-icon-link {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
  color: var(--text-secondary);
}
.social-icon-link:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); }
.social-icon-link .icon { width: 24px; height: 24px; }

/* ============================================================
   SCROLL-TO-TOP BUTTON
   ============================================================ */
.scroll-top-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg-solid);
  border: 1px solid var(--border-color-strong);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0.25s var(--ease);
}
.scroll-top-btn.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top-btn:hover { color: var(--accent); border-color: var(--accent); }
.install-banner {
  position: fixed;
  left: 12px; right: 12px; bottom: 100px;
  z-index: 1500;
  background: var(--card-bg-solid);
  border: 1px solid var(--border-color-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
}
.install-banner.active { display: flex; }
.install-banner-text { flex: 1; font-size: 0.8rem; }
.install-banner-text strong { display: block; font-size: 0.85rem; margin-bottom: 2px; }
