/* =========================
   GLOBAL RESETS / BASE
   ========================= */
* { box-sizing: border-box; }

:root{
  --brand:#0b6b60;
  --text:#1f2937;
  --bg:#eef2f5;
  --line:#d9dde3;
  --head:#f3f4f6;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* =========================
   PAGE WRAPPERS
   ========================= */
.wrap { padding: 28px 16px 60px; }

.card {
  max-width: 1180px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  padding: 18px;
}

h1 { margin-bottom: 12px; }

/* =========================
   PAGE HEADER (TITLE + PRINT)
   ========================= */
.page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

/* =========================
   FLASH MESSAGES
   ========================= */
.flash {
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
}
.flash.err {
  background: #fef2f2;
  border-color: #fecaca;
}

/* =========================
   RSVP TABLE
   ========================= */
.table-wrap{ overflow-x: visible; }

.rsvp-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.rsvp-table thead th{
  background: var(--head);
  padding: 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  font-weight: 600;
  white-space: nowrap;
}
.rsvp-table thead th:last-child{ border-right: none; }

.rsvp-table td{
  padding: 10px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.rsvp-table td:last-child{ border-right: none; }

.rsvp-table tbody tr:nth-child(even){ background:#fafafa; }

/* =========================
   EVENT INFO
   ========================= */
.event-name{
  color:#1d4ed8;
  font-weight:700;
  text-decoration:underline;
}
.event-meta{ margin-top:2px; }
.event-tag{
  margin-top:3px;
  font-weight:700;
  color:var(--brand);
}

/* =========================
   TEAM CELLS
   ========================= */
.team-cell .team-count{
  font-weight:800;
  text-align:center;
  margin-bottom:6px;
}
.team-list{
  font-size:12px;
  line-height:1.25;
}
.team-label{
  font-weight:800;
  min-width:44px;
  display:inline-block;
}

/* =========================
   RSVP CONTROLS
   ========================= */
.rsvp-controls{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.input{
  height:32px;
  width:160px;
  border:1px solid var(--line);
  border-radius:6px;
  padding:0 10px;
  font-size:12px;
}

/* =========================
   BUTTONS
   ========================= */
.btn{
  height:34px;
  padding:0 18px;
  border:none;
  border-radius:8px;
  font-weight:800;
  letter-spacing:.4px;
  cursor:pointer;
  color:#fff;
  background:var(--brand);
  box-shadow:0 2px 0 rgba(0,0,0,.12);
}
.btn:active{ transform:translateY(1px); }
.btn-no{ background:#0a5c54; }

/* =========================
   PRINT SUMMARY BUTTON
   (OPTION 2 – GREEN, SECONDARY)
   ========================= */
.btn.btn-export{
  background:var(--brand);
  color:#fff;
  opacity:0.9;                 /* slightly secondary */
  text-decoration:none;        /* anchor fix */
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.btn.btn-export:hover{
  opacity:1;
}

.btn.btn-export:active{
  transform: translateY(1px);
}

/* =========================
   TEAM RADIO BUTTONS
   ========================= */
.team-choice{
  display:flex;
  gap:12px;
  align-items:center;
}
.radio{
  display:flex;
  gap:6px;
  font-size:12px;
  font-weight:600;
}

/* =========================
   MOBILE
   ========================= */
@media (max-width: 820px){
  .rsvp-table,
  .rsvp-table tbody,
  .rsvp-table tr,
  .rsvp-table td{
    display:block;
    width:100%;
  }

  .rsvp-table thead{ display:none; }

  .rsvp-table tbody tr{
    border:1px solid var(--line);
    border-radius:12px;
    margin:10px 0;
  }

  .rsvp-table td{ padding:10px 12px; }

  .btn{
    width:100%;
    height:44px;
    font-size:16px;
  }
}

/* =========================
   PRINT (DATA ONLY)
   ========================= */
@media print {

  @page { size: landscape; margin: 0.35in; }

  nav, header, footer, .no-print, .rsvp-controls, .btn {
    display:none !important;
  }

  body{
    background:#fff;
    color:#000;
  }

  .wrap, .card{
    padding:0;
    box-shadow:none;
    border:none;
    max-width:none;
  }

  .page-head{ justify-content:center; }

  .rsvp-table{
    font-size:9px;
    line-height:1.15;
  }

  .rsvp-table th,
  .rsvp-table td{
    padding:3px 4px;
    border:1px solid #bbb;
  }

  tr{ page-break-inside: avoid; }
}

/* Grand Prix Team popup */
.gp-overlay{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,.5);
  z-index: 9999;
}
.gp-overlay.is-open{
  display: flex;
}

.gp-modal{
  width: min(440px, 94vw);
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  text-align: center;
}

/* Title */
.gp-title{
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
}

/* Body text */
.gp-text{
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.4;
}

/* Actions */
.gp-actions{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.gp-btn{
  width: 100%;
  max-width: 360px;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

/* Primary (OK) */
.gp-primary{
  border: none;
}

/* Secondary (Join link) */
.gp-secondary{
  border: 1px solid;
}

/* ==================================================
   RSVP CONFIRMATION MODAL – CLEAN LAYOUT
   ================================================== */

.gp-modal.gp-confirm {
  max-width: 560px;
}

/* container for race / runner / choice */
.gp-confirm-details {
  margin: 16px 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;                 /* LIGHT GRAY (key fix) */
  border: 1px solid var(--line);
}

/* each row: label | value */
.gp-confirm-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 14px;
  padding: 10px 0;
}

/* divider between rows */
.gp-confirm-row + .gp-confirm-row {
  border-top: 1px solid var(--line);
}

/* left column (Race / Runner / Choice) */
.gp-confirm-label {
  font-weight: 800;
  color: #374151;
  white-space: nowrap;
}

/* right column (actual text) */
.gp-confirm-value {
  font-weight: 600;
  line-height: 1.45;
  color: #111827;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* emphasis for CAN GO / CAN'T GO */
.gp-confirm-value[data-choice="GOING"] {
  color: #0b6b60;     /* brand green */
}

.gp-confirm-value[data-choice="NOT_GOING"] {
  color: #b91c1c;     /* clear red */
}

/* mobile cleanup */
@media (max-width: 520px) {
  .gp-confirm-row {
    grid-template-columns: 1fr;
  }

  .gp-confirm-label {
    font-size: 12px;
    opacity: 0.75;
  }
}

.gp-totals{
  display:block;
  margin-top:4px;
  font-size:0.95em;
  opacity:.85;
}

/* Past events accordion behavior */
.past-toggle{
  display:flex;
  align-items:center;
  gap:10px;
  margin: 10px 0 14px;
}

.past-note{
  font-size: 12px;
  color: #6b7280;
  font-weight: 600;
}

tr.past-hidden{
  display:none;
}

/* optional: visually dim past rows when shown */
tr.is-past td{
  opacity: 0.88;
}

