/* ============================================================
   BurakBox — Modern Cinema Pro Suite Design System
   Letterboxd Dark Theme, Clean Typography & Animate UI Motion
   ============================================================ */

:root {
  /* Core Colors */
  --bg-primary: #14181c;
  --bg-surface: #1b2228;
  --bg-surface-elevated: #242c34;
  --bg-card: rgba(27, 34, 40, 0.78);
  --bg-card-hover: rgba(36, 44, 52, 0.92);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 224, 84, 0.45);

  /* Accents */
  --accent-green: #00e054;
  --accent-green-glow: rgba(0, 224, 84, 0.25);
  --accent-cyan: #40bcf4;
  --accent-cyan-glow: rgba(64, 188, 244, 0.25);
  --accent-orange: #ff8000;
  --accent-orange-glow: rgba(255, 128, 0, 0.25);
  --accent-purple: #a855f7;
  --accent-purple-glow: rgba(168, 85, 247, 0.25);

  /* Typography */
  --text-main: #ffffff;
  --text-muted: #9ab0c2;
  --text-dim: #677b8c;
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Geometry & Shadows */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --spring-transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset & Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Animate UI: Scroll Progress & Background Effects
   ============================================================ */

/* Top Scroll Progress Indicator */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan), var(--accent-purple));
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0, 224, 84, 0.6);
  transition: width 0.08s ease-out;
  pointer-events: none;
}

/* Ambient Canvas for Particle Dust */
.ambient-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

/* Fullscreen Confetti Canvas */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Background Ambient Glows */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.16;
  animation: pulseGlow 8s ease-in-out infinite alternate;
}
.bg-glow-1 {
  width: 550px;
  height: 550px;
  background: var(--accent-green);
  top: -120px;
  right: -120px;
}
.bg-glow-2 {
  width: 650px;
  height: 650px;
  background: var(--accent-cyan);
  bottom: 5%;
  left: -220px;
  animation-delay: -4s;
}
@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.12; }
  50% { transform: scale(1.12) translate(20px, 30px); opacity: 0.20; }
  100% { transform: scale(0.95) translate(-15px, 15px); opacity: 0.14; }
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  position: relative;
  z-index: 1;
}

.hidden {
  display: none !important;
}

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 24, 28, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
  transition: border-color 0.3s ease;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}
.brand-icon-box {
  width: 38px;
  height: 38px;
  background: rgba(0, 224, 84, 0.12);
  border: 1px solid rgba(0, 224, 84, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-green);
  transition: var(--spring-transition), color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.brand:hover .brand-icon-box {
  transform: scale(1.08);
}
/* One glyph per medium; each carries its own colour so the areas can be themed later */
.brand-glyph {
  display: none;
}
.brand-glyph.is-active {
  display: block;
  animation: glyphIn 0.25s ease-out;
}
.brand-icon-box[data-kind="series"] { color: #40bcf4; border-color: rgba(64, 188, 244, 0.35); background: rgba(64, 188, 244, 0.12); }
.brand-icon-box[data-kind="book"] { color: #ff9f43; border-color: rgba(255, 159, 67, 0.35); background: rgba(255, 159, 67, 0.12); }
.brand-icon-box[data-kind="anime"] { color: #ff6fb1; border-color: rgba(255, 111, 177, 0.35); background: rgba(255, 111, 177, 0.12); }
@keyframes glyphIn {
  from { opacity: 0; transform: scale(0.7) rotate(-15deg); }
  to { opacity: 1; transform: none; }
}
.loading-sub {
  transition: opacity 0.2s ease;
}
.loading-sub.is-swapping {
  opacity: 0;
}
.brand-name {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ============================================================
   Animate UI: Buttons & Magnetic Physics
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  outline: none;
  text-decoration: none;
  will-change: transform;
  position: relative;
  overflow: hidden;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease-out;
}
.btn-magnetic {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}
.btn-primary {
  background: var(--accent-green);
  color: #0b1a10;
  box-shadow: 0 4px 16px var(--accent-green-glow);
}
.btn-primary:hover {
  background: #00f05a;
  box-shadow: 0 6px 24px rgba(0, 224, 84, 0.45);
}
.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Button Shine Sweep Effect */
.btn-shine::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 220%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 35%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 65%
  );
  transform: translateX(-100%) rotate(25deg);
  transition: transform 0.75s ease;
  pointer-events: none;
}
.btn-shine:hover::after {
  transform: translateX(100%) rotate(25deg);
}

/* ============================================================
   Animate UI: Spotlight Hover Cards & 3D Tilt
   ============================================================ */
.spotlight-card {
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    400px circle at var(--mouse-x, -500px) var(--mouse-y, -500px),
    rgba(0, 224, 84, 0.09),
    transparent 80%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 1;
}
.spotlight-card:hover::before {
  opacity: 1;
}

/* 3D Perspective Tilt Card */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.15s ease-out, box-shadow 0.25s ease;
}

/* ============================================================
   Hero Section & Text Animations
   ============================================================ */
.hero-section {
  text-align: center;
  padding: 60px 0 40px;
  max-width: 840px;
  margin: 0 auto;
}
.hero-section.is-compact {
  padding: 8px 0 24px;
}
.hero-section.is-compact .hero-title,
.hero-section.is-compact .hero-subtitle {
  display: none;
}
.hero-accent {
  color: var(--accent-green);
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(30px, 4.6vw, 44px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 18px;
}

/* Animate UI: Word Pull-Up Entrance */
.word-pull-up span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: wordPullUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.word-pull-up span:nth-child(1) { animation-delay: 0.05s; }
.word-pull-up span:nth-child(2) { animation-delay: 0.15s; }
.word-pull-up span:nth-child(3) { animation-delay: 0.25s; }
.word-pull-up span:nth-child(4) { animation-delay: 0.35s; }

@keyframes wordPullUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Text Shimmer Sweep */
.text-shimmer {
  background: linear-gradient(
    90deg,
    #ffffff 0%,
    var(--accent-green) 25%,
    var(--accent-cyan) 50%,
    var(--accent-green) 75%,
    #ffffff 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 5s linear infinite;
}
@keyframes textShimmer {
  to {
    background-position: 200% center;
  }
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 17px);
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
  animation: wordPullUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  opacity: 0;
}

/* ============================================================
   Animate UI: Border Beam (Lazer Çerçeve) Search Card
   ============================================================ */
.border-beam-container {
  position: relative;
  overflow: hidden;
}
.border-beam {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(
    from var(--beam-angle, 0deg),
    transparent 60%,
    rgba(0, 224, 84, 0.8) 85%,
    rgba(64, 188, 244, 1) 100%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: beamRotate 6s linear infinite;
  z-index: 2;
}
@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes beamRotate {
  to {
    --beam-angle: 360deg;
  }
}

.search-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 5;
}
.search-form {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 3;
}
.input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: color 0.25s ease, transform 0.25s ease;
}
.input-wrapper:focus-within .input-icon {
  color: var(--accent-green);
  transform: scale(1.1);
}
.input-wrapper input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 16px 14px 46px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(0, 224, 84, 0.15);
}
.btn-arrow-svg {
  transition: transform 0.2s ease;
}
.btn-primary:hover .btn-arrow-svg {
  transform: translateX(4px);
}
.quick-demo-wrapper {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 10px;
  font-size: 13px;
  color: var(--text-dim);
  position: relative;
  z-index: 3;
}
.quick-demo-sep {
  color: var(--text-dim);
}
/* "veya" stays with the upload button when the row wraps */
.quick-demo-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.local-bar {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 3;
}
.local-bar-text {
  font-size: 13px;
  color: var(--text-muted);
}
.local-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.demo-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.demo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}
.demo-chip:hover {
  background: rgba(0, 224, 84, 0.1);
  border-color: var(--border-active);
  color: var(--accent-green);
}

/* ============================================================
   Loading Section & Skeleton Shimmer
   ============================================================ */
.loading-section {
  padding: 60px 20px;
  text-align: center;
}
.loader-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  max-width: 500px;
  margin: 0 auto;
  backdrop-filter: blur(20px);
}
.cinema-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(0, 224, 84, 0.15);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.9s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-title {
  font-family: var(--font-heading);
  font-size: 18px;
  margin-bottom: 8px;
}
.loading-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* Skeleton Loading Grid */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.skeleton-card {
  height: 60px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  position: relative;
  overflow: hidden;
}
.shimmer-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
@keyframes skeletonShimmer {
  to { transform: translateX(100%); }
}

/* ============================================================
   Animate UI: Stagger Motion Grid & KPI Cards
   ============================================================ */
.stagger-item {
  opacity: 0;
  transform: translateY(24px);
  animation: staggerFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--stagger-idx, 0) * 80ms);
}
@keyframes staggerFadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 2;
}
.kpi-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}
.kpi-icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  transition: var(--spring-transition);
}
.kpi-card:first-child .kpi-icon-box {
  /* The headline number gets the accent; the rest stay neutral */
  background: rgba(0, 224, 84, 0.12);
  color: var(--accent-green);
}
.kpi-card:hover .kpi-icon-box {
  transform: scale(1.15) rotate(8deg);
}

.kpi-data {
  flex: 1;
  position: relative;
  z-index: 3;
}
.kpi-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.kpi-value {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  font-size: 12px;
  color: var(--text-dim);
}
.kpi-mini-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  margin-top: 8px;
  overflow: hidden;
  position: relative;
}
.kpi-mini-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: var(--radius-pill);
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   Dashboard Sections
   ============================================================ */
.dashboard-section {
  margin-bottom: 48px;
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.section-sub {
  font-size: 13px;
  color: var(--text-dim);
}

/* ============================================================
   Smart Recommendations Grid
   ============================================================ */
.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.rec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}
.rec-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.rec-top {
  margin-bottom: 12px;
  position: relative;
  z-index: 3;
}
.rec-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.rec-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  transition: color 0.2s ease;
}
.rec-card:hover .rec-title {
  color: var(--accent-green);
}
.rec-year {
  color: var(--text-dim);
  font-size: 13px;
  flex-shrink: 0;
}
.rec-director {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.rec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rec-tag {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.rec-link {
  color: var(--accent-green);
  text-decoration: none;
  font-weight: 600;
}
.rec-link:hover {
  text-decoration: underline;
}
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.rec-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 12px;
  color: var(--text-dim);
  position: relative;
  z-index: 3;
}

/* ============================================================
   List Cards Grid & Liquid Progress Bars
   ============================================================ */
.list-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.list-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 16px var(--accent-green-glow);
}
.list-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  position: relative;
  z-index: 3;
}
.list-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  transition: color 0.2s ease;
}
.list-card:hover .list-card-title {
  color: var(--accent-green);
}
.list-card-pct {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}
.list-card.is-strong .list-card-pct {
  color: var(--accent-green);
}
.list-card.is-low .list-card-pct {
  color: var(--text-muted);
}
.list-card.is-low .list-progress-fill {
  background: rgba(0, 224, 84, 0.55);
}
.list-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  position: relative;
  z-index: 3;
}
.list-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
  z-index: 3;
}
.list-progress-fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: var(--radius-pill);
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.list-progress-fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  border-radius: var(--radius-pill);
}

/* ============================================================
   Charts Grid
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 2;
}
.chart-header {
  margin-bottom: 16px;
  position: relative;
  z-index: 3;
}
.chart-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}
.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
  z-index: 3;
}
/* 20 directors need two rows of height; genres and ratings stack beside it */
.chart-card-tall {
  grid-row: span 2;
  display: flex;
  flex-direction: column;
}
.chart-card-tall .chart-container {
  flex: 1;
  min-height: 520px;
}
.chart-card-wide {
  grid-column: 1 / -1;
}

/* ============================================================
   Animate UI: Sliding Tabs & Filter Toolbar
   ============================================================ */
.filter-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 16px;
  position: relative;
  z-index: 5;
}
.filter-search {
  position: relative;
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  z-index: 3;
}
.filter-search input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: var(--transition);
}
.filter-search input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(0, 224, 84, 0.15);
}
.filter-search .search-icon {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
  color: var(--text-dim);
}

/* Animate UI Spring Sliding Tabs */
.filter-tabs-wrapper {
  position: relative;
  z-index: 3;
}
.filter-tabs {
  position: relative;
  display: flex;
  background: var(--bg-primary);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.tabs-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: 60px;
  background: var(--bg-surface-elevated);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), width 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tab-btn {
  position: relative;
  z-index: 2;
  background: transparent !important;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.25s ease;
}
.tab-btn.active {
  color: var(--text-main);
}
.tab-btn:hover:not(.active) {
  color: #ffffff;
}

.filter-dropdown select {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  z-index: 3;
}
.filter-dropdown select:focus {
  outline: none;
  border-color: var(--accent-green);
}

/* ============================================================
   Film Table & Row Micro-Animations
   ============================================================ */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 2;
}
.table-responsive {
  overflow-x: auto;
  position: relative;
  z-index: 3;
}
.film-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.film-table th {
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 0 16px;
  height: 44px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.sort-btn {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}
.sort-btn::after {
  content: "↕";
  opacity: 0.35;
  font-size: 11px;
}
.sort-btn:hover,
th[aria-sort="ascending"] .sort-btn,
th[aria-sort="descending"] .sort-btn {
  color: var(--text-main);
}
th[aria-sort="ascending"] .sort-btn::after { content: "↑"; opacity: 1; color: var(--accent-green); }
th[aria-sort="descending"] .sort-btn::after { content: "↓"; opacity: 1; color: var(--accent-green); }
.sort-btn:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 4px;
  border-radius: 2px;
}
.film-table .col-idx { width: 48px; color: var(--text-dim); }
.film-table .col-year { width: 72px; }
.film-table .col-list { width: 190px; }
.film-table .col-status { width: 110px; }
.film-table .col-rating { width: 90px; text-align: right; }
.cell-director,
.film-table .col-year { color: var(--text-muted); font-size: 13px; }
.cell-genre { color: var(--text-dim); font-size: 12px; }
.cell-empty { color: var(--text-dim); }
.row-empty td {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.table-count {
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.list-tag {
  display: inline-block;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.status-watched {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-green);
  font-size: 13px;
  font-weight: 600;
}
.status-unwatched {
  color: var(--text-dim);
  font-size: 13px;
}
.film-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 14px;
  vertical-align: middle;
  transition: background 0.2s ease;
}
.film-table tr {
  transition: background 0.2s ease;
}
.film-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.film-table tr.row-watched td {
  background: rgba(0, 224, 84, 0.03);
}
.film-table tr.row-watched:hover td {
  background: rgba(0, 224, 84, 0.08);
}
.film-title-text {
  font-weight: 600;
  color: var(--text-main);
  transition: color 0.2s ease;
}
.film-table tr:hover .film-title-text {
  color: var(--accent-green);
}
.user-rating-val {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 13px;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
  position: relative;
  z-index: 3;
}
.btn-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.btn-page:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.page-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 30px 0;
  margin-top: 60px;
  color: var(--text-dim);
  font-size: 13px;
  position: relative;
  z-index: 2;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* ============================================================
   Toast Notification
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-green);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-green-glow);
  z-index: 10000;
  font-size: 14px;
  animation: slideToast 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideToast {
  from { transform: translateX(100%) scale(0.9); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

/* ============================================================
   Responsive Breakpoints
   ============================================================ */
.filter-sort-mobile {
  display: none;
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .chart-card-tall {
    grid-row: auto;
  }
}

@media (max-width: 768px) {
  .search-form {
    flex-direction: column;
  }
  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .filter-dropdown select {
    width: 100%;
  }
  .filter-sort-mobile {
    display: block;
  }
  .recommendations-grid {
    grid-template-columns: 1fr;
  }
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .hero-section {
    padding: 32px 0 24px;
  }
  .kpi-grid {
    gap: 10px;
  }
  .kpi-card {
    padding: 14px;
  }
  .kpi-icon-box {
    display: none;
  }
  .kpi-value {
    font-size: 24px;
  }
  .list-cards-grid {
    grid-template-columns: 1fr;
  }

  /* Table rows become compact cards: title on top, details below */
  .film-table thead {
    display: none;
  }
  .film-table,
  .film-table tbody {
    display: block;
  }
  .film-table tr {
    display: grid;
    /* year | director (rest) | rating/status */
    grid-template-columns: auto 1fr auto;
    gap: 2px 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }
  .film-table td {
    display: block;
    padding: 0;
    border: 0;
    width: auto !important;
    background: none !important;
  }
  .film-table .col-idx { display: none; }
  /* Dashes keep desktop columns aligned; on a card they are just noise */
  .film-table td.is-empty { display: none; }
  .film-table .cell-title { grid-column: 1 / 3; grid-row: 1; }
  .film-table .col-rating { grid-column: 3; grid-row: 1; }
  .film-table .col-year { grid-column: 1; grid-row: 2; }
  .film-table .cell-director { grid-column: 2 / 4; grid-row: 2; }
  .film-table .cell-director::before { content: "· "; color: var(--text-dim); }
  .film-table .cell-genre { grid-column: 1 / 4; grid-row: 3; }
  .film-table .col-list { grid-column: 1 / 3; grid-row: 4; margin-top: 6px; }
  .film-table .col-status { grid-column: 3; grid-row: 4; margin-top: 6px; text-align: right; }
  .row-empty td {
    grid-column: 1 / -1;
  }
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-glyph.is-active {
    animation: none;
  }
}

/* Chart scope switch (all films / on the lists) and the language toggle */
.scope-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.scope-btn {
  all: unset;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.scope-btn:hover {
  color: var(--text-main);
}
.scope-btn.is-active {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}
.scope-btn:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}
.lang-toggle {
  min-width: 44px;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* Custom select (list filter, mobile sort): the native select stays hidden as the source of truth */
.filter-toolbar {
  /* the option popup must be able to extend past the toolbar */
  overflow: visible;
}
.filter-toolbar::before {
  border-radius: inherit;
}
.filter-dropdown.is-enhanced {
  position: relative;
}
.filter-dropdown.is-enhanced select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.cselect-button {
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 220px;
  width: 100%;
  padding: 8px 12px 8px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.cselect-button:hover,
.filter-dropdown.is-open .cselect-button {
  border-color: rgba(255, 255, 255, 0.22);
}
.cselect-button:focus-visible {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(0, 224, 84, 0.15);
}
.cselect-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cselect-chevron {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}
.filter-dropdown.is-open .cselect-chevron {
  transform: rotate(180deg);
}
.cselect-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 100%;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  max-height: 340px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  outline: none;
  animation: cselectIn 0.14s ease-out;
}
@keyframes cselectIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.cselect-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px 8px 30px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}
.cselect-option.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}
.cselect-option[aria-selected="true"] {
  color: var(--accent-green);
  font-weight: 600;
}
.cselect-option[aria-selected="true"]::before {
  content: "✓";
  position: absolute;
  left: 10px;
}
.cselect-option-meta {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
@media (max-width: 768px) {
  .cselect-button {
    min-width: 0;
  }
  .cselect-list {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cselect-list {
    animation: none;
  }
}
