/* ===== DESIGN TOKENS ===== */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --bg-elevated: #1e1e2a;
  --bg-glass: rgba(22, 22, 31, 0.75);
  --bg-glass-strong: rgba(22, 22, 31, 0.92);

  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-tertiary: #6a6a82;
  --text-muted: #50506a;

  --accent-primary: #7c5cfc;
  --accent-secondary: #c084fc;
  --accent-glow: rgba(124, 92, 252, 0.3);
  --accent-gradient: linear-gradient(135deg, #7c5cfc 0%, #c084fc 50%, #f472b6 100%);

  --green: #34d399;
  --green-dim: rgba(52, 211, 153, 0.15);
  --blue: #60a5fa;
  --blue-dim: rgba(96, 165, 250, 0.15);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251, 191, 36, 0.15);
  --orange: #fb923c;
  --orange-dim: rgba(251, 146, 60, 0.15);
  --red: #f87171;
  --red-dim: rgba(248, 113, 113, 0.15);
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.15);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* ===== ANIMATED BACKGROUND ===== */
.bg-gradient {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 92, 252, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(192, 132, 252, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(244, 114, 182, 0.06), transparent);
  animation: bgPulse 12s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== HEADER ===== */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--bg-glass);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-base);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-primary);
  transition: opacity var(--transition-fast);
}
.logo:hover { opacity: 0.8; }

.logo svg { color: var(--accent-primary); }

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.logo-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-country-select {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-country-select label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.header-country-select select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}
.header-country-select select:focus {
  border-color: var(--accent-primary);
}

/* ===== HERO ===== */
.hero {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 40px;
  transition: min-height var(--transition-slow), padding var(--transition-slow);
}

.hero.compact {
  min-height: auto;
  padding: 100px 24px 24px;
}

.hero-content {
  text-align: center;
  max-width: 720px;
  width: 100%;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  transition: font-size var(--transition-slow);
}

.hero.compact .hero-title {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 12px;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-weight: 400;
  transition: all var(--transition-slow);
}

.hero.compact .hero-subtitle {
  font-size: 0;
  margin: 0;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ===== SEARCH BOX ===== */
.search-wrapper {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0 20px;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.search-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.search-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}
.search-box:focus-within .search-icon {
  color: var(--accent-primary);
}

#search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1.05rem;
  padding: 16px 12px;
  width: 100%;
}
#search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  display: none;
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}
.search-clear:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.search-clear.visible { display: block; }

.search-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 4px;
}
.search-spinner.active { display: block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SEARCH DROPDOWN ===== */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 50;
  animation: dropdownIn 200ms ease-out;
}
.search-dropdown.hidden { display: none; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover, .dropdown-item.active {
  background: rgba(124, 92, 252, 0.08);
}

.dropdown-poster {
  width: 42px;
  height: 62px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-card);
  flex-shrink: 0;
}

.dropdown-info {
  flex: 1;
  min-width: 0;
}
.dropdown-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
}
.dropdown-type {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-glow);
  color: var(--accent-secondary);
}

/* ===== RESULTS SECTION ===== */
.results-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
  animation: fadeIn 300ms ease-out;
}
.results-section.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== TRENDING SECTION ===== */
.trending-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.trending-section.hidden { display: none; }

.trending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.trending-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.trending-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
}

.trending-tab {
  padding: 7px 18px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.trending-tab:hover {
  color: var(--text-secondary);
}
.trending-tab.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm);
}

.card-rank {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
  border: 1px solid rgba(255,255,255,0.1);
}

/* ===== RESULTS HEADER ===== */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.results-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.results-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.results-count {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}
.results-country-filter {
  display: flex;
  align-items: center;
  gap: 6px;
}
.results-country-filter label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 500;
}
.results-country-filter select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 0.82rem;
  cursor: pointer;
  outline: none;
}

/* ===== AVAIL CONTROLS ===== */
.avail-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-country-filter select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}
.detail-country-filter select:hover {
  border-color: var(--border-hover);
}
.detail-country-filter select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(124, 92, 252, 0.15);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* ===== RESULT CARD ===== */
.result-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition-base);
  animation: cardIn 400ms ease-out both;
}

.result-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(124, 92, 252, 0.1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-secondary);
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.result-card:hover .card-poster {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.result-card:hover .card-overlay { opacity: 1; }

.card-overlay-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}
.card-type-badge.movie {
  background: rgba(96, 165, 250, 0.25);
  color: var(--blue);
}
.card-type-badge.show {
  background: rgba(52, 211, 153, 0.25);
  color: var(--green);
}

.card-score {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(251, 191, 36, 0.2);
  color: var(--yellow);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 3px;
}
.card-score svg { width: 12px; height: 12px; }

.card-info {
  padding: 12px 14px;
}
.card-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-year {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.card-platforms {
  display: flex;
  gap: 4px;
  padding: 0 14px 12px;
  flex-wrap: wrap;
}
.card-platform-icon {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--border);
  transition: transform var(--transition-fast);
}
.card-platform-icon:hover { transform: scale(1.15); }

.card-platform-more {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

/* ===== CARD LINK & OPEN-IN-NEW-TAB ===== */
.result-card {
  text-decoration: none;
  color: inherit;
  display: block;
}
.result-card:visited { color: inherit; }

.card-new-tab-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transform: scale(0.85);
  transition: all var(--transition-fast);
  text-decoration: none;
}
.result-card:hover .card-new-tab-btn {
  opacity: 1;
  transform: scale(1);
}
.card-new-tab-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* When card has both score and new-tab button, move score left */
.result-card .card-score {
  transition: right var(--transition-fast);
}
.result-card:hover .card-score {
  right: 48px;
}

/* ===== DETAIL SECTION ===== */
.detail-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 90px 24px 60px;
  animation: fadeIn 300ms ease-out;
}
.detail-section.hidden { display: none; }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 24px;
}
.detail-back:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.detail-hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

.detail-poster {
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.detail-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.detail-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.detail-type-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.detail-type-badge.movie {
  background: var(--blue-dim);
  color: var(--blue);
}
.detail-type-badge.show {
  background: var(--green-dim);
  color: var(--green);
}

.detail-sub-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.detail-sub-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.detail-genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.genre-tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.detail-scores {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.score-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.score-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--yellow);
}

.detail-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 600px;
}

/* ===== AVAILABILITY SECTION ===== */
.availability-section {
  margin-top: 40px;
}

.avail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.avail-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ===== FILTER TOGGLES ===== */
.filter-toggles {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
}

.filter-toggle:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  color: var(--text-secondary);
}

.filter-toggle.active {
  border-color: rgba(255,255,255,0.15);
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.filter-toggle.active[data-filter="FLATRATE"] {
  border-color: rgba(52, 211, 153, 0.3);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.1);
}
.filter-toggle.active[data-filter="FREE"] {
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.1);
}
.filter-toggle.active[data-filter="BUY"] {
  border-color: rgba(251, 146, 60, 0.3);
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.1);
}

.toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all var(--transition-base);
  opacity: 0.4;
}

.filter-toggle.active .toggle-dot {
  opacity: 1;
  box-shadow: 0 0 6px currentColor;
}

.toggle-dot.flatrate { background: var(--green); }
.toggle-dot.free { background: var(--cyan); }
.toggle-dot.buy { background: var(--orange); }

.avail-country-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avail-country-picker label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  font-weight: 500;
}
.avail-country-picker select {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

.check-all-btn {
  background: var(--accent-gradient);
  border: none;
  color: white;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.check-all-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.avail-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-tertiary);
}
.avail-loading .spinner-lg {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

/* Single country offers */
.offers-group {
  margin-bottom: 28px;
  animation: fadeIn 300ms ease-out;
}
.offers-group-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.offers-group-title .monetization-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.monetization-dot.flatrate { background: var(--green); }
.monetization-dot.free { background: var(--cyan); }
.monetization-dot.rent { background: var(--yellow); }
.monetization-dot.buy { background: var(--orange); }
.monetization-dot.ads { background: var(--blue); }

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.offer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
}
.offer-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.offer-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.offer-info {
  flex: 1;
  min-width: 0;
}
.offer-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.offer-details {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  display: flex;
  gap: 8px;
  align-items: center;
}
.offer-price {
  font-weight: 600;
  color: var(--green);
}
.offer-quality {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.offer-link-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color var(--transition-fast);
}
.offer-card:hover .offer-link-icon { color: var(--accent-primary); }

.no-offers {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* ===== MULTI-COUNTRY RESULTS ===== */
.multi-country-results {
  margin-top: 24px;
}

.country-offers-block {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeIn 300ms ease-out;
}

.country-offers-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
}
.country-offers-header:hover { background: var(--bg-card-hover); }

.country-flag {
  font-size: 1.3rem;
}
.country-name {
  font-weight: 600;
  font-size: 0.95rem;
  flex: 1;
}
.country-offer-count {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  background: var(--bg-card);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
.country-toggle {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}
.country-toggle.open { transform: rotate(180deg); }

.country-offers-body {
  padding: 16px 18px;
  display: none;
  background: var(--bg-card);
}
.country-offers-body.open { display: block; }

/* ===== SUMMARY STATS ===== */
.avail-summary {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 100px;
  transition: all var(--transition-fast);
}
.summary-stat:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.summary-number {
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.summary-number.green {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
}
.summary-number.dim {
  background: none;
  -webkit-text-fill-color: var(--text-muted);
  color: var(--text-muted);
}
.summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ===== TYPE CHIPS ===== */
.country-chips {
  display: flex;
  gap: 5px;
  flex: 1;
  flex-wrap: wrap;
}
.type-chip {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chip-sub { background: var(--green-dim); color: var(--green); }
.chip-free { background: var(--cyan-dim); color: var(--cyan); }
.chip-ads { background: var(--blue-dim); color: var(--blue); }
.chip-rent { background: var(--yellow-dim); color: var(--yellow); }
.chip-buy { background: var(--orange-dim); color: var(--orange); }

/* ===== UNAVAILABLE COUNTRIES ===== */
.unavailable-section {
  margin-top: 28px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.unavailable-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.unavailable-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.unavailable-country {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 4px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

/* ===== PLATFORM-GROUPED VIEW ===== */
.platform-block {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  animation: fadeIn 300ms ease-out both;
}

.platform-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
}
.platform-header:hover {
  background: var(--bg-card-hover);
}

.platform-header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-card);
}

.platform-header-name {
  font-weight: 700;
  font-size: 1.1rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-country-count {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  background: var(--bg-card);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 500;
  white-space: nowrap;
}

.platform-body {
  display: none;
  background: var(--bg-card);
}
.platform-body.open {
  display: block;
}

/* Country row inside a platform block */
.platform-country-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition-fast);
}
.platform-country-row:first-child {
  border-top: none;
}
.platform-country-row:hover {
  background: rgba(124, 92, 252, 0.05);
}

.pcr-flag {
  flex-shrink: 0;
  width: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.country-flag-img {
  display: inline-block;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
  vertical-align: middle;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.pcr-name {
  font-weight: 500;
  font-size: 0.9rem;
  min-width: 120px;
  flex-shrink: 0;
}

.pcr-qualities {
  display: flex;
  gap: 4px;
}

.pcr-price {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--green);
  min-width: 60px;
}

.pcr-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 90px;
  flex: 1;
}

.pcr-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  min-width: 40px;
  text-align: center;
}
.pcr-type-flatrate { background: var(--green-dim); color: var(--green); }
.pcr-type-free, .pcr-type-ads { background: var(--cyan-dim); color: var(--cyan); }
.pcr-type-rent { background: var(--yellow-dim); color: var(--yellow); }
.pcr-type-buy { background: var(--orange-dim); color: var(--orange); }

.pcr-stream {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
  transition: color var(--transition-fast);
}
.platform-country-row:hover .pcr-stream {
  color: var(--accent-primary);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 32px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== UTILITY ===== */
.hidden { display: none !important; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 100px 16px 24px; }
  .hero.compact { padding: 84px 16px 16px; }

  .detail-hero {
    grid-template-columns: 140px 1fr;
    gap: 18px;
  }
  .detail-title { font-size: 1.4rem; }

  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
  }

  .offers-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .detail-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .detail-poster { max-width: 200px; margin: 0 auto; }
  .detail-meta { align-items: center; }
  .detail-title-row { justify-content: center; }
  .detail-sub-meta { justify-content: center; }
  .detail-genres { justify-content: center; }
  .detail-scores { justify-content: center; }
  .detail-description { text-align: center; }
}
