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

:root {
  --bg: #0a0a0a;
  --bg2: #141414;
  --bg3: #1a1a1a;
  --bg4: #222;
  --accent: #e50914;
  --accent2: #ff1a25;
  --text: #fff;
  --text2: #999;
  --text3: #555;
  --transition: cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; cursor: pointer; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 0; height: 0; }

/* ===== NAVBAR ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 60px; height: 68px;
  background: transparent;
  z-index: 100;
  transition: background 0.4s;
}
.navbar.scrolled { background: rgba(10,10,10,0.97); }

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

.logo {
  font-size: 1.3rem; font-weight: 900; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
}
.logo span { color: #fff; }

.nav-links { display: flex; gap: 24px; }
.nav-link {
  font-size: 0.88rem; font-weight: 500; color: #bbb;
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: #fff; }

.nav-center { flex: 1; max-width: 400px; margin: 0 40px; position: relative; }

.search-box {
  display: flex; align-items: center;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px; padding: 0 14px; width: 100%;
  transition: all 0.3s;
}
.search-box:focus-within {
  background: rgba(0,0,0,0.85);
  border-color: #fff;
}
.search-box i { color: #888; font-size: 0.85rem; margin-right: 10px; }
.search-box input {
  flex: 1; background: none; border: none; color: #fff;
  padding: 10px 0; font-size: 0.88rem; outline: none;
}
.search-box input::placeholder { color: #666; }
.search-box kbd {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  color: #666; padding: 2px 6px; border-radius: 3px;
  font-size: 0.7rem; font-family: inherit;
}

/* ===== SEARCH DROPDOWN ===== */
.search-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #1a1a1a; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px; max-height: 400px; overflow-y: auto;
  display: none; z-index: 110;
  box-shadow: 0 12px 40px rgba(0,0,0,0.8);
}
.search-dropdown.active { display: block; }

.s-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.s-item:last-child { border: none; }
.s-item:hover { background: rgba(255,255,255,0.06); }

.s-item img {
  width: 36px; height: 54px; border-radius: 3px;
  object-fit: cover; flex-shrink: 0; background: #222;
}
.s-item-info { flex: 1; min-width: 0; }
.s-item-title {
  font-size: 0.88rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-item-meta { font-size: 0.78rem; color: #888; display: flex; gap: 10px; align-items: center; }
.s-item-meta .star { color: #e5a100; }
.s-empty { padding: 28px; text-align: center; color: #555; font-size: 0.85rem; }

/* ===== HERO ===== */
.hero {
  height: 85vh; min-height: 500px; max-height: 750px;
  position: relative;
  display: flex; align-items: flex-end;
  padding: 0 60px 120px;
  background: #000;
}

.hero-fade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(10,10,10,1) 0%, rgba(10,10,10,0.8) 25%, rgba(10,10,10,0.2) 50%, transparent 70%),
    linear-gradient(to top, var(--bg) 0%, rgba(10,10,10,0.4) 40%, transparent 60%),
    linear-gradient(to bottom, rgba(10,10,10,0.6) 0%, transparent 30%);
  z-index: 1;
}

.hero-content {
  position: relative; z-index: 2; max-width: 550px;
  animation: fadeUp 0.6s var(--transition);
}

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

.hero-badge {
  display: inline-block;
  color: #999; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 3.2rem; font-weight: 900;
  line-height: 1.05; letter-spacing: -1px;
  margin-bottom: 14px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.hero-desc {
  font-size: 0.92rem; color: #bbb;
  line-height: 1.65; margin-bottom: 18px;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.hero-meta {
  display: flex; gap: 16px; margin-bottom: 24px;
  font-size: 0.85rem; color: #999; align-items: center;
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }
.hero-meta .rating { color: #46d369; font-weight: 700; }
.hero-meta .muted { color: #666; }

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

.btn-play {
  background: #fff; color: #000;
  padding: 10px 28px; border-radius: 4px;
  font-size: 0.9rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.2s;
  border: none; cursor: pointer;
}
.btn-play:hover { background: rgba(255,255,255,0.8); }
.btn-play i { font-size: 1.1rem; }

.btn-info {
  background: rgba(109,109,110,0.7);
  color: #fff; padding: 10px 28px; border-radius: 4px;
  font-size: 0.9rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background 0.2s;
  border: none; cursor: pointer;
}
.btn-info:hover { background: rgba(109,109,110,0.5); }

/* ===== ROW SECTION ===== */
.row-section {
  padding: 0 60px;
  margin-top: 20px;
  position: relative;
  z-index: 3;
}

.row-section:first-of-type {
  margin-top: -60px;
}

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

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

.row-arrows { display: flex; gap: 6px; }

.row-arrow {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}
.row-arrow:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.3); }

.movie-row {
  display: flex; gap: 5px; overflow-x: auto;
  padding: 8px 0 24px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.movie-row::-webkit-scrollbar { display: none; }

/* ===== MOVIE CARD ===== */
.movie-card {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  width: calc((100vw - 120px - 40px) / 9);
  transition: transform 0.25s var(--transition), box-shadow 0.25s;
  background: var(--bg3);
}

.movie-card img {
  width: 100%; aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
}

.poster-ph {
  width: 100%; aspect-ratio: 2/3;
  background: #1a1a1a;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #333;
}

.card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
  padding: 40px 12px 12px;
  opacity: 0;
  transition: opacity 0.3s;
}
.movie-card:hover .card-overlay { opacity: 1; }
.movie-card:hover { transform: scale(1.08); z-index: 5; box-shadow: 0 8px 30px rgba(0,0,0,0.8); }

.card-title {
  font-size: 0.82rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.card-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.75rem; color: #999;
}
.card-meta .star { color: #46d369; font-weight: 600; }
.card-meta .year { color: #666; }

/* ===== GENRE SECTION ===== */
.genre-section {
  padding: 40px 60px;
  margin-top: -40px;
  position: relative;
  z-index: 3;
}

.genre-header { margin-bottom: 20px; }

.genre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.genre-grid .movie-card {
  width: 100%;
}

/* ===== LOADING ===== */
.loading { text-align: center; padding: 40px; width: 100%; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid #222; border-top-color: #e50914;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state { text-align: center; padding: 60px; color: #555; }

/* ===== FOOTER ===== */
footer {
  padding: 60px;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 40px;
}
.footer-content { text-align: center; }
.footer-logo {
  font-size: 1.1rem; font-weight: 900; letter-spacing: 2px;
  color: var(--accent); text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-logo span { color: #fff; }
footer p { color: #555; font-size: 0.8rem; margin-bottom: 4px; }
.footer-sub { color: #444 !important; font-size: 0.72rem !important; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1a1a1a; color: #fff;
  padding: 14px 24px; border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  border-left: 3px solid var(--accent);
  z-index: 300;
  font-size: 0.88rem; font-weight: 500;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
}
@keyframes toastIn { from { transform: translateY(20px); opacity: 0; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .movie-card { width: calc((100vw - 120px - 35px) / 9); }
}
@media (max-width: 900px) {
  .navbar { padding: 0 24px; }
  .nav-links { display: none; }
  .hero { padding: 0 24px 100px; }
  .hero-title { font-size: 2.2rem; }
  .row-section { padding: 0 24px; }
  .genre-section { padding: 30px 24px; margin-top: -20px; }
  .movie-card { width: calc((100vw - 48px - 25px) / 5); }
  .row-arrow { width: 32px; height: 32px; font-size: 0.75rem; }
  footer { padding: 40px 24px; }
}
@media (max-width: 640px) {
  .navbar { padding: 0 16px; height: 56px; }
  .nav-center { margin: 0 16px; max-width: none; }
  .search-box kbd { display: none; }
  .hero { height: 70vh; padding: 0 16px 80px; }
  .hero-title { font-size: 1.8rem; }
  .hero-desc { font-size: 0.82rem; }
  .hero-actions { flex-direction: column; gap: 8px; }
  .btn-play, .btn-info { padding: 10px 20px; font-size: 0.85rem; width: 100%; justify-content: center; }
  .row-section { padding: 0 16px; margin-top: 10px; }
  .row-section:first-of-type { margin-top: -40px; }
  .row-title { font-size: 1rem; }
  .row-arrow { width: 28px; height: 28px; font-size: 0.7rem; }
  .movie-card { width: calc((100vw - 32px - 10px) / 3); }
  .genre-section { padding: 24px 16px; }
  .genre-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  footer { padding: 30px 16px; }
}
