/* ==========================================================================
   TMDB Cinema Platform - Cinematic Dark Aesthetic Design System
   ========================================================================== */

:root {
  --bg-main: #07090e;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(15, 23, 42, 0.75);
  --bg-modal: #0d121f;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent-cyan: #06b6d4;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  --accent-purple: #a855f7;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-glow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 70%, rgba(236, 72, 153, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #07090e;
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  transition: var(--transition);
}

.site-header.scrolled {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  background: rgba(7, 9, 14, 0.95);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 20px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  color: #fff;
  font-weight: 900;
  font-size: 1.25rem;
}

.logo-text h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text span {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
  letter-spacing: 1px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.nav-tab .badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Search & Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box-wrapper {
  position: relative;
  width: 260px;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  width: 320px;
  background: rgba(15, 23, 42, 0.95);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: none;
  padding: 2px;
}

.search-clear-btn:hover {
  color: #fff;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}

.btn-roulette {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.btn-roulette:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.btn-home-portal {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
}

.btn-home-portal:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ==========================================================================
   Hero Featured Section
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 520px;
  margin-top: 20px;
  margin-bottom: 40px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-glass);
}

.hero-slider {
  position: relative;
  width: 100%;
  height: 520px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  display: flex;
  align-items: center;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  filter: brightness(0.65);
  transform: scale(1.02);
  transition: transform 6s ease;
}

.hero-slide.active .hero-bg {
  transform: scale(1.08);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 9, 14, 0.95) 0%, rgba(7, 9, 14, 0.7) 45%, rgba(7, 9, 14, 0.1) 100%),
              linear-gradient(0deg, rgba(7, 9, 14, 0.95) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  padding: 40px 60px;
}

.hero-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-trending {
  background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.4);
}

.tag-rating {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.tag-dday {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #fff;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 16px;
  letter-spacing: -1px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.hero-overview {
  color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 28px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-btns {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
  transition: var(--transition);
}

.btn-hero-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
}

.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition);
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.hero-nav {
  position: absolute;
  bottom: 24px;
  right: 40px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.hero-dot.active {
  width: 32px;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

/* ==========================================================================
   Filter & Toolbar Section
   ========================================================================== */
.toolbar-section {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  padding: 18px 24px;
  margin-bottom: 30px;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.genre-chips-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.genre-chips-container::-webkit-scrollbar {
  display: none;
}

.genre-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.genre-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.genre-chip.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 600;
}

.select-custom {
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-custom:focus {
  border-color: var(--primary);
}

.country-toggle {
  display: flex;
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border-glass);
}

.country-btn {
  padding: 4px 10px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.country-btn.active {
  background: var(--primary);
  color: #fff;
}

/* ==========================================================================
   Section Headers & Grid
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.section-title i {
  color: var(--primary);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.results-count {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Movies Grid */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

/* Movie Card */
.movie-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.movie-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: 0 16px 35px -8px rgba(0, 0, 0, 0.7), 0 0 20px rgba(99, 102, 241, 0.25);
}

.card-poster-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #1e293b;
}

.card-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.movie-card:hover .card-poster {
  transform: scale(1.06);
}

.poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: var(--text-dim);
  text-align: center;
  padding: 16px;
}

/* Badges on Poster */
.card-dday-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.badge-today {
  background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  color: #fff;
  animation: pulseGlow 2s infinite;
}

.badge-dday {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #fff;
}

.badge-playing {
  background: rgba(16, 185, 129, 0.85);
  color: #fff;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(244, 63, 94, 0.6); }
  50% { box-shadow: 0 0 20px rgba(244, 63, 94, 0.9); }
}

.card-rating-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-bookmark-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.card-bookmark-btn:hover {
  transform: scale(1.15);
  background: #f43f5e;
  border-color: #f43f5e;
}

.card-bookmark-btn.bookmarked {
  background: #f43f5e;
  color: #fff;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.5);
}

.card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-genres {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.card-release-date {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Pagination & Load More
   ========================================================================== */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 60px;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid var(--border-glass);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-load-more:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

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

/* ==========================================================================
   Release Calendar View (개봉일 캘린더)
   ========================================================================== */
.calendar-view-container {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  padding: 30px;
  margin-bottom: 60px;
}

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

.calendar-month-selector {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-month-title {
  font-size: 1.5rem;
  font-weight: 800;
}

.btn-month-nav {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

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

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-weekday {
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dim);
  padding: 10px 0;
}

.calendar-weekday.sun { color: #f43f5e; }
.calendar-weekday.sat { color: #38bdf8; }

.calendar-day-cell {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  min-height: 120px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  cursor: pointer;
}

.calendar-day-cell:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: var(--border-glow);
}

.calendar-day-cell.other-month {
  opacity: 0.3;
  pointer-events: none;
}

.calendar-day-cell.today {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.15);
}

.day-cell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.day-number {
  font-size: 0.85rem;
  font-weight: 700;
}

.day-movie-count {
  font-size: 0.7rem;
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: 99px;
  font-weight: 700;
}

.day-movies-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 90px;
}

.day-movie-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}

.day-movie-pill:hover {
  background: var(--primary);
  color: #fff;
}

.day-movie-pill img {
  width: 14px;
  height: 20px;
  object-fit: cover;
  border-radius: 2px;
}

/* ==========================================================================
   Modals (Detail, Trailer, Roulette)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-modal);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(30px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-glass);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: #f43f5e;
  transform: rotate(90deg);
}

/* Detail Modal Hero */
.detail-hero-banner {
  position: relative;
  height: 380px;
  background-size: cover;
  background-position: center;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-modal) 0%, rgba(13, 18, 31, 0.6) 60%, rgba(13, 18, 31, 0.2) 100%);
}

.detail-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 40px;
  display: flex;
  gap: 28px;
  align-items: flex-end;
}

.detail-poster-wrapper {
  width: 170px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

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

.detail-header-info {
  flex-grow: 1;
}

.detail-title {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.detail-tagline {
  color: var(--accent-cyan);
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 12px;
}

.detail-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.certification-tag {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 800;
  color: #fff;
}
.cert-all { background: #10b981; }
.cert-12  { background: #3b82f6; }
.cert-15  { background: #f59e0b; }
.cert-18  { background: #ef4444; }

/* Detail Body */
.detail-body {
  padding: 30px 40px 40px;
}

.detail-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-overview {
  color: #cbd5e1;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 30px;
}

.detail-actions-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.btn-trailer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #f43f5e 0%, #ec4899 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.4);
  transition: var(--transition);
}

.btn-trailer:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(244, 63, 94, 0.6);
}

.btn-bookmark-modal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-bookmark-modal:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ticket-links-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.ticket-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  transition: var(--transition);
}

.ticket-cgv { background: #e71a0f; }
.ticket-lotte { background: #ed1c24; }
.ticket-mega { background: #3b2576; }
.ticket-naver { background: #03c75a; }

.ticket-link:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

/* Cast Grid */
.cast-slider {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 30px;
  scrollbar-width: thin;
}

.cast-card {
  width: 110px;
  flex-shrink: 0;
  text-align: center;
}

.cast-avatar-wrapper {
  width: 90px;
  height: 90px;
  margin: 0 auto 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: #1e293b;
  border: 2px solid var(--border-glass);
}

.cast-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cast-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-character {
  font-size: 0.74rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Trailer Video Modal */
.trailer-modal-dialog {
  max-width: 900px;
  background: #000;
  padding: 0;
  overflow: hidden;
}

.video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Roulette Modal */
.roulette-dialog {
  max-width: 480px;
  text-align: center;
  padding: 40px 30px;
}

.roulette-wheel-container {
  margin: 20px auto 30px;
  width: 160px;
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.roulette-icon-spin {
  font-size: 4rem;
  color: #f59e0b;
  animation: rouletteSpin 2s cubic-bezier(0.1, 0.8, 0.2, 1);
}

@keyframes rouletteSpin {
  0% { transform: rotate(0deg) scale(0.8); }
  50% { transform: rotate(1080deg) scale(1.2); }
  100% { transform: rotate(1800deg) scale(1); }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: rgba(7, 9, 14, 0.95);
  border-top: 1px solid var(--border-glass);
  padding: 50px 0 30px;
  margin-top: 80px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 30px;
}

.tmdb-attribution {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tmdb-logo-img {
  height: 24px;
}

.tmdb-notice {
  font-size: 0.82rem;
  color: var(--text-dim);
  max-width: 500px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-link:hover {
  color: #fff;
}

.footer-copy {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
}

/* Floating Actions */
.floating-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.floating-top-btn.show {
  opacity: 1;
  visibility: visible;
}

.floating-top-btn:hover {
  background: var(--primary);
  transform: translateY(-4px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glow);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlideUp 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
}

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

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

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-title { font-size: 2.2rem; }
  .hero-content { padding: 30px; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 768px) {
  .header-inner { height: auto; padding: 14px 0; flex-wrap: wrap; }
  .nav-tabs { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; }
  .search-box-wrapper { width: 100%; order: 2; margin: 10px 0; }
  .search-input:focus { width: 100%; }
  
  .hero-section { min-height: 440px; }
  .hero-slider { height: 440px; }
  .hero-title { font-size: 1.8rem; }
  .hero-overview { -webkit-line-clamp: 2; font-size: 0.9rem; }
  .hero-content { padding: 20px; }
  
  .movie-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  
  .detail-hero-content { flex-direction: column; align-items: center; text-align: center; }
  .detail-poster-wrapper { width: 130px; }
  .ticket-links-group { margin-left: 0; width: 100%; justify-content: center; }
  .detail-actions-bar { justify-content: center; }

  .calendar-grid { gap: 4px; }
  .calendar-day-cell { min-height: 80px; padding: 4px; }
  .day-movie-pill { font-size: 0.65rem; }
}
