/* ===== FAMILYFLIX - FEMININE GOLD & BLUSH THEME ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --accent: #f0b429;
  --accent-hover: #f7c948;
  --accent-soft: #fcefc7;
  --blush: #f9a8d4;
  --blush-deep: #ec4899;
  --lavender: #c4b5fd;
  --dark: #1a1520;
  --dark2: #201a28;
  --dark3: #2a2232;
  --gray: #808080;
  --light-gray: #c8b8d8;
  --white: #ffffff;
  --match-green: #46d369;
  --overlay: rgba(0,0,0,0.7);
  --nav-height: 68px;
  --card-transition: 300ms ease;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--dark);
  color: var(--white);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(240,180,41,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(240,180,41,0.5); }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 4%;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.4s ease;
}

.navbar-gradient {
  background: linear-gradient(180deg, rgba(26,21,32,0.85) 10%, transparent 100%);
}

.navbar.scrolled {
  background: rgba(26,21,32,0.98);
}

.navbar.solid {
  background: rgba(26,21,32,0.98);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Logo - golden script style */
.logo {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.5px;
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  text-transform: uppercase;
  position: relative;
  text-shadow: 0 0 20px rgba(240,180,41,0.3);
}

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

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

.nav-links a {
  color: #e5d5f0;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a.active {
  color: var(--white);
  font-weight: 600;
}

.tagline {
  color: var(--blush);
  font-size: 0.7rem;
  margin-left: 4px;
  font-style: italic;
  white-space: nowrap;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Search icon in nav */
.search-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

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

/* Nav icons */
.nav-icon-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  position: relative;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

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

.notification-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 6px;
  background: var(--blush-deep);
  border-radius: 50%;
}

/* Profile avatar */
.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--blush-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: opacity 0.2s;
}

.profile-avatar:hover { opacity: 0.85; }

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20,16,28,0.97);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 100px;
}

.search-overlay.active {
  display: flex;
}

.search-box {
  width: 100%;
  max-width: 700px;
  position: relative;
  padding: 0 4%;
}

.search-box input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  background: #2a2232;
  border: 1px solid rgba(240,180,41,0.3);
  border-radius: 4px;
  color: var(--white);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(240,180,41,0.15);
}

.search-box input::placeholder {
  color: #999;
}

.search-icon-inside {
  position: absolute;
  left: calc(4% + 16px);
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 1.1rem;
}

.search-close {
  position: absolute;
  top: 20px;
  right: 4%;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
}

.search-results-grid {
  width: 100%;
  max-width: 1200px;
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 0 4%;
}

/* ===== HERO / BILLBOARD ===== */
.hero {
  position: relative;
  height: 56.25vw;
  max-height: 80vh;
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  padding: 0 4% 14%;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  transition: background-image 1s ease;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to right,
      rgba(26,21,32,0.85) 0%,
      rgba(26,21,32,0.4) 30%,
      transparent 60%
    ),
    linear-gradient(
      to top,
      rgba(26,21,32,1) 0%,
      rgba(26,21,32,0.7) 10%,
      rgba(26,21,32,0) 30%
    ),
    linear-gradient(
      to bottom,
      rgba(26,21,32,0.3) 0%,
      transparent 15%
    );
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--white);
}

.hero-badge-icon {
  color: var(--accent);
  font-size: 1.4rem;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 14px;
  text-shadow: 2px 4px 10px rgba(0,0,0,0.6);
}

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

.hero-match {
  color: var(--accent);
  font-weight: 700;
}

.hero-rating {
  color: var(--accent);
  font-weight: 700;
}

.hero-year, .hero-runtime {
  color: var(--white);
}

.hero-description {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ddd;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 450px;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 26px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-play {
  background: var(--white);
  color: #111;
}

.btn-play:hover {
  background: rgba(255,255,255,0.75);
}

.btn-info {
  background: rgba(109,109,110,0.7);
  color: var(--white);
}

.btn-info:hover {
  background: rgba(109,109,110,0.4);
}

.btn-primary {
  background: var(--accent);
  color: #1a1520;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Hero indicators */
.hero-indicators {
  position: absolute;
  bottom: 35%;
  right: 4%;
  display: flex;
  gap: 4px;
  z-index: 5;
}

.hero-dot {
  width: 12px;
  height: 3px;
  border-radius: 1px;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.hero-dot.active {
  background: var(--accent);
  width: 24px;
}

/* Maturity badge */
.maturity-badge {
  border: 1px solid rgba(240,180,41,0.4);
  padding: 1px 7px;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* ===== CONTENT SECTIONS ===== */
.section {
  padding: 10px 4% 0;
  position: relative;
  z-index: 3;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #e5e5e5;
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.3;
}

.section-title .explore-more {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
}

.section:hover .explore-more {
  opacity: 1;
}

/* ===== CAROUSEL ===== */
.carousel-wrapper {
  position: relative;
  overflow: visible;
  margin: 0 -4px;
}

.carousel {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 4px 40px;
  scroll-snap-type: x mandatory;
}

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

.carousel-btn {
  position: absolute;
  top: 0;
  bottom: 40px;
  background: rgba(26,21,32,0.5);
  border: none;
  color: var(--white);
  width: 48px;
  cursor: pointer;
  z-index: 20;
  font-size: 1.8rem;
  transition: background 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

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

.carousel-btn:hover {
  background: rgba(26,21,32,0.8);
}

.carousel-btn.prev { left: -4px; border-radius: 0 4px 4px 0; }
.carousel-btn.next { right: -4px; border-radius: 4px 0 0 4px; }

/* ===== MOVIE CARD ===== */
.movie-card {
  flex: 0 0 calc(16.666% - 4px);
  min-width: 150px;
  position: relative;
  border-radius: 4px;
  overflow: visible;
  cursor: pointer;
  transition: transform var(--card-transition), z-index 0s 0.3s;
  scroll-snap-align: start;
}

.movie-card:hover {
  transform: scale(1.3);
  z-index: 100;
  transition: transform var(--card-transition), z-index 0s;
  transition-delay: 0.3s, 0s;
}

.carousel .movie-card:first-child:hover {
  transform: scale(1.3) translateX(15%);
  transform-origin: left center;
}

.carousel .movie-card:last-child:hover {
  transform: scale(1.3) translateX(-15%);
  transform-origin: right center;
}

.movie-card-inner {
  border-radius: 4px;
  overflow: hidden;
  background: var(--dark3);
  position: relative;
}

.movie-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: var(--dark3);
  border-radius: 4px;
}

/* Hover info card */
.movie-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark2);
  padding: 10px 12px 12px;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s, transform 0.3s;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  transition-delay: 0.3s;
}

.movie-card:hover .movie-card-overlay {
  opacity: 1;
  transform: translateY(0);
}

.movie-card-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  align-items: center;
}

.card-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
  background: rgba(26,21,32,0.7);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.card-btn.play-btn {
  background: var(--white);
  color: #111;
  border-color: var(--white);
}

.card-btn:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.15);
}

.card-btn.play-btn:hover {
  background: #e6e6e6;
}

.card-btn.add-btn.in-list {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240,180,41,0.15);
}

.card-btn-spacer {
  flex: 1;
}

.movie-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  color: var(--light-gray);
  flex-wrap: wrap;
}

.movie-card-rating {
  color: var(--accent);
  font-weight: 700;
}

.movie-card-maturity {
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0px 4px;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.5;
}

.movie-card-genre {
  color: var(--light-gray);
  font-size: 0.6rem;
}

/* TV badge */
.tv-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--blush-deep);
  color: white;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  z-index: 5;
  text-transform: uppercase;
}

/* New episodes badge */
.new-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: #1a1520;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  z-index: 5;
}

/* ===== TOP 10 ROW ===== */
.top10-card {
  flex: 0 0 calc(16.666% - 4px);
  min-width: 150px;
  position: relative;
  display: flex;
  align-items: flex-end;
  cursor: pointer;
  scroll-snap-align: start;
  padding-left: 40px;
}

.top10-rank {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 8rem;
  font-weight: 900;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 3px rgba(240,180,41,0.5);
  font-family: 'Arial Black', sans-serif;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.top10-card img {
  width: calc(100% - 20px);
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 4px;
  position: relative;
  z-index: 2;
}

/* ===== WIDE CARD (16:9) ===== */
.movie-card.wide {
  flex: 0 0 calc(25% - 4px);
  min-width: 220px;
}

.movie-card.wide img {
  aspect-ratio: 16/9;
}

/* ===== GENRE PILLS ===== */
.genres-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.genre-pill {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(240,180,41,0.25);
  font-size: 0.8rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--white);
  background: transparent;
  text-decoration: none;
}

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

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 3000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--dark2);
  border-radius: 6px;
  width: 100%;
  max-width: 850px;
  position: relative;
  overflow: hidden;
  animation: modalIn 0.25s ease;
  box-shadow: 0 10px 60px rgba(0,0,0,0.6);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-hero {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--dark3);
  overflow: hidden;
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, var(--dark2));
}

.modal-hero-content {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--dark2);
  border: none;
  color: var(--white);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover { background: #333; }

.modal-body {
  padding: 16px 24px 28px;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
}

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

.modal-rating { color: var(--accent); font-weight: 700; }
.modal-year, .modal-runtime, .modal-lang { color: var(--light-gray); }

.modal-hd {
  border: 1px solid var(--gray);
  padding: 0px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--light-gray);
  border-radius: 3px;
}

.modal-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #d2d2d2;
  margin-bottom: 18px;
}

.modal-genres {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.modal-genre-tag {
  font-size: 0.75rem;
  color: var(--light-gray);
  background: rgba(240,180,41,0.08);
  padding: 3px 10px;
  border-radius: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== PLAYER PAGE ===== */
.player-page {
  min-height: 100vh;
  padding-top: var(--nav-height);
  background: #000;
}

.player-container {
  width: 100%;
  background: #000;
  position: relative;
}

.player-iframe-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 85vh;
  position: relative;
  background: #000;
}

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

.player-info {
  padding: 24px 4%;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--dark);
}

.player-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.player-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.player-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #d2d2d2;
  max-width: 800px;
  margin-bottom: 30px;
}

.server-selector {
  margin-bottom: 24px;
}

.server-selector h3 {
  font-size: 0.85rem;
  color: var(--light-gray);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.server-btn {
  padding: 8px 20px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}

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

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

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, #2a2232 25%, #332a3c 50%, #2a2232 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

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

.skeleton-card {
  flex: 0 0 calc(16.666% - 4px);
  min-width: 150px;
  aspect-ratio: 2/3;
  border-radius: 4px;
}

/* ===== FOOTER ===== */
footer {
  padding: 50px 4% 30px;
  margin-top: 40px;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.footer-social {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.footer-social a {
  color: var(--white);
  font-size: 1.4rem;
  text-decoration: none;
  transition: color 0.2s;
}

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

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.footer-links a {
  color: #808080;
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.2s;
  line-height: 2.2;
}

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

.footer-service-code {
  display: inline-block;
  border: 1px solid #808080;
  color: #808080;
  font-size: 0.75rem;
  padding: 4px 10px;
  margin-bottom: 16px;
  cursor: pointer;
  background: transparent;
}

.footer-bottom {
  color: #808080;
  font-size: 0.75rem;
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--accent);
  font-family: 'Arial Black', 'Helvetica Neue', Arial, sans-serif;
  margin-bottom: 20px;
  display: block;
  text-decoration: none;
  text-transform: uppercase;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--accent);
  color: #1a1520;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(240,180,41,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 60px auto;
}

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

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 90px 4% 24px;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
}

.page-header p {
  color: var(--light-gray);
  margin-top: 6px;
  font-size: 0.9rem;
}

/* ===== GRID PAGE ===== */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
  padding: 20px 4%;
}

.movies-grid .movie-card {
  min-width: unset;
  flex: unset;
}

.movies-grid .movie-card:hover {
  transform: scale(1.05);
}

/* ===== NO RESULTS ===== */
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--light-gray);
}

.no-results h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--white);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .movie-card { flex: 0 0 calc(20% - 4px); }
  .movie-card.wide { flex: 0 0 calc(33.33% - 4px); }
  .top10-card { flex: 0 0 calc(20% - 4px); }
}

@media (max-width: 900px) {
  .movie-card { flex: 0 0 calc(25% - 4px); }
  .movie-card.wide { flex: 0 0 calc(50% - 4px); }
  .top10-card { flex: 0 0 calc(25% - 4px); }
  .nav-links { display: none; }
  .tagline { display: none; }
  .hero { height: 56.25vw; min-height: 350px; }
  .hero-title { font-size: 1.6rem; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }

  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    margin-left: 8px;
  }
  .mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
  }

  .mobile-nav {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(26,21,32,0.98);
    z-index: 999;
    padding: 12px 4%;
    border-top: 1px solid rgba(240,180,41,0.1);
  }
  .mobile-nav.open { display: block; }
  .mobile-nav a {
    display: block;
    color: #e5d5f0;
    text-decoration: none;
    font-size: 1rem;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  .mobile-nav a.active { color: var(--white); font-weight: 600; }
  .mobile-nav a:last-child { border-bottom: none; }

  .movie-card { -webkit-tap-highlight-color: transparent; }
  .card-hover-info { display: none; }
}

@media (max-width: 600px) {
  .movie-card { flex: 0 0 calc(33.33% - 4px); min-width: 105px; }
  .movie-card.wide { flex: 0 0 calc(50% - 4px); min-width: 150px; }
  .top10-card { flex: 0 0 calc(33.33% - 4px); min-width: 105px; }
  .hero-title { font-size: 1.3rem; }
  .hero-description { display: none; }
  .hero-meta { font-size: 0.75rem; }
  .btn { padding: 8px 16px; font-size: 0.85rem; }
  .logo { font-size: 1.3rem; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 1.1rem; }
  .movie-card:hover { transform: scale(1.05); }
  .hero { padding-bottom: 10%; }
  .search-results-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .top10-rank { font-size: 5rem; }
}

/* ===== FAMILYFLIX NATIVE PLAYER ===== */
.bf-player {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: inherit;
}

.bf-player video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.bf-overlay {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 2;
}

.bf-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  opacity: 0.9;
}
.bf-center-play:hover { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
.bf-center-play svg { width: 80px; height: 80px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8)); }

.bf-spinner-wrap {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 6;
  background: rgba(0,0,0,0.4);
}
.bf-spin {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: bfSpin 0.8s linear infinite;
}
@keyframes bfSpin { to { transform: rotate(360deg); } }
.bf-spinner-wrap p {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  margin: 0;
}

.bf-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(transparent, rgba(0,0,0,0.85) 60%);
  padding: 40px 16px 12px;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.bf-controls.visible {
  opacity: 1;
  pointer-events: all;
}
.bf-player:fullscreen .bf-controls { opacity: 0; pointer-events: none; }
.bf-player:fullscreen .bf-controls.visible { opacity: 1; pointer-events: all; }
.bf-player:fullscreen.bf-idle { cursor: none; }
.bf-player:fullscreen.bf-idle .bf-controls { opacity: 0 !important; pointer-events: none !important; }
.bf-player:fullscreen.bf-idle .bf-server-bar { opacity: 0 !important; pointer-events: none !important; }
.bf-player:fullscreen.bf-idle .bf-center-play { opacity: 0 !important; }

.bf-progress-wrap { padding: 6px 0; cursor: pointer; margin-bottom: 8px; }
.bf-progress-bar {
  position: relative;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  transition: height 0.15s;
}
.bf-progress-wrap:hover .bf-progress-bar { height: 6px; }
.bf-buffered {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255,0.3);
  border-radius: 2px; width: 0; transition: width 0.5s;
}
.bf-played {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent);
  border-radius: 2px; width: 0;
}
.bf-thumb {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 14px; height: 14px;
  background: var(--accent);
  border-radius: 50%; left: 0;
  transition: transform 0.15s;
  box-shadow: 0 0 4px rgba(240,180,41,0.8);
}
.bf-progress-wrap:hover .bf-thumb { transform: translate(-50%, -50%) scale(1); }

.bf-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bf-left-controls, .bf-right-controls { display: flex; align-items: center; gap: 4px; }

.bf-btn {
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.bf-btn:hover { background: rgba(255,255,255,0.15); }
.bf-btn svg { width: 22px; height: 22px; display: block; }

.bf-vol-group { display: flex; align-items: center; gap: 4px; }
.bf-vol-slider {
  -webkit-appearance: none; width: 0; height: 4px;
  background: rgba(255,255,255,0.3); border-radius: 2px;
  outline: none; cursor: pointer; overflow: hidden; transition: width 0.2s;
}
.bf-vol-group:hover .bf-vol-slider { width: 72px; }
.bf-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: white; cursor: pointer;
  box-shadow: -60px 0 0 60px rgba(255,255,255,0.9);
}

.bf-time {
  color: rgba(255,255,255,0.85); font-size: 0.8rem;
  white-space: nowrap; padding: 0 4px; font-variant-numeric: tabular-nums;
}

.bf-quality-wrap { position: relative; }
.bf-quality-btn {
  background: rgba(255,255,255,0.15) !important;
  border: 1px solid rgba(255,255,255,0.25) !important;
  color: white; font-size: 0.75rem;
  padding: 4px 10px !important; border-radius: 4px;
  cursor: pointer; white-space: nowrap;
}
.bf-quality-menu {
  position: absolute; bottom: calc(100% + 8px); right: 0;
  background: rgba(32,26,40,0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px; overflow: hidden;
  min-width: 100px; display: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.bf-quality-menu.open { display: block; }
.bf-q-item {
  padding: 8px 16px; font-size: 0.82rem;
  color: rgba(255,255,255,0.85); cursor: pointer;
  display: flex; gap: 8px; align-items: center;
  transition: background 0.15s;
}
.bf-q-item:hover { background: rgba(255,255,255,0.1); }

.bf-server-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  background: linear-gradient(rgba(0,0,0,0.7), transparent);
  padding: 12px 16px; display: none; align-items: center;
  gap: 8px; opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.bf-server-bar.visible { opacity: 1; pointer-events: all; }
.bf-server-label { color: rgba(255,255,255,0.5); font-size: 0.75rem; }
.bf-srv {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  padding: 3px 12px; border-radius: 4px;
  font-size: 0.75rem; cursor: pointer; transition: background 0.15s;
}
.bf-srv.active { background: var(--accent); border-color: var(--accent); color: #1a1520; }
.bf-srv:hover:not(.active) { background: rgba(255,255,255,0.22); }

.bf-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px;
  background: #0a0a0a; z-index: 20;
  text-align: center; padding: 20px;
}
.bf-error p { color: rgba(255,255,255,0.7); font-size: 0.95rem; margin: 0; }
.bf-error div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }

.bf-player:-webkit-full-screen { width: 100%; height: 100%; }
.bf-player:fullscreen { width: 100%; height: 100%; }

/* ===== MOBILE HAMBURGER ===== */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 900px) {
  .mobile-menu-btn { display: flex; align-items: center; }
}

/* ===== RT-STYLE SCORE BADGE ON CARDS ===== */
.card-score-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(0,0,0,0.85);
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--score-color);
  z-index: 5;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
}
.card-score-badge.fresh { border-color: rgba(70,211,105,0.3); }
.card-score-badge.mixed { border-color: rgba(240,180,41,0.3); }
.card-score-badge.rotten { border-color: rgba(236,72,153,0.3); }
.card-score-icon { flex-shrink: 0; }

/* ===== CONTENT RATING BADGE ON CARDS ===== */
.card-cert-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background: rgba(0,0,0,0.8);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 1px 5px;
  font-size: 0.55rem;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  border-radius: 2px;
  letter-spacing: 0.3px;
  z-index: 5;
  backdrop-filter: blur(4px);
  text-transform: uppercase;
  transition: opacity 0.3s;
}
.movie-card:hover .card-cert-badge { opacity: 0; }

/* ===== MODAL SCORE BADGE ===== */
.modal-score-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}
.modal-score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ===== TRAILER MODAL OVERLAY ===== */
.trailer-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.trailer-modal-overlay.active {
  display: flex;
}
.trailer-modal {
  width: 100%;
  max-width: 960px;
  background: #201a28;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
  animation: modalIn 0.25s ease;
}
.trailer-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #2a2232;
  border-bottom: 1px solid rgba(240,180,41,0.1);
}
.trailer-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trailer-modal-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.2s;
}
.trailer-modal-close:hover { color: #fff; }
.trailer-modal-body {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
}
.trailer-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== WATCH PAGE TRAILER BUTTON ===== */
.btn-watch-trailer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: rgba(240,180,41,0.2);
  color: var(--accent);
  border: 1px solid rgba(240,180,41,0.3);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.btn-watch-trailer:hover { background: rgba(240,180,41,0.35); }

/* ===== WATCH PAGE SCORE DISPLAY ===== */
.watch-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.watch-score-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
}

/* ===== CONTENT WARNINGS / ADVISORIES ===== */
.content-warnings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(240,180,41,0.06);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}
.cw-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 4px;
}
.cw-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(240,180,41,0.12);
  border: 1px solid rgba(240,180,41,0.25);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-soft);
  white-space: nowrap;
}
@media (max-width: 768px) {
  .content-warnings { padding: 8px 10px; gap: 6px; }
  .cw-label { font-size: 0.7rem; }
  .cw-tag { font-size: 0.65rem; padding: 2px 8px; }
}
