/* ============================================================
   Movie Booking Plugin — booking.css
   ใช้ CSS variables เดิมของ fdspu.css เพื่อให้ต่อเนื่องกับธีมเว็บ
   ============================================================ */

/* ── Layout ─────────────────────────────────────────────────── */
.booking-main {
  min-height: 60vh;
}

.bk-page-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0;
}

/* ── Loading Spinner ─────────────────────────────────────────── */
.bk-loading {
  min-height: 30vh;
}
.bk-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: bk-spin .7s linear infinite;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* ── Back button ─────────────────────────────────────────────── */
.bk-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: 1.5px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: .875rem;
  font-weight: 500;
  padding: .4rem .9rem;
  cursor: pointer;
  transition: all .2s;
}
.bk-back-btn:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: var(--theme-primary-light);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-bk-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: var(--primary-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .65rem 1.4rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.btn-bk-primary:hover:not(:disabled) {
  background: var(--primary-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}
.btn-bk-primary:disabled {
  background: var(--surface-dark);
  color: var(--text-muted);
  cursor: not-allowed;
}
.btn-bk-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: transparent;
  border: 1.5px solid var(--primary-blue);
  color: var(--primary-blue);
  border-radius: 8px;
  padding: .65rem 1.4rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.btn-bk-outline:hover {
  background: var(--theme-primary-light);
  transform: translateY(-1px);
}

/* ── Movie Cards ─────────────────────────────────────────────── */
.bk-movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.bk-movie-card {
  background: var(--surface-light);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: all .25s;
  box-shadow: var(--shadow-neumorphic);
}
.bk-movie-card:hover {
  border-color: var(--primary-blue);
  transform: translateY(-3px);
  box-shadow: var(--shadow-neumorphic-hover);
}
.bk-movie-poster {
  aspect-ratio: 7/10;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.bk-movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bk-movie-poster-icon {
  color: rgba(255,255,255,.3);
  font-size: 3rem;
}
.bk-movie-rating-badge {
  position: absolute;
  top: .5rem;
  right: .5rem;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 5px;
  letter-spacing: .5px;
}
.bk-movie-info {
  padding: .9rem;
}
.bk-movie-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bk-movie-meta {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.bk-genre-tag {
  display: inline-block;
  background: var(--theme-primary-light);
  color: var(--primary-blue);
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 20px;
  margin-right: .25rem;
  margin-bottom: .25rem;
}

/* ── Movie Detail ────────────────────────────────────────────── */
.bk-detail-hero {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.bk-detail-poster {
  flex-shrink: 0;
  width: 140px;
  aspect-ratio: 7/10;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bk-detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.bk-detail-info { flex: 1; min-width: 200px; }
.bk-detail-title {
  font-size: clamp(1.2rem, 4vw, 1.7rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: .25rem;
}
.bk-detail-title-en {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.bk-detail-desc {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: .75rem;
}
.bk-detail-badges { display: flex; flex-wrap: wrap; gap: .4rem; }
.bk-badge-pill {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: .78rem;
  padding: .2rem .65rem;
  color: var(--text-secondary);
}

/* ── Showtime Groups ─────────────────────────────────────────── */
.bk-theater-group {
  background: var(--surface-light);
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.bk-theater-head {
  background: var(--bg-secondary);
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.bk-theater-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: .95rem;
}
.bk-theater-section {
  font-size: .78rem;
  color: var(--text-muted);
}
.bk-showtimes-row {
  padding: .9rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.bk-showtime-btn {
  border-radius: 10px;
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-primary);
  padding: .5rem .9rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  min-width: 90px;
  font-family: inherit;
}
.bk-showtime-btn.available:hover {
  border-color: var(--primary-blue);
  background: var(--theme-primary-light);
}
.bk-showtime-btn.full {
  opacity: .5;
  cursor: not-allowed;
}
.bk-showtime-time {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.bk-showtime-avail {
  font-size: .72rem;
  margin-top: .15rem;
}
.bk-avail-high { color: #16a34a; }
.bk-avail-mid  { color: #ca8a04; }
.bk-avail-low  { color: #dc2626; }
.bk-avail-full { color: var(--text-muted); }

/* ── Seat Map ────────────────────────────────────────────────── */
.bk-seatmap-info {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: .9rem 1.1rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}
.bk-seatmap-info-item {
  font-size: .875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.bk-seatmap-info-item strong { color: var(--text-primary); }

/* Screen */
.bk-screen-wrap {
  text-align: center;
  margin-bottom: 1rem;
}
.bk-screen {
  display: inline-block;
  background: linear-gradient(to bottom, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  padding: .45rem 3rem;
  border-radius: 4px 4px 0 0;
  letter-spacing: .5px;
  box-shadow: 0 4px 20px rgba(37,99,235,.4);
}
.bk-screen-shadow {
  width: 80%;
  max-width: 300px;
  height: 8px;
  background: radial-gradient(ellipse, rgba(37,99,235,.3) 0%, transparent 70%);
  margin: 0 auto;
}

/* Seat grid */
.bk-seatmap-grid {
  overflow-x: auto;
  padding-bottom: .5rem;
}
.bk-seatmap-table {
  margin: 0 auto;
  border-spacing: 0;
  border-collapse: separate;
}
.bk-row-label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 .75rem 0 0;
  text-align: right;
  vertical-align: middle;
  user-select: none;
}
.bk-aisle-col { width: 1rem; }
.bk-aisle-row td { height: .75rem; }
.bk-seat-cell { padding: .15rem .12rem; }

/* Seat buttons */
.bk-seat {
  width: 32px;
  height: 32px;
  border-radius: 6px 6px 4px 4px;
  border: none;
  cursor: pointer;
  font-size: .65rem;
  font-weight: 700;
  font-family: inherit;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.bk-seat:focus-visible { outline: 2px solid var(--primary-blue); outline-offset: 1px; }

.bk-s-available {
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-secondary);
}
.bk-s-available:hover {
  background: var(--theme-primary-light);
  border-color: var(--primary-blue);
  transform: scale(1.1);
}
.bk-s-selecting {
  background: var(--primary-blue);
  border: 1.5px solid var(--primary-blue);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(37,99,235,.25);
}
.bk-s-booked {
  background: #fee2e2;
  border: 1.5px solid #fca5a5;
  color: #991b1b;
  cursor: not-allowed;
}
.bk-s-pending {
  background: #fef9c3;
  border: 1.5px solid #fde047;
  color: #854d0e;
  cursor: not-allowed;
}
.bk-s-admin_blocked {
  background: #1e293b;
  border: 1.5px solid #334155;
  color: #94a3b8;
  cursor: not-allowed;
  font-size: .5rem;
}
.bk-s-disabled {
  background: repeating-linear-gradient(
    45deg, var(--bg-tertiary), var(--bg-tertiary) 3px,
    transparent 3px, transparent 7px
  );
  border: 1.5px solid var(--surface-dark);
  color: transparent;
  cursor: not-allowed;
}
.bk-s-mine {
  background: #dcfce7;
  border: 1.5px solid #86efac;
  color: #14532d;
  cursor: not-allowed;
}

/* Legend */
.bk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  justify-content: center;
  padding: .75rem 0;
  border-top: 1px solid var(--border-subtle);
}
.bk-legend-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  color: var(--text-secondary);
}

/* Summary bar */
.bk-summary-bar {
  position: sticky;
  bottom: .75rem;
  background: var(--glass-bg);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: .85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  backdrop-filter: blur(8px);
  flex-wrap: wrap;
  z-index: 50;
}
.bk-summary-text {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
  flex-wrap: wrap;
}
.bk-quota-badge {
  background: var(--theme-primary-light);
  color: var(--primary-blue);
  font-size: .75rem;
  font-weight: 600;
  padding: .15rem .55rem;
  border-radius: 20px;
}

/* ── Google Sign-In wrapper ──────────────────────────────────── */
.bk-google-wrap { text-align: center; }
.bk-google-wrap .g_id_signin { display: flex; justify-content: center; }
.bk-divider {
  display: flex; align-items: center; gap: .75rem;
  margin: 1rem 0; color: var(--text-muted); font-size: .82rem;
}
.bk-divider::before, .bk-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border-subtle);
}

/* OTP input */
.bk-otp-input {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: .5rem;
  font-family: 'Courier New', monospace;
  padding: .6rem;
}

/* ── Auth Form ───────────────────────────────────────────────── */
.bk-auth-card {
  max-width: 480px;
  margin: 0 auto;
  background: var(--surface-light);
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-neumorphic-hover);
}
.bk-auth-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: .25rem;
}
.bk-form { width: 100%; }
.bk-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
@media (max-width: 420px) { .bk-form-row { grid-template-columns: 1fr; } }
.bk-form-group { margin-bottom: .9rem; }
.bk-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .3rem;
}
.bk-input {
  width: 100%;
  border: 1.5px solid var(--border-subtle);
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color .2s;
  outline: none;
  box-sizing: border-box;
}
.bk-input:focus { border-color: var(--primary-blue); }
.bk-input::placeholder { color: var(--text-muted); }
.bk-form-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  color: #991b1b;
  font-size: .85rem;
  padding: .6rem .85rem;
}

/* ── Confirm Card ────────────────────────────────────────────── */
.bk-confirm-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface-light);
  border: 1.5px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: var(--shadow-neumorphic-hover);
}
.bk-confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: .9rem;
  gap: .5rem;
  flex-wrap: wrap;
}
.bk-confirm-row:last-child { border-bottom: none; }
.bk-confirm-label { color: var(--text-muted); white-space: nowrap; }
.bk-confirm-val { font-weight: 600; color: var(--text-primary); text-align: right; }
.bk-seats-pills { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.bk-seat-pill {
  background: var(--theme-primary-light);
  color: var(--primary-blue);
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 700;
  padding: .15rem .5rem;
}

/* ── E-Ticket ────────────────────────────────────────────────── */
.bk-eticket {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-primary);
  border: 2px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
.bk-eticket-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #fff;
  text-align: center;
  padding: 1.2rem;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.bk-eticket-body {
  padding: 1.25rem 1.5rem;
  border-bottom: 2px dashed var(--border-subtle);
}
.bk-ticket-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: .45rem 0;
  font-size: .88rem;
  gap: .5rem;
  flex-wrap: wrap;
}
.bk-ticket-lbl { color: var(--text-muted); }
.bk-ticket-val { font-weight: 700; color: var(--text-primary); text-align: right; }
.bk-eticket-qr {
  text-align: center;
  padding: 1.5rem;
}
.bk-qr-box {
  display: inline-block;
  background: #fff;
  border: 1.5px solid var(--border-subtle);
  border-radius: 10px;
  padding: .75rem;
  margin-bottom: .5rem;
}
.bk-qr-ref {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
}
.bk-qr-label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 0;
}
.bk-eticket-footer {
  background: var(--bg-secondary);
  text-align: center;
  padding: .6rem;
  color: var(--text-muted);
}

/* ── My Tickets List ─────────────────────────────────────────── */
.bk-ticket-card {
  background: var(--surface-light);
  border: 1.5px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: .9rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: box-shadow .2s;
  cursor: pointer;
}
.bk-ticket-card:hover {
  box-shadow: var(--shadow-neumorphic-hover);
  border-color: var(--primary-blue);
}
.bk-ticket-poster {
  width: 52px;
  flex-shrink: 0;
  aspect-ratio: 7/10;
  border-radius: 6px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.bk-ticket-poster img { width: 100%; height: 100%; object-fit: cover; }
.bk-ticket-info { flex: 1; }
.bk-ticket-movie { font-weight: 700; font-size: .95rem; margin-bottom: .2rem; }
.bk-ticket-sub { font-size: .8rem; color: var(--text-muted); }
.bk-ticket-status {
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 20px;
  align-self: flex-start;
  white-space: nowrap;
}
.bk-status-confirmed { background: #dcfce7; color: #14532d; }
.bk-status-pending   { background: #fef9c3; color: #854d0e; }
.bk-status-used      { background: var(--bg-secondary); color: var(--text-muted); }
.bk-status-cancelled { background: #fee2e2; color: #991b1b; }
.bk-status-failed    { background: #fee2e2; color: #991b1b; }

/* ── User Bar ────────────────────────────────────────────────── */
.bk-user-bar {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--glass-bg);
  border: 1.5px solid var(--border-subtle);
  border-radius: 40px;
  padding: .5rem 1rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .82rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  backdrop-filter: blur(8px);
  z-index: 100;
  max-width: calc(100vw - 2rem);
}
.bk-user-bar span { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.bk-user-action, .bk-user-logout {
  border: none;
  background: none;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  transition: color .2s;
  padding: 0;
  white-space: nowrap;
}
.bk-user-action { color: var(--primary-blue); }
.bk-user-action:hover { color: var(--primary-blue-hover); }
.bk-user-logout { color: var(--text-muted); }
.bk-user-logout:hover { color: #dc2626; }

/* ── Countdown toast ─────────────────────────────────────────── */
.bk-countdown {
  position: fixed;
  bottom: 4rem;
  right: 1rem;
  background: #1e293b;
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  padding: .45rem .9rem;
  border-radius: 8px;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 576px) {
  .bk-movies-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .bk-detail-poster { width: 100px; }
  .bk-seat { width: 28px; height: 28px; font-size: .6rem; }
  .bk-confirm-card, .bk-auth-card { padding: 1.25rem; }
  .bk-user-bar { bottom: .5rem; right: .5rem; padding: .4rem .75rem; }
}
@media (max-width: 380px) {
  .bk-movies-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .bk-seat { width: 24px; height: 24px; }
}
