/* ===== NETFLIX CLONE — Cinematic Dark ===== */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --netflix-red: #E50914;
  --netflix-red-dark: #B20710;
  --bg-black: #0a0a0a;
  --bg-card: #141414;
  --text-white: #ffffff;
  --text-gray: #b3b3b3;
  --text-dim: #808080;
  --nav-height: 68px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-black);
  color: var(--text-white);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== FILM GRAIN OVERLAY ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 4vw;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
  transition: background 0.3s ease;
}

.navbar.scrolled {
  background: rgba(10,10,10,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;
  flex: 1;
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 2px;
  color: var(--netflix-red);
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: 0 0 20px rgba(229,9,20,0.4);
  user-select: none;
}

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

.nav-links a {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
}

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

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

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

.nav-icon {
  width: 24px; height: 24px;
  color: var(--text-white);
  cursor: pointer;
  transition: opacity 0.2s;
}

.nav-icon:hover { opacity: 0.7; }

.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 4px;
  background: linear-gradient(135deg, #555 0%, #222 100%);
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-white);
}

/* ===== HERO ===== */
.hero {
  position: relative;
  height: 92vh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  padding: 0 4vw 120px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10,10,10,0) 30%, rgba(10,10,10,0.5) 60%, var(--bg-black) 100%),
    linear-gradient(90deg, rgba(10,10,10,0.85) 0%, rgba(10,10,10,0.3) 50%, transparent 100%);
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(229,9,20,0.15);
  border: 1px solid rgba(229,9,20,0.4);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--netflix-red);
  margin-bottom: 18px;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--netflix-red);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 1px;
  margin-bottom: 18px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.8);
}

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

.hero-meta .match {
  color: #46d369;
  font-weight: 700;
}

.hero-meta .rating {
  border: 1px solid var(--text-gray);
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 600;
}

.hero-meta .year { color: var(--text-gray); }

.hero-meta .seasons { color: var(--text-gray); }

.hero-description {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #dcdcdc;
  margin-bottom: 28px;
  max-width: 540px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border: none;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

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

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

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

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

.btn svg {
  width: 22px; height: 22px;
}

/* ===== CONTENT ROWS ===== */
.content-section {
  position: relative;
  z-index: 3;
  margin-top: -80px;
  padding-bottom: 40px;
}

.row {
  margin-bottom: 48px;
  padding-left: 4vw;
}

.row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-right: 4vw;
}

.row-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.row-title .explore {
  font-size: 0.8rem;
  color: var(--netflix-red);
  font-weight: 500;
  margin-left: 12px;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: pointer;
}

.row-header:hover .explore { opacity: 1; }

.row-container {
  position: relative;
  overflow: visible;
}

.row-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 8px;
}

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

.scroll-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4vw;
  min-width: 40px;
  background: linear-gradient(90deg, rgba(10,10,10,0.9), transparent);
  border: none;
  color: var(--text-white);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.scroll-btn.right {
  right: 0;
  background: linear-gradient(270deg, rgba(10,10,10,0.9), transparent);
}

.row-container:hover .scroll-btn { opacity: 1; }

.scroll-btn svg { width: 28px; height: 28px; }

/* ===== CARD ===== */
.card {
  flex: 0 0 auto;
  width: 220px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
  position: relative;
  background: var(--bg-card);
}

.card:hover {
  transform: scale(1.08);
  z-index: 20;
}

.card img {
  width: 100%;
  height: 330px;
  object-fit: cover;
  display: block;
}

.card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.95) 40%);
  padding: 30px 12px 12px;
  opacity: 0;
  transition: opacity 0.3s;
}

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

.card-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

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

.card-meta .match { color: #46d369; font-weight: 600; }

.card-meta .age {
  border: 1px solid var(--text-dim);
  padding: 0 4px;
  font-size: 0.65rem;
}

/* Rank number on trending */
.card.ranked .rank-num {
  position: absolute;
  bottom: -10px;
  left: -20px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 6rem;
  line-height: 1;
  color: #1a1a1a;
  -webkit-text-stroke: 3px #555;
  text-stroke: 3px #555;
  z-index: 1;
  pointer-events: none;
  user-select: none;
}

.card.ranked {
  margin-left: 30px;
}

.card.ranked:first-child { margin-left: 50px; }

/* ===== TOP 10 BADGE ===== */
.top10-section .card {
  width: 280px;
}

.top10-section .card img {
  height: 160px;
  object-fit: cover;
}

/* ===== FOOTER ===== */
.footer {
  padding: 60px 4vw 40px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: #050505;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px 24px;
  margin-bottom: 32px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
  cursor: pointer;
}

.footer-links a:hover { color: var(--text-gray); }

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  color: var(--netflix-red);
  letter-spacing: 1.5px;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4vw;
  animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  border: none;
  color: var(--text-white);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { background: rgba(0,0,0,0.8); }

.modal-hero {
  position: relative;
  height: 360px;
  overflow: hidden;
}

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

.modal-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--bg-card) 100%);
}

.modal-body {
  padding: 0 40px 40px;
  margin-top: -60px;
  position: relative;
  z-index: 2;
}

.modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.modal-meta {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.modal-meta .match { color: #46d369; font-weight: 700; }
.modal-meta .year { color: var(--text-gray); }
.modal-meta .rating { border: 1px solid var(--text-gray); padding: 1px 6px; font-size: 0.75rem; }

.modal-description {
  font-size: 1rem;
  line-height: 1.7;
  color: #dcdcdc;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero { padding: 0 4vw 80px; min-height: 500px; }
  .hero-title { font-size: 2.5rem; }
  .hero-description { font-size: 0.9rem; }
  .card { width: 140px; }
  .card img { height: 210px; }
  .btn { padding: 10px 18px; font-size: 0.9rem; }
  .modal-hero { height: 240px; }
  .modal-body { padding: 0 20px 24px; }
  .modal-title { font-size: 1.8rem; }
}

@media (max-width: 480px) {
  .hero-buttons { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
  .card.ranked { margin-left: 15px; }
  .card.ranked:first-child { margin-left: 25px; }
  .card.ranked .rank-num { font-size: 4rem; left: -10px; }
}
