@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.9);
  --bg-modal: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1;
  --accent-secondary: #a855f7;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --accent-danger: #f43f5e;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.3);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-main: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Noto Sans KR', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 85% 60%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-glow);
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 30%, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.3);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: 4px;
}

.search-container {
  position: relative;
  width: 320px;
  max-width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition-fast);
  outline: none;
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

/* Hero Spotlight Section */
.hero-section {
  position: relative;
  width: 100%;
  height: 480px;
  margin-bottom: 2.5rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
}

.hero-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center 20%;
  filter: brightness(0.7);
  transition: opacity 0.8s ease-in-out;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg, 
    rgba(9, 13, 22, 0.95) 0%, 
    rgba(9, 13, 22, 0.75) 45%, 
    rgba(9, 13, 22, 0.4) 100%
  ),
  linear-gradient(
    0deg,
    rgba(9, 13, 22, 1) 0%,
    transparent 50%
  );
  display: flex;
  align-items: center;
  padding: 0 3rem;
}

.hero-content {
  max-width: 680px;
  z-index: 2;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 0.8rem;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.hero-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rating-star {
  color: #f59e0b;
}

.hero-overview {
  font-size: 0.95rem;
  color: #cbd5e1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: var(--transition-fast);
}

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

/* Main Layout & Controls */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem 2rem;
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.tab-btn {
  padding: 0.6rem 1.3rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.select-custom {
  appearance: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 2.2rem 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
  transition: var(--transition-fast);
}

.select-custom:focus, .select-custom:hover {
  border-color: var(--accent-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

.select-custom option {
  background-color: var(--bg-modal);
  color: var(--text-primary);
}

/* Genre Pills horizontal scroller */
.genres-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.8rem;
  margin-bottom: 2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.genre-pill {
  padding: 0.4rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition-fast);
}

.genre-pill:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.genre-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent-primary);
  color: #a5b4fc;
  font-weight: 700;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-secondary);
}

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

/* Movie Card */
.movie-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition-normal);
  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-highlight);
  box-shadow: var(--shadow-main), var(--shadow-glow);
}

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

.poster-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

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

.badge-dday.urgent {
  background: linear-gradient(135deg, #ef4444, #f43f5e);
  color: #ffffff;
}

.badge-dday.today {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  animation: pulse-glow 1.5s infinite alternate;
}

.badge-dday.upcoming {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #818cf8;
}

.badge-dday.playing {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.badge-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fbcfe8;
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-content {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

.card-date {
  font-weight: 500;
  color: var(--text-secondary);
}

/* Load More / Pagination */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.btn-load-more {
  padding: 0.85rem 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-load-more:hover {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-color: transparent;
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: var(--bg-modal);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 10;
  width: 38px;
  height: 38px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--accent-danger);
  border-color: transparent;
  transform: rotate(90deg);
}

.modal-hero {
  position: relative;
  height: 320px;
  background-size: cover;
  background-position: center;
}

.modal-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-modal) 0%, rgba(15, 23, 42, 0.4) 100%);
}

.modal-body {
  padding: 0 2.2rem 2.5rem 2.2rem;
  margin-top: -80px;
  position: relative;
  z-index: 2;
}

.modal-header-content {
  display: flex;
  gap: 1.8rem;
  margin-bottom: 2rem;
}

.modal-poster {
  width: 170px;
  height: 255px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 15px 30px rgba(0,0,0,0.8);
  border: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.modal-details {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.modal-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.modal-tagline {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.modal-genre-tag {
  padding: 3px 10px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.modal-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.8rem 0 0.8rem 0;
  color: #e2e8f0;
  border-left: 3px solid var(--accent-primary);
  padding-left: 0.6rem;
}

.modal-overview {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.7;
}

/* Video Player Box */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
}

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

/* Cast Avatars */
.cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.cast-card {
  text-align: center;
}

.cast-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.5rem auto;
  border: 2px solid var(--border-color);
  background: #1e293b;
}

.cast-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: rgba(9, 13, 22, 0.9);
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

/* Keyframes */
@keyframes pulse-glow {
  0% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.4); }
  100% { box-shadow: 0 0 18px rgba(245, 158, 11, 0.9); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navbar {
    padding: 0.8rem 1rem;
  }
  .search-container {
    width: 100%;
    margin-top: 0.5rem;
  }
  .hero-section {
    height: 380px;
  }
  .hero-overlay {
    padding: 0 1.2rem;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .modal-header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .modal-body {
    padding: 0 1.2rem 1.5rem 1.2rem;
    margin-top: -120px;
  }
  .modal-badges {
    justify-content: center;
  }
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-tabs {
    overflow-x: auto;
  }
}
