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

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #131a2a;
  --bg-card: #1c2538;
  --bg-glass: rgba(28, 37, 56, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-red: #e50914;
  --accent-red-hover: #ff1e27;
  --accent-purple: #8b5cf6;
  --accent-gold: #f59e0b;
  --accent-blue: #3b82f6;
  --border-color: rgba(255, 255, 255, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-family: 'Noto Sans KR', 'Outfit', -apple-system, sans-serif;
  --shadow-glow: 0 8px 32px rgba(229, 9, 20, 0.25);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #2a364f;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-red);
}

/* Header & Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.logo i {
  color: var(--accent-red);
  font-size: 1.8rem;
}

.logo span {
  background: linear-gradient(135deg, #fff 0%, var(--accent-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

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

.search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 15px rgba(229, 9, 20, 0.3);
  width: 320px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Hero Spotlight Section */
.hero-spotlight {
  position: relative;
  width: 100%;
  height: 480px;
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: flex-end;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-image 0.5s ease-in-out;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-primary) 0%, rgba(11, 15, 25, 0.6) 50%, rgba(11, 15, 25, 0.4) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 2.5rem;
  max-width: 850px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-red);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

.hero-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

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

.btn-hero {
  background: var(--accent-red);
  color: #fff;
  border: none;
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.4);
}

.btn-hero:hover {
  background: var(--accent-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(229, 9, 20, 0.6);
}

/* Main Layout */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem 2rem;
  width: 100%;
  flex: 1;
}

/* Filter Controls */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.genre-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}

.genre-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.chip:hover {
  border-color: var(--accent-red);
  color: var(--text-main);
}

.chip.active {
  background: rgba(229, 9, 20, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
  font-weight: 700;
}

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

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

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

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

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(229, 9, 20, 0.2);
  border-color: rgba(229, 9, 20, 0.4);
}

.card-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--bg-secondary);
}

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

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

.badge-dday {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, var(--accent-red) 0%, #b91c1c 100%);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  z-index: 2;
}

.badge-dday.released {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

.badge-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 2;
  border: 1px solid var(--border-color);
}

.bookmark-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  z-index: 2;
}

.bookmark-btn:hover, .bookmark-btn.active {
  color: var(--accent-red);
  background: rgba(229, 9, 20, 0.2);
  border-color: var(--accent-red);
}

.card-info {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.3;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}

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

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

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--accent-red);
}

.modal-header-bg {
  position: relative;
  height: 320px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
}

.modal-header-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--bg-secondary) 0%, rgba(19, 26, 42, 0.4) 100%);
}

.modal-body {
  padding: 2rem;
  position: relative;
  z-index: 2;
  margin-top: -80px;
  display: flex;
  gap: 2rem;
}

.modal-poster {
  width: 200px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  border: 2px solid var(--border-color);
}

.modal-poster img {
  width: 100%;
  display: block;
}

.modal-details {
  flex: 1;
}

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

.modal-original-title {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.modal-tag {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

.modal-overview {
  font-size: 1rem;
  line-height: 1.7;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

.trailer-box {
  margin-top: 1.5rem;
}

.trailer-box h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trailer-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}

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

/* Empty State / Loading State */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
  gap: 1rem;
  color: var(--text-muted);
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: #334155;
  margin-bottom: 1rem;
}

/* Calendar View */
.calendar-group {
  margin-bottom: 3rem;
}

.calendar-month-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-red);
  border-left: 4px solid var(--accent-red);
  padding-left: 0.8rem;
  margin-bottom: 1.5rem;
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: auto;
}

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

/* Responsive */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }
  .nav-tabs {
    overflow-x: auto;
    width: 100%;
  }
  .search-box {
    width: 100%;
  }
  .search-box input:focus {
    width: 100%;
  }
  .hero-spotlight {
    height: 380px;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .modal-body {
    flex-direction: column;
    margin-top: -40px;
  }
  .modal-poster {
    width: 140px;
  }
}
