/* ============================================
   KeizaCinema - Cinema Blue Theme
   ============================================ */

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

:root {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-dark: #1e40af;
  --accent: #0ea5e9;
  --bg: #0a0e1a;
  --bg-elev: #0f172a;
  --bg-card: #111827;
  --border: #1e293b;
  --text: #f1f5f9;
  --text-dim: #94a3b8;
  --star: #fbbf24;
  --success: #10b981;
  --danger: #ef4444;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: 70px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

img {
  user-select: none;
  -webkit-user-drag: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-elev);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* ==================== NAVBAR ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.nav-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.nav-logo i {
  margin-right: 8px;
  -webkit-text-fill-color: var(--primary);
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
  font-weight: 500;
}
.nav-links li {
  cursor: pointer;
  padding: 6px 0;
  border-bottom: 3px solid transparent;
  transition: 0.2s;
  font-size: 0.95rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.nav-links li i {
  margin-right: 6px;
}
.nav-links li.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}
.nav-links li:hover {
  color: var(--primary-hover);
}
.nav-search {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-search input {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--text);
  font-size: 0.9rem;
  width: 200px;
  transition: 0.3s;
  outline: none;
}
.nav-search input:focus {
  border-color: var(--primary);
  width: 240px;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.nav-search input::placeholder {
  color: var(--text-dim);
}
.nav-search button {
  background: var(--primary);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-search button:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}
.nav-hamburger {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  background: transparent;
  border: none;
}

/* ==================== HERO ==================== */
.hero-section {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 400px;
  max-height: 700px;
  overflow: hidden;
  margin-bottom: 30px;
}
.hero-slider {
  display: flex;
  height: 100%;
  transition: transform 0.6s ease;
}
.hero-slide {
  flex: 0 0 100%;
  height: 100%;
  background-size: cover;
  background-position: center top;
  background-color: var(--bg-elev);
  display: flex;
  align-items: flex-end;
  padding: 40px 60px;
  position: relative;
  cursor: pointer;
}
.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(10, 14, 26, 0.95) 0%,
    rgba(10, 14, 26, 0.5) 40%,
    transparent 100%
  );
  pointer-events: none;
}
.hero-info {
  position: relative;
  z-index: 2;
  max-width: 600px;
}
.hero-info h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  line-height: 1.1;
}
.hero-info p {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.hero-info .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.9rem;
  color: #cbd5e1;
}
.hero-info .meta span i {
  margin-right: 5px;
  color: var(--primary);
}
.hero-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}
.hero-indicators span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: 0.3s;
}
.hero-indicators span.active {
  background: var(--primary);
  width: 30px;
  border-radius: 8px;
}

/* ==================== ROWS ==================== */
.rows-container {
  padding: 0 20px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.row {
  margin-bottom: 40px;
}
.row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.row-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}
.row-header h2 i {
  color: var(--primary);
  margin-right: 10px;
}
.row-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 6px 2px 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
}
.row-scroll::-webkit-scrollbar {
  height: 6px;
}
.row-scroll::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 8px;
}

/* ==================== MOVIE CARD ==================== */
.movie-card {
  flex: 0 0 200px;
  cursor: pointer;
  transition:
    transform 0.25s,
    box-shadow 0.25s,
    border-color 0.25s;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid transparent;
}
.movie-card:hover {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.35);
}
.movie-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: var(--bg-elev);
}
.movie-card .card-info {
  padding: 10px 12px;
}
.movie-card .card-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.movie-card .card-info .card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.movie-card .card-info .card-meta .rating i {
  color: var(--star);
  margin-right: 3px;
}

/* ==================== SEARCH RESULTS ==================== */
.search-results {
  padding: 20px 20px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.section-title {
  font-size: 1.6rem;
  margin-bottom: 20px;
}
.section-title i {
  color: var(--primary);
  margin-right: 12px;
}
.section-title span {
  color: var(--primary-hover);
}
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}
.back-home-btn {
  margin-top: 30px;
  background: var(--primary);
  border: none;
  padding: 12px 28px;
  border-radius: 30px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 500;
}
.back-home-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}
.back-home-btn i {
  margin-right: 6px;
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
.modal-content {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 3;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.modal-body {
  margin-top: 10px;
  overflow: hidden;
}
.modal-body::after {
  content: "";
  display: table;
  clear: both;
}
.modal-body .detail-poster {
  float: left;
  margin-right: 24px;
  margin-bottom: 16px;
  width: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.modal-body .detail-poster img {
  width: 100%;
  display: block;
}
.modal-body .detail-title {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}
.modal-body .detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 10px 0 14px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.modal-body .detail-meta span i {
  margin-right: 5px;
  color: var(--primary);
}
.modal-body .detail-overview {
  margin: 16px 0;
  line-height: 1.6;
  color: #cbd5e1;
  font-size: 0.95rem;
}
.modal-body .detail-cast {
  margin: 16px 0;
}
.modal-body .detail-cast h4 {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 1rem;
}
.modal-body .detail-cast .cast-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.modal-body .detail-streams {
  margin: 20px 0 0;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 16px;
  border-radius: 12px;
}
.modal-body .detail-streams h4 {
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 1rem;
}
.modal-body .detail-streams h4 i {
  margin-right: 6px;
}
.modal-body .detail-streams a {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 6px 16px;
  border-radius: 30px;
  margin: 4px 8px 4px 0;
  font-size: 0.82rem;
  transition: 0.2s;
}
.modal-body .detail-streams a:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(59, 130, 246, 0.4);
}
.modal-body .detail-seasons {
  margin-top: 24px;
}
.modal-body .detail-seasons h4 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1rem;
}
.modal-body .detail-seasons .season-block {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.modal-body .detail-seasons .season-block h5 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--primary-hover);
}
.modal-body .detail-seasons .episode-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  gap: 12px;
}
.modal-body .detail-seasons .episode-item:last-child {
  border-bottom: none;
}
.modal-body .detail-seasons .episode-item .ep-info {
  display: flex;
  gap: 10px;
  color: var(--text-dim);
  flex: 1;
  min-width: 0;
}
.modal-body .detail-seasons .episode-item .ep-info span {
  color: var(--primary);
  font-weight: 600;
}
.modal-body .detail-seasons .episode-item .ep-streams {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.modal-body .detail-seasons .episode-item .ep-streams a {
  font-size: 0.7rem;
  padding: 3px 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  transition: 0.2s;
}
.modal-body .detail-seasons .episode-item .ep-streams a:hover {
  background: var(--primary-hover);
}

/* ==================== LOADING ==================== */
.loading-spinner {
  display: none;
  text-align: center;
  padding: 60px 0;
}
.loading-spinner.show {
  display: block;
}
.spinner {
  border: 5px solid var(--bg-elev);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-spinner p {
  color: var(--text-dim);
}

/* ==================== FOOTER ==================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.footer-sep {
  margin: 0 12px;
  opacity: 0.5;
}
.footer-disclaimer {
  font-size: 0.78rem;
  margin-top: 6px;
  opacity: 0.6;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .nav-links {
    display: none;
    flex-direction: column;
    background: var(--bg-elev);
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    gap: 14px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-hamburger {
    display: block;
  }
  .nav-search input {
    width: 130px;
  }
  .nav-search input:focus {
    width: 160px;
  }
  .hero-slide {
    padding: 24px;
  }
  .hero-info h1 {
    font-size: 2rem;
  }
  .hero-info p {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  .modal-content {
    padding: 20px;
  }
  .modal-body .detail-poster {
    float: none;
    margin: 0 0 16px 0;
    width: 140px;
  }
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .movie-card {
    flex: 0 0 150px;
  }
}

@media (max-width: 500px) {
  .nav-logo {
    font-size: 1.2rem;
  }
  .nav-search input {
    width: 100px;
    padding: 6px 12px;
  }
  .nav-search input:focus {
    width: 130px;
  }
  .nav-search button {
    width: 32px;
    height: 32px;
  }
  .hero-section {
    height: 55vh;
  }
  .hero-info h1 {
    font-size: 1.6rem;
  }
  .row-header h2 {
    font-size: 1.2rem;
  }
}
