/* ==========================================================================
   NETFLIX STREAMING THEME - MODERN DARK STYLESHEET
   ========================================================================== */

:root {
  --bg-primary: #141414;
  --bg-secondary: #181818;
  --bg-elevated: #242424;
  --bg-surface: #2f2f2f;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #737373;
  --accent-red: #e50914;
  --accent-red-hover: #f40612;
  --accent-blue: #0071eb;
  --badge-match: #46d369;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.25);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.7);
  --shadow-elevated: 0 20px 40px -10px rgba(0, 0, 0, 0.9);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition-fast: 0.2s cubic-bezier(0.2, 0, 0, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  z-index: 1000;
  transition: background-color var(--transition-smooth), backdrop-filter var(--transition-smooth);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

.navbar.scrolled {
  background-color: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--accent-red);
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(229, 9, 20, 0.4);
}

.brand-logo .logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-red);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 18px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  font-weight: 600;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Search Box */
.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 8px 16px 8px 38px;
  color: #fff;
  font-size: 13px;
  width: 210px;
  transition: width var(--transition-smooth), border-color var(--transition-fast), background var(--transition-fast);
}

.search-input:focus {
  outline: none;
  width: 270px;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.9);
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-secondary);
  pointer-events: none;
  display: flex;
  align-items: center;
}

/* Real-Time Live Search Dropdown */
.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: 90vw;
  background: rgba(22, 22, 26, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 45px -8px rgba(0, 0, 0, 0.9), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  animation: searchDropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes searchDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.search-dropdown-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.search-dropdown-list {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
}

.search-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  text-decoration: none;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}

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

.search-dropdown-item:hover,
.search-dropdown-item.focused {
  background: rgba(229, 9, 20, 0.15);
}

.search-dropdown-thumb {
  width: 40px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.search-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  flex: 1;
}

.search-dropdown-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.search-dropdown-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.search-dropdown-badge.movie {
  background: rgba(0, 113, 235, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.search-dropdown-badge.series {
  background: rgba(229, 9, 20, 0.25);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.search-dropdown-genres {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-dropdown-footer {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.search-dropdown-footer a {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
}

.search-dropdown-footer a:hover {
  color: var(--accent-red-hover);
  text-decoration: underline;
}

.search-dropdown-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.search-dropdown-loading {
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.spin {
  animation: spin 0.8s linear infinite;
}

.admin-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.admin-nav-link:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: #fff;
}

/* ==========================================================================
   HERO BILLBOARD
   ========================================================================== */

.hero-billboard {
  position: relative;
  height: 82vh;
  min-height: 540px;
  max-height: 850px;
  display: flex;
  align-items: flex-end;
  padding: 0 4% 120px;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(77deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 45%, rgba(0, 0, 0, 0) 80%),
    linear-gradient(to top, #141414 0%, rgba(20, 20, 20, 0.4) 20%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 16px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}

.match-score {
  color: var(--badge-match);
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.badge-hd {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.hero-overview {
  font-size: 16px;
  line-height: 1.45;
  color: #e5e5e5;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: #ffffff;
  color: #000000;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.03);
}

.btn-secondary {
  background: rgba(109, 109, 110, 0.7);
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(109, 109, 110, 0.45);
  transform: scale(1.03);
}

.btn-danger {
  background: var(--accent-red);
  color: #ffffff;
}

.btn-danger:hover {
  background: var(--accent-red-hover);
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.4);
}

/* ==========================================================================
   CAROUSEL ROWS & SLIDERS
   ========================================================================== */

.content-section {
  position: relative;
  margin-top: -60px;
  padding-bottom: 40px;
  z-index: 3;
}

.row-container {
  margin-bottom: 44px;
  padding: 0 4%;
  position: relative;
}

.row-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.row-title {
  font-size: 20px;
  font-weight: 700;
  color: #e5e5e5;
  letter-spacing: 0.2px;
}

.row-see-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.row-see-all:hover {
  color: #fff;
}

.carousel-wrapper {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 12px 2px 24px;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-btn {
  position: absolute;
  top: 0;
  bottom: 24px;
  width: 48px;
  background: rgba(20, 20, 20, 0.7);
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
  backdrop-filter: blur(4px);
}

.carousel-wrapper:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn:hover {
  background: rgba(20, 20, 20, 0.95);
}

.carousel-btn.prev {
  left: -20px;
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.carousel-btn.next {
  right: -20px;
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

/* ==========================================================================
   MOVIE & SERIES CARDS
   ========================================================================== */

.media-card {
  flex: 0 0 calc((100% - 80px) / 6);
  min-width: 190px;
  scroll-snap-align: start;
  position: relative;
  border-radius: var(--radius-md);
  background-color: var(--bg-secondary);
  overflow: hidden;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
  cursor: pointer;
}

.media-card:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: var(--shadow-elevated);
  z-index: 20;
}

.card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background-color: var(--bg-surface);
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-smooth);
}

.media-card:hover .card-poster img {
  transform: scale(1.06);
}

.card-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.card-type-badge.series {
  border-left: 3px solid var(--accent-red);
}

.card-type-badge.movie {
  border-left: 3px solid var(--accent-blue);
}

.card-overlay {
  padding: 12px;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.card-rating {
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.card-genres {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   GRID CATALOG (MOVIES & SERIES PAGES)
   ========================================================================== */

.catalog-container {
  padding: 100px 4% 60px;
}

.catalog-header {
  margin-bottom: 28px;
}

.catalog-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
}

.genre-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.genre-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.genre-pill:hover,
.genre-pill.active {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

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

/* ==========================================================================
   WATCH PAGE (STREAMING CINEMA & SERIES NAVIGATION)
   ========================================================================== */

.watch-container {
  padding: 85px 4% 60px;
  max-width: 1500px;
  margin: 0 auto;
}

.watch-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: #fff;
}

.watch-episode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.3);
  color: #ff6b6b;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

/* Responsive Embed Player */
.player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Episode Navigation Bar */
.episode-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.episode-nav-info {
  display: flex;
  flex-direction: column;
}

.episode-nav-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.episode-nav-sub {
  font-size: 13px;
  color: var(--text-secondary);
}

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

.btn-nav-episode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  background: var(--bg-surface);
  color: #fff;
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

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

.btn-nav-episode.btn-next {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.btn-nav-episode.btn-next:hover {
  background: var(--accent-red-hover);
  transform: translateX(2px);
}

.btn-nav-episode.disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

/* Watch Content Info */
.watch-info-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  margin-top: 28px;
}

@media (max-width: 992px) {
  .watch-info-section {
    grid-template-columns: 1fr;
  }
}

.watch-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.watch-meta-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}

.watch-description {
  font-size: 15px;
  line-height: 1.6;
  color: #d1d1d1;
  margin-bottom: 24px;
}

/* Season & Episodes Drawer / Selector */
.episodes-browser {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.episodes-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.season-select-dropdown {
  background: var(--bg-surface);
  color: #fff;
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.season-select-dropdown:focus {
  outline: none;
  border-color: var(--accent-red);
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
}

.episode-item-card {
  display: flex;
  gap: 14px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.episode-item-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.episode-item-card.active {
  border-color: var(--accent-red);
  background: rgba(229, 9, 20, 0.1);
}

.episode-thumb-box {
  position: relative;
  width: 120px;
  height: 68px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.episode-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.episode-item-card:hover .episode-play-icon,
.episode-item-card.active .episode-play-icon {
  opacity: 1;
}

.episode-item-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.episode-num-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.episode-duration {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
  margin-top: 80px;
  padding: 50px 4% 30px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-primary);
  color: var(--text-muted);
  font-size: 13px;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
  list-style: none;
}

.footer-links a:hover {
  text-decoration: underline;
  color: var(--text-secondary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 20px;
}

/* ==========================================================================
   MODAL / POPUP
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-elevated);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background var(--transition-fast);
}

.modal-close-btn:hover {
  background: #000;
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

@media (max-width: 1200px) {
  .media-card {
    flex: 0 0 calc((100% - 60px) / 5);
  }
}

@media (max-width: 992px) {
  .media-card {
    flex: 0 0 calc((100% - 40px) / 4);
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 768px) {
  .media-card {
    flex: 0 0 calc((100% - 20px) / 3);
    min-width: 140px;
  }
  .hero-billboard {
    height: 65vh;
    padding-bottom: 60px;
  }
  .hero-title {
    font-size: 2rem;
  }
  .hero-overview {
    font-size: 14px;
  }
  .search-input {
    width: 140px;
  }
  .search-input:focus {
    width: 180px;
  }
}

@media (max-width: 480px) {
  .media-card {
    flex: 0 0 calc((100% - 10px) / 2);
    min-width: 130px;
  }
  .brand-logo {
    font-size: 20px;
  }
}

/* ==========================================================================
   USER AUTH & GAMIFICATION STYLES
   ========================================================================== */

/* Navbar User Badge & Buttons */
.user-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(246, 224, 94, 0.2) 0%, rgba(229, 9, 20, 0.2) 100%);
  border: 1px solid rgba(246, 224, 94, 0.4);
  color: #f6e05e;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.user-level-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(246, 224, 94, 0.3);
  color: #fff;
  border-color: #f6e05e;
}

.badge-bolt {
  font-size: 13px;
}

.nav-auth-btn {
  font-size: 13px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.nav-auth-btn.signin {
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-auth-btn.signin:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.nav-auth-btn.signup {
  background: var(--accent-red);
  color: #fff;
  border: 1px solid var(--accent-red);
}

.nav-auth-btn.signup:hover {
  background: var(--accent-red-hover);
}

/* User Menu Dropdown */
.user-menu-dropdown-wrapper {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px 4px 4px;
  border-radius: 24px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.user-nav-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-nav-name {
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.85);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
  padding: 6px 0;
}

.user-dropdown-menu.show {
  display: flex;
}

.user-dropdown-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-dropdown-header .header-name {
  font-weight: 800;
  color: #fff;
  font-size: 14px;
}

.user-dropdown-header .header-title {
  font-size: 11px;
  color: #f6e05e;
  font-weight: 700;
  margin-top: 2px;
}

.nav-xp-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.nav-xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #f6e05e, #e50914);
}

.nav-xp-text {
  font-size: 10px;
  color: #a0aec0;
  margin-top: 4px;
  text-align: right;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #cbd5e0;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dropdown-item.logout {
  color: #feb2b2;
}

.dropdown-item.logout:hover {
  background: rgba(229, 62, 62, 0.15);
  color: #ff8080;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

/* ==========================================================================
   ACHIEVEMENT UNLOCK TOAST POPUPS
   ========================================================================== */

.achievement-toast-container {
  position: fixed;
  top: 85px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
  pointer-events: none;
}

.achievement-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #1f1d1d 0%, #111 100%);
  border: 1px solid #ffd700;
  border-radius: 12px;
  padding: 14px 18px;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.25);
  animation: toastSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.toast-icon {
  font-size: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.toast-content {
  flex-grow: 1;
}

.toast-tag {
  font-size: 10px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.toast-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.toast-desc {
  font-size: 12px;
  color: #cbd5e0;
  line-height: 1.3;
}

.toast-close {
  background: transparent;
  border: none;
  color: #a0aec0;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: #fff;
}

/* ==========================================================================
   AUTHENTICATION PAGES (REGISTER & LOGIN)
   ========================================================================== */

.auth-page-wrapper {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 4% 60px;
  background: radial-gradient(circle at center, #1b1c24 0%, #0c0d12 100%);
}

.auth-card-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 900px;
  width: 100%;
  align-items: stretch;
}

.auth-card-container.single-column {
  grid-template-columns: 1fr;
  max-width: 460px;
}

.auth-card {
  background: #141419;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 36px 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
}

.auth-brand-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-red);
  background: rgba(229, 9, 20, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.auth-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.4;
}

.auth-alert-error {
  background: rgba(229, 62, 62, 0.18);
  border: 1px solid rgba(229, 62, 62, 0.4);
  color: #feb2b2;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-alert-info {
  background: rgba(49, 130, 206, 0.18);
  border: 1px solid rgba(49, 130, 206, 0.4);
  color: #bee3f8;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  transition: border-color var(--transition-fast);
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

.btn-auth-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-auth-submit:hover {
  background: var(--accent-red-hover);
}

.btn-auth-submit:active {
  transform: scale(0.99);
}

.auth-footer-text {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.auth-footer-text a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}

.auth-footer-text a:hover {
  color: var(--accent-red);
}

/* Perks Card in Register */
.auth-perks-card {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.08) 0%, rgba(20, 20, 25, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.perks-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 24px;
}

.perk-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.perk-item:last-child {
  margin-bottom: 0;
}

.perk-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.perk-info h4 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
}

.perk-info p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
}

@media (max-width: 768px) {
  .auth-card-container {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   GAMIFIED PROFILE DASHBOARD
   ========================================================================== */

.profile-container {
  padding: 100px 4% 60px;
  max-width: 1400px;
  margin: 0 auto;
}

.profile-alert-success {
  background: rgba(56, 161, 105, 0.18);
  border: 1px solid rgba(56, 161, 105, 0.4);
  color: #9ae6b4;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 24px;
}

.profile-hero-card {
  background: linear-gradient(135deg, #181922 0%, #101116 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
  align-items: center;
}

@media (max-width: 992px) {
  .profile-hero-card {
    grid-template-columns: 1fr;
  }
}

.profile-user-info {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.25);
}

.profile-level-badge-pill {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: #e50914;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  border: 2px solid #141419;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.profile-rank-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: #ffd700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.profile-username {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px 0;
}

.profile-email {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Level Progress Box */
.profile-level-progress-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px 22px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.progress-xp {
  font-size: 14px;
  font-weight: 800;
  color: #ffd700;
}

.progress-bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd700 0%, #e50914 100%);
  border-radius: 6px;
  transition: width 0.6s ease;
}

.progress-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

/* Profile Stats Row */
.profile-stats-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.p-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.p-stat-icon {
  font-size: 26px;
}

.p-stat-value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.p-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Profile Content Sections */
.profile-section {
  margin-bottom: 48px;
}

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

.section-title-row h2 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-link {
  color: var(--accent-red);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.section-link:hover {
  text-decoration: underline;
}

/* History Mini Cards Horizontal Scroll */
.history-cards-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.history-mini-card {
  flex: 0 0 240px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
  transition: transform var(--transition-fast);
}

.history-mini-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
}

.history-thumb-link {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.history-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.history-mini-card:hover .history-play-overlay {
  opacity: 1;
}

.history-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.history-badge.movie {
  background: rgba(229, 9, 20, 0.9);
  color: #fff;
}

.history-badge.series {
  background: rgba(49, 130, 206, 0.9);
  color: #fff;
}

.history-meta {
  padding: 12px;
}

.history-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.history-title:hover {
  color: var(--accent-red);
}

.history-sub {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Recommendations Grid in Profile */
.recommendations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

/* Achievements Showcase */
.achievement-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.ach-filter-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  color: #cbd5e0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ach-filter-btn:hover,
.ach-filter-btn.active {
  background: #ffd700;
  color: #000;
  border-color: #ffd700;
}

.achievements-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.ach-card {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-radius: 12px;
  transition: all var(--transition-fast);
}

.ach-card.unlocked {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.06) 0%, #16171d 100%);
  border: 1px solid rgba(255, 215, 0, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.ach-card.unlocked:hover {
  transform: translateY(-2px);
  border-color: #ffd700;
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.15);
}

.ach-card.locked {
  background: #111216;
  border: 1px solid rgba(255, 255, 255, 0.05);
  opacity: 0.65;
}

.ach-card.locked:hover {
  opacity: 0.85;
}

.ach-icon-container {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ach-card.unlocked .ach-icon-container {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.ach-icon {
  font-size: 28px;
}

.ach-card.locked .ach-icon {
  filter: grayscale(1) opacity(0.35);
}

.ach-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0aec0;
}

.ach-details {
  flex-grow: 1;
  overflow: hidden;
}

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

.ach-category-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #a0aec0;
  letter-spacing: 0.5px;
}

.ach-xp-tag {
  font-size: 11px;
  font-weight: 800;
  color: #ffd700;
}

.ach-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px 0;
}

.ach-desc {
  font-size: 12px;
  color: #a0aec0;
  line-height: 1.35;
  margin: 0 0 8px 0;
}

.ach-unlocked-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #48bb78;
  font-weight: 700;
}

.ach-locked-hint {
  font-size: 11px;
  color: #718096;
  font-style: italic;
  text-transform: capitalize;
}

/* ==========================================================================
   FULL WATCH HISTORY PAGE
   ========================================================================== */

.history-page-container {
  padding: 100px 4% 60px;
  max-width: 1100px;
  margin: 0 auto;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.history-page-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px 0;
}

.history-page-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.btn-clear-history {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(229, 62, 62, 0.15);
  border: 1px solid rgba(229, 62, 62, 0.35);
  color: #feb2b2;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clear-history:hover {
  background: #e50914;
  color: #fff;
  border-color: #e50914;
}

.history-empty-state {
  text-align: center;
  padding: 80px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.history-empty-state h2 {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.history-empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

.history-items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-row-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 18px;
  transition: border-color var(--transition-fast);
}

.history-row-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.history-row-item .history-thumb-link {
  width: 140px;
  flex-shrink: 0;
  border-radius: 6px;
}

.history-info-col {
  flex-grow: 1;
  overflow: hidden;
}

.history-item-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.history-item-title:hover {
  color: var(--accent-red);
}

.history-item-episode {
  font-size: 13px;
  font-weight: 600;
  color: #90cdf4;
  margin-bottom: 4px;
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.rating-tag {
  color: #ffd700;
  font-weight: 600;
}

.history-item-time {
  font-size: 11px;
  color: var(--text-muted);
}

.history-actions-col {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-history-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent-red);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.btn-history-play:hover {
  background: var(--accent-red-hover);
}

.btn-history-remove {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #a0aec0;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-history-remove:hover {
  border-color: #e53e3e;
  color: #e53e3e;
  background: rgba(229, 62, 62, 0.1);
}

@media (max-width: 640px) {
  .history-row-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .history-row-item .history-thumb-link {
    width: 100%;
  }
  .history-actions-col {
    width: 100%;
    justify-content: space-between;
    margin-top: 8px;
  }
}

/* ==========================================================================
   PROFILE SETTINGS (AVATAR & PASSWORD)
   ========================================================================== */

.profile-alert-danger {
  background: rgba(229, 62, 62, 0.18);
  border: 1px solid rgba(229, 62, 62, 0.4);
  color: #feb2b2;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-alert-success {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-edit-overlay-btn {
  position: absolute;
  top: 0;
  right: -4px;
  background: rgba(20, 20, 25, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.avatar-edit-overlay-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  transform: scale(1.05);
}

.profile-settings-quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
}

.profile-settings-quick-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Settings Cards Grid */
.settings-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: stretch;
}

@media (max-width: 992px) {
  .settings-cards-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card {
  background: linear-gradient(135deg, #181922 0%, #121318 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-card-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}

.settings-card-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px 0;
}

.settings-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.avatar-selection-area {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

@media (max-width: 580px) {
  .avatar-selection-area {
    flex-direction: column;
    align-items: center;
  }
}

.avatar-current-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.avatar-current-preview img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
  background: #000;
}

.avatar-preview-label {
  font-size: 11px;
  font-weight: 700;
  color: #a0aec0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.avatar-presets-col {
  flex-grow: 1;
  width: 100%;
}

.avatar-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.preset-avatar-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preset-avatar-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.preset-avatar-btn:hover {
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.preset-avatar-btn.selected {
  border-color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  transform: scale(1.12);
}

.settings-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 6px;
}

.settings-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.2);
}

.btn-settings-submit {
  width: 100%;
  padding: 12px;
  background: var(--accent-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-settings-submit:hover {
  background: var(--accent-red-hover);
}

.btn-settings-submit:active {
  transform: scale(0.99);
}

/* ==========================================
   STREAMING & PLAYER ENHANCEMENTS
   ========================================== */

/* Player Wrapper & Progress Track */
.player-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.player-progress-bar-container {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  position: relative;
}

.player-progress-bar-fill {
  height: 100%;
  background: #e50914;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.8);
  transition: width 0.3s ease;
  width: 0%;
}

/* Player Action Toolbar */
.player-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(20, 20, 20, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 14px;
}

.server-switcher-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-switcher-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a0aec0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.server-pills-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.server-pill-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.server-pill-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.server-pill-btn.active {
  background: #e50914;
  border-color: #e50914;
  color: #fff;
  box-shadow: 0 2px 10px rgba(229, 9, 20, 0.4);
}

.player-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-player-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e0;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-player-action:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-player-action.active {
  background: rgba(229, 9, 20, 0.2);
  border-color: #e50914;
  color: #ff6b6b;
}

.btn-mark-watched {
  transition: all var(--transition-fast);
}

.btn-mark-watched.completed {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #22c55e;
}

.btn-mark-watched.completed:hover {
  background: rgba(34, 197, 94, 0.25);
}

.watched-icon {
  font-weight: 800;
  font-size: 14px;
}

/* Theater Mode Styles */
.watch-container.theater-mode {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-top: 70px;
}

.watch-container.theater-mode .player-wrapper {
  margin-bottom: 24px;
}

.watch-container.theater-mode .player-container {
  border-radius: 0;
  max-height: 82vh;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-left: none;
  border-right: none;
}

.watch-container.theater-mode .player-toolbar {
  max-width: 1500px;
  margin: 0 auto 12px;
  border-radius: 8px;
}

.watch-container.theater-mode .watch-top-nav,
.watch-container.theater-mode .episode-nav-bar,
.watch-container.theater-mode .watch-info-section {
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 4%;
  padding-right: 4%;
}

/* Lights Off Mode */
.lights-off-curtain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.94);
  z-index: 850;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.lights-off-curtain.hidden {
  opacity: 0;
  pointer-events: none;
}

body.lights-off-active .watch-container {
  position: relative;
}

body.lights-off-active .player-wrapper,
body.lights-off-active .player-toolbar,
body.lights-off-active .watch-top-nav {
  position: relative;
  z-index: 900;
}

/* Autoplay Next Episode Overlay (Series) */
.autoplay-overlay {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.autoplay-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
}

.autoplay-card {
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(12px);
  min-width: 380px;
  max-width: 480px;
}

.autoplay-countdown-circle {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.circular-chart {
  display: block;
  width: 100%;
  height: 100%;
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 3;
}

.circle {
  fill: none;
  stroke: #e50914;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 1s linear;
}

.countdown-seconds {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.autoplay-info {
  flex: 1;
  min-width: 0;
}

.autoplay-tag {
  font-size: 11px;
  font-weight: 800;
  color: #e50914;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.autoplay-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-autoplay-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e50914;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.btn-autoplay-play:hover {
  background: #f40612;
  transform: scale(1.03);
}

.btn-autoplay-cancel {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e0;
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-autoplay-cancel:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Card Progress Bars & Completed Badges */
.card-progress-track {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 5;
  overflow: hidden;
}

.card-progress-fill {
  height: 100%;
  background: #e50914;
  box-shadow: 0 0 6px rgba(229, 9, 20, 0.9);
}

.card-completed-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(34, 197, 94, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 4px;
  z-index: 6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}


