/* ==========================================================================
   Loterij Formulier Styles
   ========================================================================== */

.loterijform {
  padding: 20px 0;
}

.loterijform .form-label {
  font-weight: bold;
  margin-bottom: 6px;
  display: block;
}

.loterijform input[type="text"],
.loterijform input[type="email"],
.loterijform input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  box-sizing: border-box;
  margin-top: 4px;
}

/* Knoppen voor aantal loten */
.amount-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amount-btn {
  border: 0;
  cursor: pointer;
  background-color: rgba(112, 111, 111, 0.2);
  color: #000;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 4px;
}

.amount-btn input[type="radio"] {
  display: none;
}

.amount-btn.active {
  background: #366892;
  color: white;
  border-color: #366892;
}

/* Foutmeldingen & Validatie */
.error-msg {
  color: #d32f2f;
  font-size: 13px;
  margin-top: 4px;
  display: none; /* Standaard verborgen */
}

.input-error {
  border-color: #d32f2f !important;
  background-color: #fff8f8;
}

/* Submit knop */
.loterij-submit {
  background-color: #204d74;
  border-color: #122b40;
  color: #fff;
  width: 100%;
  max-width: 320px;
  height: 54px;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

.loterij-submit:hover {
  background-color: #122b40;
}

.mb-3 {
  margin-bottom: 16px;
}

/* Status-meldingen (Bedankt / Mislukt) */
.loterij-success {
  padding: 20px;
  background: #e8f5e9;
  border-left: 4px solid #2e7d32;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.loterij-failed {
  padding: 20px;
  background: #ffebee;
  border-left: 4px solid #c62828;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.loterijform-wrapper {
  position: relative;
  min-height: 150px; /* Voorkomt inzakken van pagina bij statusweergave */
}

/* Status kleurnaamgeving */
.status-paid { color: #2e7d32; font-weight: 600; } /* Groen */
.status-open, .status-pending { color: #ff9800; font-weight: 600; } /* Oranje */
.status-expired, .status-canceled, .status-failed { color: #d32f2f; font-weight: 600; } /* Rood */


/* ==========================================================================
   Admin Overzichtstabel (Voor inzage gekochte loten)
   ========================================================================== */

.loterij-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.loterij-actions {
  display: flex;
  align-items: flex-end;
  gap: 15px;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-group label {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 14px;
}

.status-dropdown {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  background-color: white;
  min-width: 160px;
  height: 40px;
}

.btn-export-excel {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 15px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  transition: background 0.2s ease;
}

.btn-export-excel:hover {
  background: #0056b3;
  color: white;
}

.btn-export-excel i {
  color: white !important;
}

.loterijTable {
  width: 100% !important;
  border-collapse: collapse;
  border: 1px solid lightslategray;
  table-layout: fixed;
  word-wrap: break-word;
}

.loterijTable th {
  font-weight: bold;
}

.loterijTable td, 
.loterijTable th {
  border: 1px solid lightslategray;
  padding: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Kolombreedtes vastzetten voor overzichtstabel */
.loterijTable th:nth-child(1), .loterijTable td:nth-child(1) { width: 110px; text-align: left; }
.loterijTable th:nth-child(2), .loterijTable td:nth-child(2) { width: 60px; }   /* Id */
.loterijTable th:nth-child(3), .loterijTable td:nth-child(3) { width: 20%; }   /* Naam */
.loterijTable th:nth-child(4), .loterijTable td:nth-child(4) { width: 25%; }   /* E-mail */
.loterijTable th:nth-child(5), .loterijTable td:nth-child(5) { width: auto; }  /* Lotnummers */
.loterijTable th:nth-child(6), .loterijTable td:nth-child(6) { width: 130px; }  /* Datum */
.loterijTable th:nth-child(7), .loterijTable td:nth-child(7) { width: 85px; }  /* Status */
.loterijTable th:nth-child(8), .loterijTable td:nth-child(8) { width: 80px; text-align: right; } /* Bedrag */

@media (max-width: 600px) {
  .loterij-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ==========================================================================
   Voorraad: hoeveel van de max. loten zijn er nog?
   ========================================================================== */

.loterij-voorraad {
  margin-bottom: 20px;
}

.loterij-voorraad-tekst {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  font-size: 15px;
}

.loterij-voorraad-tekst span {
  color: #555;
}

.loterij-voorraad-balk {
  background: rgba(112, 111, 111, 0.2);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.loterij-voorraad-balk > span {
  display: block;
  height: 100%;
  background: #366892;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.loterij-voorraad.is-uitverkocht .loterij-voorraad-balk > span {
  background: #c62828;
}

.loterij-voorraad.is-uitverkocht .loterij-voorraad-tekst strong {
  color: #c62828;
}

/* ==========================================================================
   Overzichtspagina: kerncijfers en resultaatteller
   ========================================================================== */

.loterij-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.loterij-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
}

.loterij-kpi-label {
  font-size: 13px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.loterij-kpi-waarde {
  font-size: 26px;
  font-weight: bold;
  line-height: 1.1;
  color: #204d74;
}

.loterij-kpi-waarde small {
  font-size: 15px;
  font-weight: normal;
  color: #777;
}

.loterij-kpi-waarde.is-leeg {
  color: #c62828;
}

.loterij-resultaat-teller {
  font-size: 14px;
  color: #555;
  margin: 0 0 8px;
}

.loterijTable tbody tr.loterij-leeg td {
  text-align: center;
  color: #777;
  white-space: normal;
}

.loterij-overzicht .loterij-zoek {
  min-width: 220px;
}

/* ==========================================================================
   Lotnummers: tonen als echte ticketnummers (001 t/m 750)
   ========================================================================== */

.lotnummer-lijst {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.lotnummer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 8px 14px;
  background: #366892;
  color: #fff;
  border-radius: 6px;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15);
}

.loterijTable .lotnummers-cel {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Prijzenoverzicht: kaarten met foto, titel en beschrijving
   ========================================================================== */

.prijzen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

.prijs-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.prijs-card--klikbaar:hover,
.prijs-card--klikbaar:focus-within {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.prijs-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: rgba(112, 111, 111, 0.15);
}

/* Geldt voor zowel de <img> als de <picture> die 2sxc genereert */
.prijs-card-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.prijs-card-media img,
.prijs-card-foto {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prijs-card-foto--leeg {
  background: repeating-linear-gradient(
    45deg,
    rgba(112, 111, 111, 0.10),
    rgba(112, 111, 111, 0.10) 10px,
    rgba(112, 111, 111, 0.18) 10px,
    rgba(112, 111, 111, 0.18) 20px
  );
}

.prijs-card-label {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  background: #366892;
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.prijs-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  /* Vult de resterende hoogte van de kaart, zodat margin-top:auto op de
     "Meer informatie"-link hem echt onderaan kan zetten. */
  flex: 1;
}

.prijs-card-titel {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.prijs-card-subtitel {
  margin: 0;
  font-size: 14px;
  color: #666;
}

.prijs-card-tekst {
  font-size: 15px;
  line-height: 1.55;
}

.prijs-card-tekst > *:first-child { margin-top: 0; }
.prijs-card-tekst > *:last-child { margin-bottom: 0; }

.prijs-card-link {
  margin-top: auto;
  padding-top: 6px;
  font-weight: bold;
  font-style: italic;
  color: #204d74;
  align-self: flex-start;
}

/* Hele kaart klikbaar maken zonder de opmaak in een <a> te wikkelen.
   In bewerkmodus uit, anders ligt de overlay over de 2sxc-knoppen heen. */
.loterij-prijzen:not(.is-editing) .prijs-card--klikbaar .prijs-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

@media (max-width: 480px) {
  .prijzen-grid {
    grid-template-columns: 1fr;
  }
}

/* Beheerbalk boven het prijzenraster - alleen zichtbaar in bewerkmodus */
.loterij-beheer-balk {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 20px;
  background: #f1f5f9;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
}

.loterij-beheer-label {
  font-weight: bold;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #204d74;
}

.loterij-beheer-hint {
  font-size: 14px;
  color: #555;
  margin-right: auto;
}

.loterij-beheer-balk .loterij-beheer-toolbar {
  position: relative;
}

/* ==========================================================================
   Prijzen-preview: intro, compact raster en knop naar de volledige pagina
   ========================================================================== */

.prijzen-intro {
  max-width: 720px;
  margin-bottom: 8px;
}

.prijzen-intro-titel {
  margin: 0 0 8px;
}

.prijzen-intro-tekst {
  font-size: 16px;
  line-height: 1.6;
}

.prijzen-intro-tekst > *:first-child { margin-top: 0; }
.prijzen-intro-tekst > *:last-child { margin-bottom: 0; }

/* auto-fit i.p.v. auto-fill: bij vier kaarten vullen ze de rij netjes op */
.prijzen-grid--preview {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.prijzen-grid--preview .prijs-card-titel {
  font-size: 18px;
}

.prijzen-actie {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.prijzen-knop {
  display: inline-block;
  padding: 13px 28px;
  background: #366892;
  color: #fff;
  border-radius: 6px;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.2s ease;
}

.prijzen-knop:hover,
.prijzen-knop:focus {
  background: #204d74;
  color: #fff;
  text-decoration: none;
}
