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

:root {
  --bg: #0a0a0f;
  --bg-card: #141420;
  --bg-card-hover: #1a1a2e;
  --bg-surface: #1e1e30;
  --text: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #555570;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --green: #00d68f;
  --orange: #f0932b;
  --red: #ff6b6b;
  --border: #2a2a40;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

html { font-size: 15px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === Header === */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px);

}

.header-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  -webkit-text-fill-color: initial;
}

/* === City Selector === */
.city-selector { position: relative; }

.city-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s;
}

.city-btn:hover { border-color: var(--accent); }

@keyframes pulseBtn {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 0 8px transparent; border-color: var(--accent); }
}
.city-btn-highlight {
  animation: pulseBtn 1s ease 3;
  border-color: var(--accent);
}

.city-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
}

.city-dropdown.open { display: block; }

.city-dropdown input {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;

  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.city-dropdown input::placeholder { color: var(--text-muted); }

.city-list { list-style: none; }

.city-list li {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.city-list li:hover { background: var(--bg-card-hover); }

.city-list li.active {
  color: var(--accent-light);
  background: rgba(108, 92, 231, 0.1);
}

.city-list .cinema-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === Date Bar === */
.date-bar {
  position: sticky;
  top: 54px;
  z-index: 90;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px);

}

.date-scroll {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.date-scroll::-webkit-scrollbar { display: none; }

.date-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 64px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  transition: all 0.2s;
}

.date-item:hover { background: var(--bg-surface); }

.date-item.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.date-item.today { border-color: var(--accent); }

.date-day {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-num {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2px;
}

.date-month {
  font-size: 0.65rem;
  margin-top: 1px;
  opacity: 0.7;
}

/* === Movie Selector Bar === */
.movie-bar {
  background: var(--bg);

}

.movie-scroll {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.movie-scroll::-webkit-scrollbar { display: none; }

.movie-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
}

.movie-chip:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.movie-chip.active {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent-light);
  box-shadow: 0 2px 12px var(--accent-glow);
}

.movie-chip-poster {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.movie-chip-all {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s;
  font-family: inherit;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.movie-chip-all:hover { border-color: var(--accent); }

.movie-chip-all.active {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent-light);
}

/* === Main Content === */
.main {
  max-width: 100%;
  margin: 0 auto;
  padding: 16px;
}

/* === Loading === */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  gap: 16px;
  color: var(--text-secondary);
}

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

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

/* === Cinema Card === */
.cinema-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.cinema-card:hover { border-color: rgba(108, 92, 231, 0.3); }

.cinema-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  cursor: pointer;
  user-select: none;
}

.cinema-info { flex: 1; }

.cinema-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.cinema-brand {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.cinema-brand.cgv { background: #c0392b20; color: #e74c3c; }
.cinema-brand.galaxy { background: #f39c1220; color: #f39c12; }
.cinema-brand.lotte { background: #e74c3c20; color: #ff6b6b; }
.cinema-brand.bhd { background: #2ecc7120; color: #2ecc71; }
.cinema-brand.cinestar { background: #3498db20; color: #3498db; }
.cinema-brand.mega { background: #9b59b620; color: #9b59b6; }
.cinema-brand.dcine { background: #e67e2220; color: #e67e22; }
.cinema-brand.beta { background: #1abc9c20; color: #1abc9c; }
.cinema-brand.default { background: #6c5ce720; color: #a29bfe; }

.cinema-address {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.cinema-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-surface);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.cinema-toggle.open { transform: rotate(180deg); }

.cinema-body {
  display: none;

}

.cinema-body.open { display: block; }

/* === Movie Item === */
.movie-item {
  padding: 16px;

}

.movie-item:last-child { border-bottom: none; }

.movie-top {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.movie-poster {
  width: 56px;
  height: 80px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.movie-details { flex: 1; min-width: 0; }

.movie-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.movie-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.movie-meta span {
  display: inline-block;
  margin-right: 8px;
}

.movie-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--orange);
}

/* === Showtime Format Group === */
.format-group { margin-bottom: 10px; }

.format-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.showtime-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.showtime-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.showtime-btn:hover {
  border-color: var(--accent);
  background: rgba(108, 92, 231, 0.1);
  color: var(--accent-light);
}

.showtime-btn.bookable {
  border-color: rgba(0, 214, 143, 0.3);
}

.showtime-btn.bookable:hover {
  border-color: var(--green);
  background: rgba(0, 214, 143, 0.1);
  color: var(--green);
}

.showtime-btn.past {
  opacity: 0.35;
  pointer-events: none;
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.85rem;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === No movies message === */
.no-movies {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* === Movie count badge === */
.movie-count {
  font-size: 0.75rem;
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* === Responsive === */
@media (max-width: 480px) {
  html { font-size: 14px; }
  .header-content { padding: 10px 12px; }
  .main { padding: 12px; }
  .cinema-header { padding: 14px 12px; }
  .movie-item { padding: 14px 12px; }
  .date-item { min-width: 56px; padding: 6px 12px; }
  .movie-scroll { padding: 10px 12px; gap: 8px; }
  .movie-hero-poster { width: 64px; height: 90px; }
}

/* === Movie Hero (when movie is selected) === */
.movie-hero {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.movie-hero-inner {
  display: flex;
  gap: 16px;
  padding: 16px;
}

.movie-hero-poster {
  width: 80px;
  height: 112px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.movie-hero-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.movie-hero-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.movie-hero-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.movie-hero-stats {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-light);
}

/* === Footer === */
.footer {

  margin-top: 0;
  padding: 8px 16px 16px;
}

.footer-content {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

.footer-credit {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.footer-links a {
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
  display: flex;
}

.footer-links a:hover {
  color: var(--accent-light);
  transform: scale(1.15);
}

/* === Location Dialog === */
.loc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.loc-overlay.show { display: flex; }

.loc-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.loc-icon { margin-bottom: 12px; }

.loc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.loc-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

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

.loc-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
}

.loc-btn:active { opacity: 0.7; }

.loc-allow {
  background: var(--accent);
  color: white;
}

.loc-skip {
  background: var(--bg-surface);
  color: var(--text-secondary);
}

/* === Toast === */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface);
  color: var(--accent-light);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === Skeleton loading === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-surface) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

.skeleton-card {
  height: 80px;
  margin-bottom: 12px;
  border-radius: var(--radius);
}
