/* ============================================================
   PROGON FILM — style.css
   Ultra-modern cinema platform stylesheet
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables (Dark Mode Default) ───────────────────── */
:root {
  --bg-primary:    #050508;
  --bg-secondary:  #0d0d14;
  --bg-card:       #111118;
  --bg-glass:      rgba(255,255,255,0.04);
  --border-glass:  rgba(255,255,255,0.08);
  --accent:        #e50914;
  --accent-glow:   rgba(229,9,20,0.35);
  --accent-2:      #ff6b35;
  --text-primary:  #f0f0f5;
  --text-secondary:#8a8a9a;
  --text-muted:    #4a4a5a;
  --shadow-card:   0 8px 40px rgba(0,0,0,0.6);
  --shadow-accent: 0 0 30px var(--accent-glow);
  --radius-card:   14px;
  --radius-btn:    8px;
  --font-display:  'Bebas Neue', sans-serif;
  --font-body:     'Outfit', sans-serif;
  --transition:    0.3s cubic-bezier(0.4,0,0.2,1);
  --navbar-h:      72px;
}

/* ── Light Mode ───────────────────────────────────────────── */
body.light-mode {
  --bg-primary:    #f2f2f7;
  --bg-secondary:  #ffffff;
  --bg-card:       #ffffff;
  --bg-glass:      rgba(0,0,0,0.03);
  --border-glass:  rgba(0,0,0,0.08);
  --text-primary:  #0d0d14;
  --text-secondary:#555566;
  --text-muted:    #aaaabc;
  --shadow-card:   0 4px 24px rgba(0,0,0,0.1);
}

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

html { scroll-behavior: smooth; }

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

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

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

/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  height: var(--navbar-h);
  display: flex; align-items: center;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(5,5,8,0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-glass);
  gap: 24px;
}

body.light-mode .navbar {
  background: rgba(242,242,247,0.88);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-logo span {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.nav-links {
  display: flex; gap: 4px;
  list-style: none;
  flex-shrink: 0;
}

.nav-links a {
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 14px; border-radius: 6px;
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}

/* Search in Navbar */
.nav-search {
  position: relative; display: flex; align-items: center;
}

.nav-search input {
  width: 0; padding: 0;
  background: var(--bg-glass);
  border: 1px solid transparent;
  border-radius: 24px;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 14px;
  outline: none;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1), padding 0.4s, border-color 0.3s;
  overflow: hidden;
}

.nav-search.open input {
  width: clamp(160px, 22vw, 280px);
  padding: 9px 40px 9px 16px;
  border-color: var(--border-glass);
}

.nav-search-btn {
  position: absolute; right: 0;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition);
  border-radius: 50%;
}

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

/* Dark/Light toggle */
.theme-toggle {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50%; cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff; border-color: var(--accent);
  box-shadow: var(--shadow-accent);
}

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}

.hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ═══════════════════════════════════════════════════════════
   HERO / PAGE HEADER
   ═══════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: clamp(60px,10vw,120px) clamp(16px,4vw,48px) clamp(40px,6vw,80px);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(229,9,20,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 4px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 16px;
  opacity: 0; animation: fadeUp 0.6s 0.1s forwards;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 10vw, 120px);
  line-height: 0.95;
  letter-spacing: 2px;
  color: var(--text-primary);
  opacity: 0; animation: fadeUp 0.7s 0.2s forwards;
}

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

.hero p {
  margin-top: 20px;
  font-size: clamp(14px, 1.8vw, 17px);
  color: var(--text-secondary);
  max-width: 560px; margin-left: auto; margin-right: auto;
  line-height: 1.7;
  opacity: 0; animation: fadeUp 0.7s 0.35s forwards;
}

/* ── Search Bar (Hero) ────────────────────────────────────── */
.search-container {
  margin-top: 36px;
  display: flex; justify-content: center;
  opacity: 0; animation: fadeUp 0.7s 0.5s forwards;
}

.search-box {
  position: relative; width: 100%; max-width: 560px;
}

.search-box input {
  width: 100%; padding: 16px 56px 16px 24px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 15px;
  outline: none;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229,9,20,0.15);
}

.search-box .search-icon {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; font-size: 18px;
}

/* ── No Results ───────────────────────────────────────────── */
.no-results {
  display: none; text-align: center;
  padding: 80px 20px; color: var(--text-muted);
  font-size: 16px;
}

.no-results.visible { display: block; }

/* ═══════════════════════════════════════════════════════════
   SECTION / GRID
   ═══════════════════════════════════════════════════════════ */
.section {
  padding: 0 clamp(16px, 4vw, 48px) 80px;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 36px);
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

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

.section-meta {
  font-size: 13px; color: var(--text-muted);
}

/* ── Movies Grid ──────────────────────────────────────────── */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

/* ── Movie Card ───────────────────────────────────────────── */
.movie-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  text-decoration: none; color: inherit;
  display: block;
  opacity: 0;
  transform: translateY(24px);
  animation: cardReveal 0.5s forwards;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
              box-shadow 0.35s,
              border-color 0.35s;
}

.movie-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 30px var(--accent-glow);
  border-color: rgba(229,9,20,0.4);
}

/* Poster area */
.movie-poster {
  position: relative;
  aspect-ratio: 2/3;
  background: var(--bg-secondary);
  overflow: hidden;
}

.movie-poster img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1), filter 0.4s;
  filter: brightness(0.9);
}

.movie-card:hover .movie-poster img {
  transform: scale(1.07);
  filter: brightness(1.05);
}

/* Poster placeholder */
.poster-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(135deg, #111118 0%, #1a1a28 100%);
}

.poster-placeholder .film-icon { font-size: 48px; opacity: 0.3; }
.poster-placeholder span { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }

/* Overlay on hover */
.movie-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(229,9,20,0.75) 0%, transparent 60%);
  opacity: 0;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 20px;
  transition: opacity 0.35s;
}

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

.overlay-play {
  width: 48px; height: 48px;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 18px;
  transform: scale(0.6);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

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

/* Badge */
.movie-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--accent);
  color: #fff; font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* Rating */
.movie-rating {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  color: #ffd700; font-size: 12px; font-weight: 600;
  padding: 3px 8px; border-radius: 4px;
  display: flex; align-items: center; gap: 3px;
}

/* Card info */
.movie-info {
  padding: 14px 14px 16px;
}

.movie-title {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 5px;
}

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

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

.movie-genre {
  font-size: 11px; font-weight: 500; letter-spacing: 0.5px;
  color: var(--accent); text-transform: uppercase;
  margin-top: 5px;
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 24px 0 64px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0 12px;
}

.page-btn:hover {
  background: var(--bg-glass);
  border-color: var(--accent);
  color: var(--text-primary);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

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

.page-dots {
  color: var(--text-muted); font-size: 16px;
  padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════════
   MOVIE DETAIL PAGE
   ═══════════════════════════════════════════════════════════ */
.detail-hero {
  position: relative;
  min-height: 85vh;
  display: flex; align-items: flex-end;
  overflow: hidden;
}

/* Background art */
.detail-bg {
  position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(135deg, #050508 0%, #0d0d20 50%, #0a0a12 100%);
}

.detail-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg-primary) 0%, transparent 60%);
}

/* Decorative circles */
.detail-bg .deco-circle {
  position: absolute; border-radius: 50%;
  filter: blur(80px);
}

.deco-circle-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(229,9,20,0.2), transparent);
  top: -100px; right: -100px;
}

.deco-circle-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(255,107,53,0.12), transparent);
  bottom: 100px; left: -80px;
}

/* Detail content */
.detail-content {
  position: relative; z-index: 2;
  width: 100%;
  padding: clamp(40px, 6vw, 80px) clamp(16px, 4vw, 48px);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
}

/* Poster in detail */
.detail-poster {
  width: clamp(160px, 20vw, 260px);
  aspect-ratio: 2/3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 40px var(--accent-glow);
  background: var(--bg-card);
  flex-shrink: 0;
  opacity: 0; animation: slideInLeft 0.7s 0.2s forwards;
}

.detail-poster img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Poster placeholder detail */
.detail-poster .poster-placeholder { height: 100%; }

/* Detail info */
.detail-info {
  opacity: 0; animation: fadeUp 0.7s 0.35s forwards;
}

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

.genre-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(229,9,20,0.12);
  border: 1px solid rgba(229,9,20,0.3);
  padding: 4px 12px; border-radius: 20px;
}

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 88px);
  line-height: 0.95; letter-spacing: 2px;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.detail-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
  margin-bottom: 24px;
  font-size: 14px; color: var(--text-secondary);
}

.detail-stats .stat-divider { color: var(--text-muted); }

.detail-rating-star { color: #ffd700; }

.detail-description {
  font-size: clamp(14px, 1.6vw, 16px);
  line-height: 1.8; color: var(--text-secondary);
  max-width: 640px; margin-bottom: 36px;
}

/* Buttons */
.detail-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn-watch {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 32px;
  background: var(--accent);
  color: #fff; font-family: var(--font-body);
  font-size: 15px; font-weight: 600;
  border: none; border-radius: var(--radius-btn);
  cursor: pointer; text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-watch:hover {
  background: #ff1a1a;
  box-shadow: 0 12px 36px rgba(229,9,20,0.5);
  transform: translateY(-2px);
}

.btn-trailer {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 28px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-body); font-size: 15px; font-weight: 500;
  border-radius: var(--radius-btn); cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
}

.btn-trailer:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--text-muted);
  transform: translateY(-2px);
}

/* Detail body section */
.detail-body {
  padding: 48px clamp(16px, 4vw, 48px) 80px;
  display: grid;
  grid-template-columns: 1fr clamp(220px, 28%, 320px);
  gap: 48px;
}

.detail-section-title {
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: 1px;
  color: var(--text-primary); margin-bottom: 16px;
}

.detail-cast {
  display: flex; flex-wrap: wrap; gap: 12px;
}

.cast-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 8px 16px;
  font-size: 13px; color: var(--text-secondary);
  transition: border-color var(--transition);
}

.cast-pill:hover { border-color: var(--accent); color: var(--text-primary); }

/* Info sidebar */
.detail-sidebar .info-row {
  display: flex; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-glass);
  font-size: 13px;
}

.detail-sidebar .info-label { color: var(--text-muted); }
.detail-sidebar .info-value { color: var(--text-secondary); font-weight: 500; text-align: right; }

/* Back button */
.btn-back {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-muted); font-size: 14px;
  text-decoration: none;
  padding: 10px 0;
  transition: color var(--transition);
}

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

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  padding: 40px clamp(16px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 22px; letter-spacing: 2px;
  color: var(--text-secondary);
}

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

.footer-text { font-size: 13px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cardReveal {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50%       { box-shadow: 0 0 0 10px transparent; }
}

/* Stagger card animations */
.movie-card:nth-child(1)  { animation-delay: 0.05s; }
.movie-card:nth-child(2)  { animation-delay: 0.10s; }
.movie-card:nth-child(3)  { animation-delay: 0.15s; }
.movie-card:nth-child(4)  { animation-delay: 0.20s; }
.movie-card:nth-child(5)  { animation-delay: 0.25s; }
.movie-card:nth-child(6)  { animation-delay: 0.30s; }
.movie-card:nth-child(7)  { animation-delay: 0.35s; }
.movie-card:nth-child(8)  { animation-delay: 0.40s; }
.movie-card:nth-child(9)  { animation-delay: 0.45s; }
.movie-card:nth-child(10) { animation-delay: 0.50s; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .nav-mobile-menu {
    display: none;
    position: fixed; inset: var(--navbar-h) 0 0 0;
    background: rgba(5,5,8,0.97);
    backdrop-filter: blur(24px);
    z-index: 999;
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 32px;
  }

  .nav-mobile-menu.open { display: flex; }

  .nav-mobile-menu a {
    font-family: var(--font-display);
    font-size: 36px; letter-spacing: 2px;
    color: var(--text-primary); text-decoration: none;
    transition: color var(--transition);
  }

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

  .detail-content {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .detail-poster {
    width: clamp(140px, 40vw, 200px);
    margin: 0 auto;
  }

  .detail-info { text-align: center; }
  .detail-genre-tags, .detail-stats, .detail-actions {
    justify-content: center;
  }

  .detail-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .movies-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hero h1 { font-size: 44px; }
}

@media (max-width: 380px) {
  .movies-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ── Glassmorphism Cards on Light Mode ────────────────────── */
body.light-mode .movie-card {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

body.light-mode .movie-card:hover {
  box-shadow: 0 12px 40px rgba(229,9,20,0.15), 0 4px 20px rgba(0,0,0,0.1);
}
