/* ==========================================
   CineStream — Premium Dark Movie Site Theme
   ========================================== */

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

:root {
  --bg-primary: #0a0a14;
  --bg-secondary: #12121e;
  --bg-card: #16162a;
  --bg-card-hover: #1e1e38;
  --bg-surface: #1a1a30;
  --bg-overlay: rgba(10, 10, 20, 0.85);
  --accent: #e50914;
  --accent-hover: #ff1a26;
  --accent-dark: #b20710;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b8;
  --text-muted: #5a5a78;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --container: 1320px;
  --nav-height: 64px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

input {
  font-family: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* Content protection */
.no-select {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.protected-content {
  pointer-events: none;
}

/* ==========================================
   Preloader
   ========================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.5s,
    visibility 0.5s;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  text-align: center;
}

.spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.preloader-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, var(--accent), #ff6b6b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================
   Navbar
   ========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: transparent;
  transition:
    background var(--transition),
    box-shadow var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
  gap: 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo:hover span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  transition: all var(--transition);
}

.search-box:focus-within {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.search-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  padding: 8px 4px 8px 16px;
  width: 200px;
  font-size: 0.875rem;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  padding: 8px 12px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.search-btn:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile nav */
.mobile-nav {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(10, 10, 20, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 999;
  padding: 8px 16px;
  display: none;
  flex-direction: column;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.4s ease,
    padding 0.4s ease;
}

.mobile-nav.open {
  max-height: 400px;
  padding: 12px 16px;
  display: flex;
}

.mobile-link {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.mobile-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* ==========================================
   Hero / Slider
   ========================================== */
.hero {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  margin-top: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: -1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    var(--bg-primary) 0%,
    rgba(10, 10, 20, 0.6) 40%,
    rgba(10, 10, 20, 0.3) 100%
  );
}

.hero-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-primary) 0%, transparent 50%);
}

.hero-content {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  padding: 0 40px;
  max-width: var(--container);
  margin: 0 auto;
  z-index: 5;
}

.hero-quality {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 12px;
  max-width: 600px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero-actions {
  display: flex;
  gap: 12px;
}

/* Hero dots */
.hero-dots {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all var(--transition);
}

.hero-dot.active {
  background: var(--accent);
  width: 28px;
  border-radius: 5px;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.3);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(229, 9, 20, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-icon {
  padding: 10px;
  border-radius: 50%;
}

/* ==========================================
   Section Headers
   ========================================== */
.section {
  padding: 32px 0;
}

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

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 24px;
  background: var(--accent);
  border-radius: 2px;
}

.section-link {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition);
}

.section-link:hover {
  gap: 8px;
}

/* ==========================================
   Content Cards
   ========================================== */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

.content-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.card {
  position: relative;
  background: transparent;
  transition: all var(--transition);
  cursor: pointer;
}

.card:hover {
  transform: translateY(-6px);
}

.card:hover .card-overlay {
  opacity: 1;
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-img.loading {
  background: linear-gradient(
    110deg,
    var(--bg-secondary) 30%,
    var(--bg-surface) 50%,
    var(--bg-secondary) 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.card-play {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: transform var(--transition);
}

.card:hover .card-play {
  transform: scale(1);
}

.card-play svg {
  margin-left: 3px;
}

.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-quality {
  background: var(--accent);
  color: #fff;
}

.badge-type {
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  backdrop-filter: blur(4px);
}

.card-info {
  padding: 10px 12px;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

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

/* ==========================================
   Detail Page
   ========================================== */
.detail-hero {
  position: relative;
  min-height: 500px;
  padding-top: var(--nav-height);
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  opacity: 0.3;
}

.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, var(--bg-primary));
}

.detail-content {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  padding: 40px 0;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.detail-poster {
  flex-shrink: 0;
  width: 260px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}

.detail-info {
  flex: 1;
  padding-top: 10px;
}

.detail-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  line-height: 1.2;
}

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

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
}

.detail-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 650px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-tag {
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.detail-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.detail-row {
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.detail-label {
  color: var(--text-muted);
  margin-right: 8px;
}

.detail-value {
  color: var(--text-secondary);
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ==========================================
   Watch / Player Page
   ========================================== */
.watch-section {
  padding-top: var(--nav-height);
}

.player-container {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}

.player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.player-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  color: var(--text-muted);
}

.player-placeholder svg {
  margin-bottom: 12px;
  opacity: 0.3;
}

.server-panel {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--border);
  border-top: none;
}

.server-panel h4 {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.server-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.server-btn {
  padding: 8px 20px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.server-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.server-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.server-btn.blocked {
  opacity: 0.4;
  pointer-events: none;
}

.watch-info {
  max-width: 1100px;
  margin: 20px auto;
  padding: 0 20px;
}

.watch-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.watch-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Season/Episode selectors */
.season-select {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.season-select option {
  background: var(--bg-secondary);
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.episode-btn {
  padding: 10px;
  text-align: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition);
}

.episode-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.episode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ==========================================
   Search Results
   ========================================== */
.page-header {
  padding: calc(var(--nav-height) + 30px) 0 20px;
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
}

.page-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==========================================
   Pagination
   ========================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 0;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ==========================================
   Genre Tags / Filter Bar
   ========================================== */
.genre-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0;
}

.genre-chip {
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.genre-chip:hover,
.genre-chip.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(229, 9, 20, 0.08);
}

/* ==========================================
   Loading States
   ========================================== */
.skeleton {
  background: linear-gradient(
    110deg,
    var(--bg-secondary) 30%,
    var(--bg-surface) 50%,
    var(--bg-secondary) 70%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

.skeleton-card {
  aspect-ratio: 2/3;
  border-radius: var(--radius-lg);
}

.skeleton-text {
  height: 16px;
  width: 80%;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 50%;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
}

.loading-spinner .spinner {
  width: 36px;
  height: 36px;
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  animation: slideIn 0.3s ease;
}

.toast.error {
  border-color: var(--accent);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================
   Empty State
   ========================================== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.empty-state p {
  max-width: 400px;
  margin: 0 auto;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.footer-col a {
  display: block;
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-disclaimer {
  margin-top: 6px;
  font-size: 0.75rem;
}

/* ==========================================
   Recommendations Section
   ========================================== */
.recommend-section {
  margin-top: 40px;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 1024px) {
  .hero {
    height: 420px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .detail-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .detail-poster {
    width: 200px;
  }

  .detail-info {
    padding-top: 0;
  }

  .detail-tags {
    justify-content: center;
  }

  .detail-actions {
    justify-content: center;
  }

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .search-input {
    width: 140px;
  }

  .hero {
    height: 360px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .hero-desc {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .hero-content {
    padding: 0 20px;
    bottom: 60px;
  }

  .content-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px 12px;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .detail-poster {
    width: 160px;
  }

  .detail-title {
    font-size: 1.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .player-container {
    border-radius: 0;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .search-box {
    display: none;
  }

  .content-grid,
  .content-grid.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 10px;
  }

  .card-info {
    padding: 6px 4px;
  }

  .card-title {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  /* FLIXHQ Style Mobile Hero */
  .hero {
    height: 350px !important;
    min-height: auto !important;
    margin-bottom: 20px;
    padding-bottom: 0;
  }

  .hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    /* always block, we use opacity */
    opacity: 0;
    transition: opacity 0.5s ease;
  }

  .hero-slide.active {
    opacity: 1;
    z-index: 2;
  }

  .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: -1;
  }

  .hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    background: linear-gradient(
      0deg,
      var(--bg-primary) 0%,
      rgba(10, 10, 20, 0.4) 50%,
      rgba(10, 10, 20, 0.1) 100%
    );
  }

  .hero-content {
    position: absolute;
    bottom: 20px;
    left: 10%;
    right: 10%;
    text-align: center;
    padding: 0;
    margin-top: 0;
    z-index: 5;
  }

  .hero-quality {
    display: none;
  }

  .hero-title {
    font-size: 1.25rem;
    margin-bottom: 5px;
  }

  .hero-desc {
    display: none;
    /* Hide desc on mobile for clean flixhq look */
  }

  .hero-meta {
    justify-content: center;
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  .hero-actions {
    flex-direction: row;
    gap: 8px;
  }

  .hero-actions .btn {
    width: auto;
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .hero-dots {
    display: none;
  }
}

/* Live Search Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 400px;
  max-width: calc(100vw - 40px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  display: none;
  z-index: 2000;
  overflow: hidden;
}

.search-results-dropdown.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-msg {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.dropdown-item {
  display: flex;
  padding: 12px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.2s;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-item img {
  width: 44px;
  height: 64px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-tertiary);
}

.dropdown-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.dropdown-title {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.dropdown-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-view-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.2s;
}

.dropdown-view-all:hover {
  background: var(--primary-hover);
}

/* Global Hero Controls Re-structure */
.hero-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  margin-top: 24px;
}

.hero-controls .btn {
  min-width: 150px;
  justify-content: center;
  height: 44px;
}

.hero-control-nav {
  display: flex;
  gap: 8px;
}

.hero-control-nav .btn {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 4px;
}

.hero-control-nav .btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
  .hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    bottom: 50px;
    padding: 0 20px;
    left: 0;
    right: 0;
    transform: none;
  }

  .hero-info {
    flex: 1;
    text-align: left;
    margin-right: 12px;
  }

  .hero-title {
    font-size: 1.6rem;
    margin-bottom: 8px;
  }

  .hero-meta {
    justify-content: flex-start;
    margin-bottom: 8px;
  }

  .hero-controls {
    flex-direction: column;
    margin-top: 0;
    gap: 8px;
    align-self: flex-end;
  }

  .hero-controls .btn {
    width: 120px;
    min-width: 120px;
    height: 40px;
    padding: 0 10px;
    font-size: 0.85rem;
  }

  .hero-control-nav {
    flex-direction: column;
    gap: 0;
    width: 120px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.4);
  }

  .hero-control-nav .btn {
    width: 100% !important;
    height: 36px !important;
    border-radius: 0;
    border: none;
    background: transparent;
  }

  .hero-control-nav .btn.hero-prev {
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  }
}

@media (max-width: 480px) {
  .hero {
    height: 400px !important;
  }

  .hero-content {
    bottom: 40px;
  }
}
