/* ══════════════════════════════════════════════════════════════════
   Cinéastre — Design System
   Sobre, monochrome, "liquid glass" (verre dépoli translucide façon
   Apple). Un seul jeu de règles pour toutes les pages, du site public
   au panel admin — voir README.md #design-system.
   ══════════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --surface:      #0a0a0a;
  --elevated:     #111111;
  --base:         #000000;

  /* Text */
  --text:         #f2f2f0;
  --text-dim:     #a3a29c;
  --text-faint:   #6b6a65;

  /* Glass */
  --glass-bg:          rgba(255, 255, 255, 0.055);
  --glass-bg-hover:    rgba(255, 255, 255, 0.10);
  --glass-border:      rgba(255, 255, 255, 0.10);
  --glass-border-hover:rgba(255, 255, 255, 0.20);
  --glass-highlight:   rgba(255, 255, 255, 0.09);
  --glass-blur:        20px;

  /* Radius scale */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  color-scheme: dark;
}

html, body {
  background-color: var(--base);
  color: var(--text);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

::-webkit-scrollbar { width: 0; background: transparent; }
* { scrollbar-width: none; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }

/* Posters, backdrops, TMDB title logos: no browser drag-ghost, no accidental text selection. */
img { -webkit-user-drag: none; user-drag: none; -webkit-touch-callout: none; user-select: none; }

/* ── Liquid glass surfaces ─────────────────────────────────────────
   Real translucency + blur, a soft inner highlight along the top edge
   (the "light catching the glass" cue), and a hairline border. Every
   page — home, watch, admin — pulls from these three classes only. */

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}
/* Zero-specificity default radius: any explicit Tailwind rounded-* class on
   the same element (rounded-full pills, circular badges, !rounded-none
   sidebars) wins over this without fighting cascade order. */
:where(.glass-panel) { border-radius: var(--r-lg); }

.glass-button {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  color: var(--text);
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.glass-button:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}
.glass-button:active { transform: scale(0.97); }

.glass-input {
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.glass-input::placeholder { color: var(--text-faint); }
.glass-input:focus {
  border-color: var(--glass-border-hover);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.glass-card-overlay {
  background: linear-gradient(to top, #000 0%, rgba(0,0,0,0.45) 50%, transparent 100%);
}

/* ── Buttons ───────────────────────────────────────────────────────
   One shared shape language: pill radius, three sizes, three
   intents. Used identically on the homepage and inside the admin. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 9999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
  line-height: 1;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-sm { padding: 0.55rem 1.1rem; font-size: 0.75rem; gap: 0.375rem; }
.btn-md { padding: 0.75rem 1.5rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.95rem 2rem; font-size: 0.9375rem; }

.btn-icon { padding: 0.625rem; border-radius: 9999px; }
.btn-icon.btn-sm { padding: 0.45rem; }

.btn-primary { background: #fff; color: #000; }
.btn-primary:hover { background: rgba(255,255,255,0.88); }

.btn-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  color: var(--text);
  border-color: var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.btn-glass:hover { background: var(--glass-bg-hover); border-color: var(--glass-border-hover); }

.btn-active {
  background: rgba(255,255,255,0.14);
  color: var(--text);
  border-color: var(--glass-border-hover);
}

.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.btn-danger-ghost { background: transparent; color: var(--text-faint); }
.btn-danger-ghost:hover { color: var(--text-dim); background: rgba(255,255,255,0.05); }

/* ── Pills / badges ────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
}
.pill-neutral { background: rgba(255,255,255,0.08); color: var(--text-dim); }
.pill-on      { background: rgba(255,255,255,0.14); color: var(--text); }

/* ── Solid dropdown panels (profile menu, source picker) ─────────────
   Genuinely opaque — NOT a translucent glass surface. A dropdown sitting
   over a bright/colorful hero image needs a fully solid backing or it reads
   as "still see-through" no matter how high the alpha value; backdrop-blur
   alone doesn't fix that once alpha < 1. Plain solid color, zero ambiguity. */
.solid-dropdown {
  background: #0c0c0c;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.7);
}

/* ── Navbar liquid bubble ──────────────────────────────────────────
   Slides behind the active/hovered nav link (JS sets left/top/width/height). */
.nav-bubble {
  position: absolute;
  border-radius: 9999px;
  background: var(--glass-bg-hover);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--glass-border-hover);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  opacity: 0;
  pointer-events: none;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              top 0.25s ease, height 0.25s ease, opacity 0.2s ease;
}

/* ── Text ──────────────────────────────────────────────────────── */
.text-balance { text-wrap: balance; }
.eyebrow { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }

/* ── Layout ────────────────────────────────────────────────────── */
.loader-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: var(--base);
}

.cyber-grid {
  background-size: 60px 60px;
  background-image: linear-gradient(to right, rgba(255,255,255,0.02) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255,255,255,0.02) 1px, transparent 1px);
  mask-image: radial-gradient(circle at center, black, transparent 70%);
}

.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── Scrollbar (scroll containers) ─────────────── */
.custom-scroll::-webkit-scrollbar { width: 3px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.30); }

/* ── Misc app-wide helpers (no build step, so no @apply available) ─── */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.animate-fade-in { animation: fadeIn 0.3s ease-out; }

/* ── Home hero carousel ────────────────────────────────────────────
   Slow "Ken Burns" drift on the active backdrop + a fade/rise for the
   title block on every slide change — the crossfade opacity itself is
   set inline (duration needs to match the JS autoplay interval). */
@keyframes heroKenBurns { from { transform: scale(1.0); } to { transform: scale(1.08); } }
.hero-kenburns { transition: transform 1.2s ease-out; }
.hero-kenburns-active { animation: heroKenBurns 8s ease-out forwards; }

@keyframes heroTextIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.hero-text-in { animation: heroTextIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
