/* ============================================================
   TICKETHELL — Base Design System
   Inspired by real Korean ticketing sites (Melon Ticket / Interpark)
   ============================================================ */

:root {
  --th-red: #e8002d;
  --th-red-dark: #c0002a;
  --th-black: #111111;
  --th-dark: #1a1a1a;
  --th-gray-dark: #333333;
  --th-gray: #666666;
  --th-gray-mid: #999999;
  --th-gray-light: #cccccc;
  --th-gray-bg: #f5f5f5;
  --th-white: #ffffff;
  --th-blue: #0060c0;
  --th-green: #00a651;
  --th-yellow: #ffcc00;

  /* Seat colors */
  --seat-vip: #8b1cf7;
  --seat-r: #e8002d;
  --seat-s: #0060c0;
  --seat-a: #009944;
  --seat-occupied: #d0d0d0;
  --seat-available: #00c851;
  --seat-selected: #ff6b00;

  --font-base: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.12);
  --shadow-md: 0 4px 12px rgba(0,0,0,.15);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.2);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --transition: 0.15s ease;
}

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

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-base);
  background: var(--th-gray-bg);
  color: var(--th-black);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Global Header ─────────────────────────────────────────── */
.site-header {
  background: var(--th-black);
  color: var(--th-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--th-white);
}

.site-logo span { color: var(--th-red); }

.site-nav { display: flex; align-items: center; gap: 24px; }

.site-nav a {
  font-size: 13px;
  color: var(--th-gray-light);
  transition: color var(--transition);
}

.site-nav a:hover { color: var(--th-white); }

.site-nav__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--th-gray-light);
}

.site-nav__user strong { color: var(--th-white); }

.btn-logout {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid var(--th-gray-dark);
  border-radius: var(--radius-sm);
  color: var(--th-gray-light);
  font-size: 12px;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: var(--th-gray-dark);
  color: var(--th-white);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--th-red);
  color: var(--th-white);
}

.btn--primary:hover:not(:disabled) { background: var(--th-red-dark); }

.btn--secondary {
  background: var(--th-white);
  color: var(--th-black);
  border: 1px solid var(--th-gray-light);
}

.btn--secondary:hover:not(:disabled) { background: var(--th-gray-bg); }

.btn--dark {
  background: var(--th-black);
  color: var(--th-white);
}

.btn--dark:hover:not(:disabled) { background: var(--th-gray-dark); }

.btn--full { width: 100%; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--lg { padding: 14px 28px; font-size: 16px; }
.btn--sm { padding: 6px 14px; font-size: 12px; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
}

.badge--easy   { background: #e6f9f0; color: var(--th-green); }
.badge--medium { background: #fff7e6; color: #e07000; }
.badge--hard   { background: #fff0f0; color: var(--th-red); }
.badge--chaos  { background: #1a1a1a; color: var(--th-yellow); }
.badge--cancel { background: #f0f4ff; color: var(--th-blue); }
.badge--queue  { background: #fdf0f8; color: #cc0099; }
.badge--refresh { background: #f5f5f5; color: #555; }
.badge--auto   { background: #e6fff0; color: #008a40; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--th-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

.modal__header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--th-gray-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__header h3 { font-size: 17px; font-weight: 700; }

.modal__close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 18px;
  color: var(--th-gray);
  transition: background var(--transition);
}

.modal__close:hover { background: var(--th-gray-bg); }

.modal__body { padding: 20px 24px; }

.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--th-gray-bg);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Toast ──────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 18px;
  background: var(--th-dark);
  color: var(--th-white);
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  animation: slideIn .2s ease;
  max-width: 320px;
}

.toast--error { background: var(--th-red); }
.toast--success { background: var(--th-green); }

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

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.text-red   { color: var(--th-red); }
.text-green { color: var(--th-green); }
.text-gray  { color: var(--th-gray); }
.text-sm    { font-size: 12px; }
.text-center { text-align: center; }
.font-bold  { font-weight: 700; }

.divider {
  border: none;
  border-top: 1px solid var(--th-gray-bg);
  margin: 16px 0;
}

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--th-gray-light);
  border-top-color: var(--th-red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header__inner { padding: 0 14px; }
  /* Hide nav links on mobile (keep user/logout area) */
  .site-nav > a { display: none; }
  .site-logo { font-size: 18px; }

  /* Modal full-width on small screens */
  .modal { max-width: 100%; border-radius: var(--radius-sm); }
  .modal-overlay { padding: 12px; align-items: flex-end; }

  /* Toast: full width on mobile */
  .toast-container { right: 10px; left: 10px; }
  .toast { max-width: 100%; }
}
