/* =====================================================================
   SVYC Regatta — regatta.css
   Minimal, clean styling for race list, forms, and tiny buttons
   ===================================================================== */

/* ---------- Variables ---------- */
:root{
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #1f2a37;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #0e7490;

  --pending-bg:   #f3f4f6; --pending-fg:#374151;
  --course-bg:    #e6f4ff; --course-fg:#084c95;
  --started-bg:   #fff3cd; --started-fg:#7a5900;
  --finished-bg:  #e7f8ef; --finished-fg:#0f6b3a;
  --postponed-bg: #f0ecff; --postponed-fg:#3b2fb5;
  --abandoned-bg: #ffe8e6; --abandoned-fg:#9b1c1c;
  --active-bg:    #e9fbff; --active-fg:#055160;
  --recall-bg:    #fff0f0; --recall-fg:#7f1d1d;

  --radius-lg: 14px;
  --radius-sm: 8px;
  --shadow-1: 0 4px 14px rgba(0,0,0,.06);
}

/* ---------- Status chips ---------- */
.status-pending   { background:var(--pending-bg);   color:var(--pending-fg);   border-color:#e5e7eb; }
.status-course    { background:var(--course-bg);    color:var(--course-fg);    border-color:#c7e3ff; }
.status-started   { background:var(--started-bg);   color:var(--started-fg);   border-color:#ffe8a3; }
.status-finished  { background:var(--finished-bg);  color:var(--finished-fg);  border-color:#c6f0d6; }
.status-postponed { background:var(--postponed-bg); color:var(--postponed-fg); border-color:#dcd6ff; }
.status-abandoned { background:var(--abandoned-bg); color:var(--abandoned-fg); border-color:#ffd1cc; }
.status-active    { background:var(--active-bg);    color:var(--active-fg);    border-color:#b6eef7; }
.status-recall    { background:var(--recall-bg);    color:var(--recall-fg);    border-color:#ffc9c9; }

/* ---------- Base ---------- */
*{ box-sizing:border-box; }
body{
  margin:0;
  font: 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:linear-gradient(180deg, #f7fbff 0%, var(--bg) 200px);
}

/* Brand stripe */
.brand-top{
  height:4px;
  background: linear-gradient(90deg, #0e7490, #1d4ed8, #16a34a);
  border-radius: 0 0 6px 6px;
  margin-bottom: 8px;
}

/* Layout */
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

.header{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom: 12px;
}
.subhead{ color:var(--muted); font-size:.9rem; }
.header-actions .btn{ margin-left:6px; }

/* Grid of race cards */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap:16px;
  margin-top: 12px;
}

.race-card{
  background: var(--card);
  border:1px solid var(--line);
  border-radius: var(--radius-lg);
  padding:16px;
  box-shadow: var(--shadow-1);
}

.race-title{
  margin:6px 0 4px;
  font-size:1.05rem;
  font-weight:800;
}

.race-meta{
  font-size:.9rem;
  color:var(--muted);
  margin-bottom:10px;
}

/* Status pill */
.status-chip{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  font-size:.78rem;
  border:1px solid transparent; /* border-color overridden by .status-* */
  margin-bottom:6px;
}

/* Buttons */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:10px 12px;
  border-radius: var(--radius-sm);
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  font-weight:600;
}
.btn.ghost{ background:transparent; }
.btn.small{ padding:6px 10px; font-size:.9rem; }
.btn.primary{ border-color:transparent; background:var(--brand); color:#fff; }
.btn.primary:hover{ filter:brightness(0.95); }

.btn-row.tiny{ display:flex; gap:6px; }
.btn-row.tiny .inline{ display:inline; margin:0; }
.btn-row.tiny .btn{ padding:6px 8px; font-size:.82rem; }
.btn-row .btn{ width:auto; }

/* Sections / tables */
.section{
  background:#fff; border:1px solid var(--line); border-radius:var(--radius-lg);
  padding:16px; box-shadow:var(--shadow-1);
}

/* Footer */
footer{
  color:var(--muted); font-size:.9rem; text-align:center; padding:28px 0 36px;
}

/* ---------- Forms ---------- */
label{ display:block; margin:8px 0 6px; font-weight:600; }
input[type="text"], input[type="email"], input[type="number"], select, textarea{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px;
  background:#fff; color:var(--text);
}
input:focus, select:focus, textarea:focus{
  outline:none; border-color:#b6ccf7; box-shadow:0 0 0 3px rgba(29,78,216,.12);
}

/* Nicer select with custom chevrons */
select, .select-box {
  width: 100%;
  padding: 10px 36px 10px 12px; /* room for arrow */
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #fff;
  color: var(--text);
  font-size: 0.95rem;
  appearance: none; /* remove native arrow */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select:focus, .select-box:focus {
  border-color: #b6ccf7;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
  outline: none;
}
select:disabled, .select-box:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  background-image: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px){
  .header{ flex-wrap:wrap; }
  .grid{ grid-template-columns: 1fr; } /* single-column on mobile */
  .container { padding: 12px; }
  .race-card { padding: 18px 16px; border-radius: 16px; }
  .race-title { font-size: 1.15rem; }
  .race-meta  { font-size: 1rem; }
  .status-chip { font-size: .9rem; padding: 6px 10px; }
  .btn-row.tiny .btn { padding: 10px 12px; font-size: .95rem; }
  .header-actions { display:flex; gap:8px; flex-wrap:wrap; }
  .header-actions .btn { padding: 8px 10px; font-size: .95rem; }
}
