/*
 * Tickets — zaalplan (Kinepolis-stijl) + checkoutflow.
 * Gebruikt door /tickets.html én de tickets-tab in /beheer.html.
 * Het plan is een donkere "zaal" met een oplichtend podium; stoelkleuren
 * komen uit ticket_config.categories (via --seat-cat op elke stoel).
 * Publiek zien bezet en geblokkeerd er hetzelfde uit (donker); enkel in
 * beheer (mode-admin) zijn de statussen apart gekleurd.
 */

/* ---- Compacte hero + sectie: het plan moet zonder scrollen zichtbaar zijn */

.page-hero.tix-hero { padding: 108px 0 26px; }
.page-hero.tix-hero h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin-bottom: 0; }
.content-section.tix-section { padding: 26px 0 80px; }

/* ---- Zaalplan ---------------------------------------------------------- */

.seatmap {
  background: linear-gradient(180deg, #16294a 0%, #0f1e38 100%);
  border-radius: 16px;
  padding: 12px 14px 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 18px 40px rgba(15, 30, 56, .35);
}

.seatmap-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}
.seatmap-zoom-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: 800 1rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
}
.seatmap-zoom-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.seatmap-zoom-btn:disabled { opacity: .35; cursor: default; }

.seatmap-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.seatmap-grid {
  display: grid;
  gap: 3px;
  align-items: stretch;
  /* Breedte wordt door de zoomknoppen gezet; smaller dan de container → centreren. */
  margin: 0 auto;
}

/* Kleine zoomniveaus: compactere tussenruimte, nummers verbergen zodra ze
   toch niet meer leesbaar zijn (overzichtsmodus). */
.seatmap-grid.zoom-s { gap: 2px; }
.seatmap-grid.zoom-xs { gap: 1px; }
.seatmap-grid.zoom-xs .seat { font-size: 0; border-radius: 2px; }
.seatmap-grid.zoom-xs .seatmap-rowlabel { font-size: .5rem; }
.seatmap-grid.zoom-xs .seatmap-stage { font-size: .6rem; letter-spacing: .2em; text-indent: .2em; }

.seatmap-stage {
  grid-column: 1 / -1;
  margin: 0 6% 14px;
  padding: .5em 0;
  text-align: center;
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .45em;
  text-indent: .45em;
  color: #1e3a5f;
  background: linear-gradient(180deg, #f7ec5a 0%, #EFE21F 55%, #cfc314 100%);
  border-radius: 8px 8px 18px 18px;
  box-shadow: 0 10px 34px rgba(239, 226, 31, .28), 0 2px 0 rgba(0, 0, 0, .15);
}

.seatmap-rowlabel {
  display: grid;
  place-items: center;
  font-size: .62rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .38);
  user-select: none;
}

.seat {
  aspect-ratio: 1;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 5px;
  background: var(--seat-cat, #94a3b8);
  color: rgba(15, 30, 56, .82);
  font: 600 .58rem/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.seat:hover:not(:disabled) {
  transform: scale(1.22);
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
  z-index: 2;
  position: relative;
}
.seat:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
  z-index: 2;
}
.seat:disabled { cursor: not-allowed; }

/* Niet beschikbaar: bezet én (publiek) geblokkeerd — donker, versmelt met de zaal. */
.seat.st-bezet,
.seatmap.mode-public .seat.st-locked {
  background: #2c394f;
  color: rgba(255, 255, 255, .2);
}

/* Geselecteerd in de publieke kiezer: groen met witte ring (Kinepolis-groen). */
.seatmap.mode-public .seat.is-sel {
  background: #1fb457;
  color: #fff;
  transform: scale(1.14);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 6px 16px rgba(31, 180, 87, .45);
  z-index: 1;
  position: relative;
}

/* Beheer: echte statussen zichtbaar. */
.seatmap.mode-admin .seat.st-reserved {
  background: #f59e0b;
  color: #452c03;
}
.seatmap.mode-admin .seat.st-confirmed {
  background: #16a34a;
  color: #eafff2;
}
.seatmap.mode-admin .seat.st-locked {
  background: repeating-linear-gradient(45deg, #a52222 0 5px, #832020 5px 10px);
  color: rgba(255, 255, 255, .55);
}
.seatmap.mode-admin .seat.is-sel {
  transform: scale(1.14);
  box-shadow: 0 0 0 2px #fff, 0 6px 16px rgba(255, 255, 255, .25);
  z-index: 1;
  position: relative;
}

/* ---- Legende ----------------------------------------------------------- */

.seat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 14px 4px 0;
  font-size: .82rem;
  color: rgba(255, 255, 255, .75);
}
.seat-legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.seat-legend .sw {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: none;
}

/* ---- Welkomsttekst boven dagtabs --------------------------------------- */

.tix-welcome {
  font-size: 1.02rem;
  line-height: 1.6;
  color: #ffffff;
  margin: 0 0 18px;
}
.tix-welcome em {
  font-style: italic;
  color: #ffffff;
  font-weight: 600;
}

/* ---- Dagtabs (Zaterdag / Zondag) --------------------------------------- */

.tix-daytabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.tix-daytab {
  padding: .55rem 1.5rem;
  border-radius: 999px;
  border: 2px solid #cbd5e1;
  background: #eef2f7;
  color: #64748b;
  font: 600 .95rem Inter, system-ui, sans-serif;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.tix-daytab:hover { border-color: #1e3a5f; color: #1e3a5f; }
/* Actieve dag: donkerblauw met gele rand — onmiskenbaar geselecteerd. */
.tix-daytab.active {
  background: #1e3a5f;
  border-color: #EFE21F;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, .18), 0 6px 16px rgba(30, 58, 95, .28);
}
.tix-daytab .cnt {
  display: inline-block;
  margin-left: 7px;
  padding: 0 8px;
  border-radius: 999px;
  background: #1fb457;
  color: #fff;
  font-size: .78rem;
}

/* Dagtab-marker "wachtlijst" (dag afgesloten door beheer). */
.tix-daytab .cnt.wl { background: #64748b; text-transform: uppercase; font-size: .66rem; letter-spacing: .04em; }

/* Beheer: de dagtabs blijven bovenaan plakken zodat je op elk moment tussen
   de dagen kan wisselen, ook diep in de reserveringstabel. Donkere,
   licht doorschijnende achtergrond zodat de content eronder niet doorschemert. */
.tix-daytabs-sticky {
  position: sticky;
  top: 72px;
  z-index: 60;
  margin: 0 -10px 14px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(12, 22, 44, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---- Ticketpagina: balk, formulier, bevestiging ------------------------- */

.tix-wrap { max-width: 980px; margin: 0 auto; }

.tix-eventbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  align-items: baseline;
  margin: 0 0 14px;
  color: #475569;
}
.tix-eventbar strong { color: #1e3a5f; font-size: 1.05rem; }

.tix-bar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  margin-top: 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(15, 30, 56, .18);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.tix-bar .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 240px;
  min-height: 28px;
  align-items: center;
}
.tix-bar .calc { font-size: 1rem; color: #334155; }
.tix-bar .calc strong { color: #1e3a5f; font-weight: 800; }
.tix-bar .hint { color: #94a3b8; font-size: .85rem; }

.tix-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 26px 26px 30px;
  box-shadow: 0 8px 26px rgba(15, 30, 56, .08);
}
.tix-panel h2 { margin: 0 0 6px; color: #1e3a5f; }

.tix-explain {
  background: #fefce8;
  border: 1px solid #EFE21F;
  border-radius: 10px;
  padding: 13px 17px;
  margin: 16px 0;
  color: #4b4a1c;
  font-size: .95rem;
  line-height: 1.55;
}

/* ---- Kortingscode (checkout) ------------------------------------------- */

.tix-code-box { margin: 4px 0 4px; }
.tix-code-box > label { font-weight: 600; font-size: .88rem; color: #334155; display: block; margin-bottom: 5px; }
.tix-code-row { display: flex; gap: 8px; max-width: 460px; align-items: center; }
.tix-code-row .tix-input { flex: 1; text-transform: uppercase; }
.tix-code-row .btn { white-space: nowrap; }
.tix-code-err { color: #b91c1c; font-size: .85rem; margin-top: 6px; }
.tix-code-box.applied {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .92rem;
}
.tix-code-box.applied strong { color: #14532d; }

.tix-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 14px 0 20px;
}
.tix-summary .row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: .93rem;
  color: #334155;
}
.tix-summary .row.total {
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
  padding-top: 9px;
  font-weight: 800;
  color: #1e3a5f;
}

.tix-form { display: grid; gap: 14px; max-width: 460px; }
.tix-form label { font-weight: 600; font-size: .88rem; color: #334155; display: block; margin-bottom: 5px; }
.tix-input {
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font: inherit;
  color: #0f172a;
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.tix-input:focus {
  outline: none;
  border-color: #1e3a5f;
  box-shadow: 0 0 0 3px rgba(30, 58, 95, .14);
}

.tix-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

.tix-alert {
  border-radius: 10px;
  padding: 13px 17px;
  margin: 0 0 18px;
  font-size: .95rem;
  line-height: 1.5;
}
.tix-alert.error { background: #fef2f2; border: 1px solid #fca5a5; color: #7f1d1d; }
.tix-alert.info { background: #eff6ff; border: 1px solid #93c5fd; color: #1e3a5f; }

.tix-code {
  text-align: center;
  margin: 22px 0;
}
.tix-code .lbl { font-size: .8rem; color: #64748b; text-transform: uppercase; letter-spacing: .12em; }
.tix-code .val {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: #1e3a5f;
  background: #fefce8;
  border: 2px dashed #EFE21F;
  border-radius: 12px;
  display: inline-block;
  padding: 10px 26px;
  margin-top: 6px;
}

.tix-status-msg { text-align: center; padding: 48px 18px; color: #475569; font-size: 1.02rem; }

/* ---- Beheer-tab -------------------------------------------------------- */

.tix-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}
.tix-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 108px;
}
.tix-stat .v { font-size: 1.25rem; font-weight: 800; color: #1e3a5f; }
.tix-stat .l { font-size: .74rem; color: #64748b; text-transform: uppercase; letter-spacing: .06em; }
.tix-stat .sw { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

.tix-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  min-height: 34px;
}

.tix-table-wrap { overflow-x: auto; }
.tix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
  background: #fff;
}
.tix-table th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #0f172a;
  padding: 8px 10px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.tix-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
  color: #0f172a;
}
.tix-table tr:hover td { background: #f8fafc; }
.tix-table .seats-cell { max-width: 220px; }
.tix-table .btn-sm { padding: .25rem .55rem; font-size: .72rem; }

.tix-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.tix-badge.b-reserved { background: #fef3c7; color: #92400e; }
.tix-badge.b-confirmed { background: #dcfce7; color: #166534; }
.tix-badge.b-cancelled { background: #f1f5f9; color: #64748b; }
.tix-badge.b-pending { background: #e0f2fe; color: #075985; }

/* Status als compact icoon met tooltip (title) in de reserveringstabel. */
.tix-st-ico {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
  cursor: help;
}
.tix-st-ico.b-reserved { background: #fef3c7; color: #92400e; }
.tix-st-ico.b-confirmed { background: #dcfce7; color: #166534; }
.tix-st-ico.b-cancelled { background: #f1f5f9; color: #64748b; }
.tix-st-ico.b-pending { background: #e0f2fe; color: #075985; }
.tix-mail-warn { display: block; margin-top: 3px; font-size: .8rem; cursor: help; text-align: center; }

/* Vaste kolombreedtes (via colgroup in beheer): de tabel schuift niet meer
   per rij; enkel de Naam-kolom vangt de resterende ruimte op. Op smalle
   schermen scrolt de wrapper i.p.v. de kolommen samen te drukken. */
.tix-table-fixed { table-layout: fixed; min-width: 1020px; }
.tix-table-fixed td { overflow-wrap: break-word; }
.tix-table .contact-cell { overflow-wrap: anywhere; }
/* Iets kleiner zodat een volledige code (SFX-XX.....) op één regel past. */
.tix-table .code-cell strong { font-size: .8rem; }

/* Actieknoppen: vaste breedte en 2 regels hoog, zodat elke rij dezelfde
   knopmaten heeft en de tabel niet uitrekt. */
.tix-act-cell { display: flex; gap: 6px; align-items: stretch; }
.tix-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 96px;
  min-height: 46px;
  padding: .25rem .4rem;
  white-space: normal;
  line-height: 1.15;
  font-size: .78rem;
}

.tix-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  margin-top: 8px;
}

/* ---- Beheer: kortingscodes -------------------------------------------- */

.tix-disc-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin: 10px 0 14px;
}
.tix-disc-form .fld { display: flex; flex-direction: column; gap: 3px; }
.tix-disc-form .fld label { font-size: .72rem; color: #64748b; text-transform: uppercase; letter-spacing: .05em; }
.tix-disc-form .fld.code input { text-transform: uppercase; width: 140px; }
.tix-disc-form .fld.free input { width: 90px; }
.tix-disc-form .fld.label input { width: 200px; }
.tix-disc-bar {
  display: inline-block;
  height: 7px;
  border-radius: 4px;
  background: #16a34a;
  vertical-align: middle;
  min-width: 2px;
}
.tix-disc-track {
  display: inline-block;
  width: 90px;
  height: 7px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
  vertical-align: middle;
  margin-right: 6px;
}

/* Rij groen kleuren wanneer de kortingscode is gebruikt */
.tix-table tr.disc-used td {
  background: #f0fdf4;
}
.tix-table tr.disc-used:hover td {
  background: #dcfce7;
}

/* ---- Mobiel ------------------------------------------------------------ */

@media (max-width: 640px) {
  .page-hero.tix-hero { padding: 92px 0 18px; }
  .content-section.tix-section { padding: 16px 0 60px; }
  .seatmap { padding: 10px 8px 14px; border-radius: 12px; }
  .seat { font-size: .55rem; border-radius: 4px; }
  .tix-daytab { flex: 1 1 auto; text-align: center; }
  /* De actiebalk blijft plakken zodat "Naar checkout" altijd bereikbaar is. */
  .tix-bar { bottom: 8px; padding: 10px 12px; gap: 8px; }
  .tix-bar .total { font-size: .95rem; }
  .tix-panel { padding: 20px 16px 24px; }
  .tix-code .val { font-size: 1.5rem; padding: 8px 16px; }
}
