/* ============================================================
   TICKETHELL — Ticketing page styles
   (seat grid, info panel, booking flow)
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────── */
.ticketing-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  min-height: calc(100vh - 56px);
}

@media (max-width: 900px) {
  .ticketing-layout { grid-template-columns: 1fr; }
}

/* ── Concert Info Bar ────────────────────────────────────── */
.concert-infobar {
  background: var(--th-black);
  color: var(--th-white);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.concert-infobar__title { font-size: 16px; font-weight: 700; }
.concert-infobar__meta  { font-size: 12px; color: var(--th-gray-light); }

.concert-infobar__status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--th-gray-mid);
}

.status-dot--available { background: var(--th-green); animation: pulse 1.5s infinite; }
.status-dot--waiting   { background: var(--th-yellow); }
.status-dot--expired   { background: var(--th-red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ── Main seat area ──────────────────────────────────────── */
.seat-area {
  background: var(--th-white);
  padding: 24px;
  overflow-y: auto;
}

.seat-area__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.seat-area__header h2 { font-size: 16px; font-weight: 700; }

.refresh-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--th-gray);
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--th-white);
  border: 1px solid var(--th-gray-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--th-gray-dark);
  transition: all var(--transition);
}

.btn-refresh:hover { background: var(--th-gray-bg); border-color: var(--th-gray); }
.btn-refresh:active { transform: scale(0.97); }

/* ── Section tabs ──────────────────────────────────────── */
.section-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.section-tab {
  padding: 7px 18px;
  border: 1px solid var(--th-gray-light);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--th-gray);
  background: var(--th-white);
  transition: all var(--transition);
}

.section-tab.active,
.section-tab:hover {
  background: var(--th-black);
  color: var(--th-white);
  border-color: var(--th-black);
}

/* ── Stage indicator ─────────────────────────────────────── */
.stage {
  background: linear-gradient(180deg, #e8e8e8 0%, #d5d5d5 100%);
  border: 2px solid #bbb;
  border-radius: 40px 40px 8px 8px;
  text-align: center;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 800;
  color: #888;
  letter-spacing: 6px;
  margin: 0 auto 24px;
  max-width: 70%;
}

/* ── Seat Legend ─────────────────────────────────────────── */
.seat-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.seat-legend__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--th-gray);
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.legend-dot--vip      { background: var(--seat-vip); }
.legend-dot--r        { background: var(--seat-r); }
.legend-dot--s        { background: var(--seat-s); }
.legend-dot--a        { background: var(--seat-a); }
.legend-dot--occupied { background: var(--seat-occupied); }
.legend-dot--available { background: var(--seat-available); }
.legend-dot--selected  { background: var(--seat-selected); }

/* ── Seat Grid ───────────────────────────────────────────── */
.seat-grid-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
  text-align: center;
}

.seat-grid {
  display: inline-grid;
  gap: 3px;
  margin: 0 auto;
}

/* Row label column */
.seat-row-label {
  width: 22px;
  height: 22px;
  font-size: 10px;
  font-weight: 700;
  color: var(--th-gray-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Generic seat cell */
.seat {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  cursor: default;
  transition: transform .1s, box-shadow .1s;
  position: relative;
  user-select: none;
}

/* Occupied (default) */
.seat--occupied,
.seat--s-seat.seat--occupied,
.seat--r-seat.seat--occupied,
.seat--vip.seat--occupied,
.seat--a-seat.seat--occupied {
  background: var(--seat-occupied);
  color: var(--th-gray-mid);
  cursor: not-allowed;
}

/* Available */
.seat--available {
  cursor: pointer;
  animation: seatAppear .3s ease;
}

.seat--vip.seat--available     { background: var(--seat-vip); color: #fff; }
.seat--r-seat.seat--available  { background: var(--seat-r);   color: #fff; }
.seat--s-seat.seat--available  { background: var(--seat-s);   color: #fff; }
.seat--a-seat.seat--available  { background: var(--seat-a);   color: #fff; }

.seat--available:hover {
  transform: scale(1.3);
  box-shadow: 0 0 8px rgba(0,200,80,.6);
  z-index: 10;
}

/* Selected */
.seat--selected {
  background: var(--seat-selected) !important;
  color: #fff !important;
  cursor: pointer;
  transform: scale(1.2);
  box-shadow: 0 0 12px rgba(255,107,0,.7);
  z-index: 10;
  animation: seatGlow 1.2s ease-in-out infinite alternate;
}

@keyframes seatAppear {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes seatGlow {
  from { box-shadow: 0 0 6px rgba(255,107,0,.5); }
  to   { box-shadow: 0 0 16px rgba(255,107,0,.9); }
}

/* ── Right panel ─────────────────────────────────────────── */
.booking-panel {
  background: var(--th-white);
  border-left: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
}

.booking-panel__section {
  padding: 20px;
  border-bottom: 1px solid var(--th-gray-bg);
}

.booking-panel__section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--th-gray);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Seat selection result */
.selected-seat-display {
  background: var(--th-gray-bg);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: center;
}

.selected-seat-display .seat-number {
  font-size: 28px;
  font-weight: 900;
  color: var(--th-black);
  letter-spacing: -1px;
}

.selected-seat-display .seat-section {
  font-size: 12px;
  color: var(--th-gray);
  margin-top: 2px;
}

/* Ticket type selector */
.ticket-type-group {
  display: flex;
  gap: 8px;
}

.ticket-type-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--th-gray-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--th-gray);
  background: var(--th-white);
  transition: all var(--transition);
  text-align: center;
}

.ticket-type-btn.selected {
  border-color: var(--th-red);
  color: var(--th-red);
  background: #fff5f5;
}

/* Timer */
.booking-timer {
  background: #1a1a1a;
  color: var(--th-white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.booking-timer__countdown {
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--th-yellow);
}

.booking-timer--urgent .booking-timer__countdown {
  color: var(--th-red);
  animation: urgentBlink .5s ease-in-out infinite alternate;
}

@keyframes urgentBlink {
  from { opacity: 1; }
  to   { opacity: .5; }
}

/* Bottom CTA */
.booking-panel__cta {
  padding: 16px 20px;
  margin-top: auto;
}

/* ── Queue page styles ──────────────────────────────────── */
.queue-page {
  max-width: 640px;
  margin: 40px auto;
  padding: 0 20px;
}

.queue-card {
  background: var(--th-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.queue-card__header {
  background: var(--th-black);
  color: var(--th-white);
  padding: 20px 24px;
}

.queue-card__header h2 { font-size: 18px; font-weight: 700; }
.queue-card__header p  { font-size: 13px; color: var(--th-gray-light); margin-top: 4px; }

.queue-card__body { padding: 24px; }

.queue-count {
  text-align: center;
  padding: 24px;
  background: var(--th-gray-bg);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.queue-count__number {
  font-size: 48px;
  font-weight: 900;
  color: var(--th-black);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.queue-count__label { font-size: 14px; color: var(--th-gray); margin-top: 6px; }

.queue-btn-wrapper { text-align: center; }

.btn-queue-enter {
  padding: 16px 48px;
  font-size: 18px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-queue-enter.active {
  background: var(--th-red);
  color: var(--th-white);
  box-shadow: 0 4px 20px rgba(232,0,45,.35);
}

.btn-queue-enter.inactive {
  background: var(--th-gray-light);
  color: var(--th-gray);
  cursor: not-allowed;
}

.next-activation {
  font-size: 13px;
  color: var(--th-gray);
  margin-top: 12px;
  text-align: center;
}

.next-activation strong {
  color: var(--th-black);
  font-variant-numeric: tabular-nums;
}

/* Captcha */
.captcha-box {
  background: var(--th-gray-bg);
  border: 1px solid var(--th-gray-light);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.captcha-box__label {
  font-size: 13px;
  color: var(--th-gray);
  margin-bottom: 12px;
}

.captcha-box__image img {
  max-width: 200px;
  border-radius: var(--radius-sm);
  margin: 0 auto 14px;
}

.captcha-box__input {
  width: 100%;
  max-width: 200px;
  padding: 10px 14px;
  border: 2px solid var(--th-gray-light);
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 6px;
  text-transform: uppercase;
  transition: border-color var(--transition);
}

.captcha-box__input:focus {
  outline: none;
  border-color: var(--th-red);
}

/* ── Success page ────────────────────────────────────────── */
.success-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.success-card {
  background: var(--th-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px;
  max-width: 560px;
  width: 100%;
  text-align: center;
}

.success-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.success-card h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--th-black);
  margin-bottom: 8px;
}

.success-card__sub {
  font-size: 15px;
  color: var(--th-gray);
  margin-bottom: 32px;
}

.booking-summary {
  background: var(--th-gray-bg);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  text-align: left;
  margin-bottom: 24px;
}

.booking-summary__row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e8e8e8;
  font-size: 14px;
}

.booking-summary__row:last-child { border-bottom: none; }
.booking-summary__row dt { color: var(--th-gray); }
.booking-summary__row dd { font-weight: 700; }

.time-badge {
  display: inline-block;
  background: var(--th-red);
  color: var(--th-white);
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 24px;
  font-variant-numeric: tabular-nums;
}

/* ── Ranking page ────────────────────────────────────────── */
.ranking-page {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 20px;
}

.ranking-page h1 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 24px;
}

.ranking-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--th-gray-light);
  overflow-x: auto;
}

.ranking-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--th-gray);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--transition);
}

.ranking-tab.active {
  color: var(--th-red);
  border-bottom-color: var(--th-red);
}

.ranking-table {
  width: 100%;
  background: var(--th-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ranking-table table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th {
  background: var(--th-black);
  color: var(--th-white);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.ranking-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--th-gray-bg);
}

.ranking-table tr:last-child td { border-bottom: none; }
.ranking-table tr:hover td { background: var(--th-gray-bg); }

.rank-1 td:first-child { color: #ffd700; font-weight: 900; font-size: 16px; }
.rank-2 td:first-child { color: #c0c0c0; font-weight: 900; }
.rank-3 td:first-child { color: #cd7f32; font-weight: 900; }

.child-badge {
  display: inline-block;
  background: #e6f0ff;
  color: var(--th-blue);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

.cancel-badge {
  display: inline-block;
  background: #fff3e6;
  color: #e07000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
}

/* ── Confirmation modal ──────────────────────────────────── */
.confirm-modal .booking-summary {
  margin-bottom: 0;
}

/* ── Mobile responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  /* Seat grid: larger touch targets on mobile */
  .seat {
    width: 26px;
    height: 26px;
  }
  .seat-row-label {
    width: 26px;
    height: 26px;
  }

  /* Seat area: less padding */
  .seat-area {
    padding: 16px;
  }

  /* Concert info bar: vertical stack */
  .concert-infobar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Ticketing layout: panel goes below on mobile */
  .ticketing-layout {
    grid-template-columns: 1fr;
  }

  .booking-panel {
    border-left: none;
    border-top: 2px solid var(--th-gray-bg);
  }

  /* Queue page: full width */
  .queue-page {
    margin: 20px auto;
    padding: 0 14px;
  }

  .queue-card__body { padding: 18px 16px; }

  .queue-count__number { font-size: 36px; }

  .btn-queue-enter {
    padding: 14px 32px;
    font-size: 16px;
  }

  /* Success card: compact padding */
  .success-card {
    padding: 28px 20px;
  }

  .success-card h1 { font-size: 22px; }
  .success-icon { font-size: 48px; }

  /* Ranking: scrollable table */
  .ranking-table {
    overflow-x: auto;
    display: block;
  }

  .ranking-tabs {
    padding-bottom: 2px;
  }

  .ranking-tab {
    padding: 8px 14px;
    font-size: 12px;
  }

  /* Section tabs: smaller on mobile */
  .section-tab {
    padding: 6px 14px;
    font-size: 12px;
  }

  /* Captcha input: bigger tap target */
  .captcha-box__input {
    font-size: 22px;
    padding: 12px 16px;
  }

  /* Booking panel CTA: stick to bottom */
  .booking-panel__cta {
    padding: 12px 16px;
  }

  /* Booking summary rows: smaller font */
  .booking-summary__row {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  /* Extra small: even smaller seats for chaos/hard (thousands of seats) */
  .seat {
    width: 20px;
    height: 20px;
    border-radius: 2px;
  }
  .seat-row-label {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .seat-legend {
    gap: 10px;
  }

  .seat-legend__item {
    font-size: 10px;
  }
}
