/* FYG Volleyball — mobile-first stylesheet */

:root {
  --navy: #14213d;
  --navy-2: #1d2f57;
  --accent: #fc7a1e;
  --accent-dark: #e0660d;
  --ink: #1a1a1a;
  --muted: #5c6470;
  --line: #dfe3ea;
  --bg: #f4f6fa;
  --open: #16a34a;     /* slot availability: open */
  --filling: #eab308;  /* filling up */
  --full: #dc2626;     /* full */
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */

.site-header {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  font-style: italic;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand span { color: var(--accent); }

.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav form { margin: 0; }
.nav-user { font-size: 0.9rem; opacity: 0.85; margin-right: 4px; }

/* ---------- Layout ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 14px;
  font-size: 0.85rem;
}

h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* ---------- Cards & forms ---------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  margin-bottom: 16px;
}

.field { margin-bottom: 14px; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

label .opt { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="number"], input[type="date"],
input[type="time"], select, textarea {
  width: 100%;
  min-height: 48px;           /* comfortable thumb target */
  padding: 10px 12px;
  font-size: 1rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.field-row { display: flex; gap: 10px; }
.field-row > .field { flex: 1; }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 4px;
  margin: 0 0 16px;
}

legend { font-weight: 700; font-size: 0.95rem; padding: 0 6px; }

.radio-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.radio-pill {
  flex: 1;
  min-width: 90px;
}

.radio-pill input { position: absolute; opacity: 0; }

.radio-pill span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.radio-pill input:checked + span {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.radio-pill input:disabled + span {
  opacity: 0.45;
  cursor: not-allowed;
}

.hint { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

.schedule-tools { margin-top: 14px; }

/* ---------- Month planner calendar ---------- */

.cal-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cal-nav h2 { margin: 0; }

.age-header { margin: 14px 0 2px; }
.age-boxes { display: flex; gap: 10px; flex-wrap: wrap; }
.age-slot { flex: 1; min-width: 130px; }
.age-slot .slot-time { white-space: nowrap; }

.cal {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 10px;
}

.cal th {
  font-size: 0.8rem;
  padding: 4px 0;
  text-align: center;
}

.cal th input { display: block; margin: 0 auto 2px; width: 18px; height: 18px; }

.cal-cell {
  position: relative;
  height: 62px;
  border: 1px solid var(--line);
  vertical-align: top;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.cal-off { background: #f3f4f6; cursor: default; }

.cal-daynum {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 0.75rem;
  color: var(--muted);
}

.cal-off .cal-daynum { color: #c2c7cf; }

.cal-existing {
  position: absolute;
  bottom: 3px;
  left: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #b91c1c;
}

.cal-has { border-color: #fca5a5; }

.cal-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 26px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
}

.cal-selected { background: var(--navy); }
.cal-selected .cal-count { color: #fff; }
.cal-selected .cal-daynum { color: rgba(255, 255, 255, 0.7); }
.cal-selected .cal-existing { color: #fca5a5; }

.cal-arrows {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 2px;
}

.cal-arrows button, .cal-x {
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}

.cal-arrows button { font-size: 0.7rem; color: #fff; }

.cal-x {
  position: absolute;
  top: 1px;
  right: 2px;
  display: none;
  font-size: 0.85rem;
  color: rgba(220, 38, 38, 0.65);   /* translucent red */
  font-weight: 700;
}

/* The +/- arrows and the red X live on selected days; on mouse devices
   they appear on hover, on touch they're always shown. */
.cal-selected .cal-arrows, .cal-selected .cal-x { display: flex; }
@media (hover: hover) {
  .cal-selected .cal-arrows, .cal-selected .cal-x { display: none; }
  .cal-selected:hover .cal-arrows { display: flex; }
  .cal-selected:hover .cal-x { display: block; }
}

/* ---------- Athlete directory + announcements ---------- */

.filter-bar { padding-bottom: 6px; }
.filter-bar .field-row { align-items: end; }

.announce-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.athlete-pick input { width: 22px; height: 22px; }
.athlete-info { flex: 1; min-width: 200px; }

.recipients-card {
  max-height: 130px;
  overflow-y: auto;
  font-size: 0.9rem;
}

.filter-panel { margin-top: 10px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-block { display: block; width: 100%; }

.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.9rem;
}

.btn-ghost:hover { border-color: #fff; }

/* ---------- Flash messages ---------- */

.flash {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-weight: 600;
}

.flash-error { background: #fdecec; color: #a41623; border: 1px solid #f5c2c7; }
.flash-ok { background: #e7f6ec; color: #14532d; border: 1px solid #bbe5c8; }

/* ---------- Slot availability colors (used from Phase 3 on) ---------- */

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot-open { background: var(--open); }
.dot-filling { background: var(--filling); }
.dot-full { background: var(--full); }

/* ---------- Schedule page ---------- */

.session-card h2 { margin: 0 0 2px; }
.session-when { color: var(--muted); margin: 0 0 12px; font-weight: 600; }

.session-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.session-slots {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  padding-top: 4px;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 0 12px;
}

.badge-in { background: #e7f6ec; color: #14532d; border: 1px solid #bbe5c8; }
.badge-wait { background: #fef6e0; color: #854d0e; border: 1px solid #f3dfa0; }

.btn-ghost-dark {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line);
}

.btn-ghost-dark:hover { border-color: var(--navy); }

/* Big tappable "select this session" checkbox */
.pick-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.pick-box input { width: 22px; height: 22px; accent-color: var(--accent); }
.pick-box:has(input:checked) { border-color: var(--accent); background: #fff7f0; }

/* Optional "show signed-up athletes" toggle */
.show-athletes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.show-athletes input { width: 18px; height: 18px; accent-color: var(--navy); }

.athlete-list {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
  font-size: 0.92rem;
}

.athlete-list p { margin: 4px 0; }

/* Sticky bar with the confirm button */
.confirm-bar {
  position: sticky;
  bottom: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(20, 33, 61, 0.18);
}

/* Confirmation screen rows */
.confirm-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.confirm-row:last-child { border-bottom: none; }
.confirm-mark { font-size: 1.2rem; font-weight: 800; }

.btn-block + .btn-block { margin-top: 10px; }

/* ---------- Dashboard "my sessions" list ---------- */

.my-session {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.my-session:last-of-type { border-bottom: none; }
.my-session .badge { margin: 6px 0 0; }
.my-session form { margin: 0; }

/* ---------- Admin pages ---------- */

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.admin-actions form { margin: 0; }

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.card > .admin-row:last-of-type { border-bottom: none; }
.admin-row form { margin: 0; }

.session-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.session-link:hover { border-color: var(--navy); }
.session-link .session-when { margin-bottom: 0; }

.btn-danger { background: var(--full); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.qr-card { text-align: center; }
.qr-preview { max-width: 220px; width: 100%; border-radius: 8px; }

.audit-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.audit-row:last-child { border-bottom: none; }

/* ---------- Wider screens ---------- */

@media (min-width: 700px) {
  .page { max-width: 720px; }
  h1 { font-size: 1.8rem; }
}

/* ---------- Scheduled ("go live later") schedule changes ---------- */

.golive-row { align-items: center; gap: 18px; }

.golive-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.golive-choice input { width: 20px; height: 20px; accent-color: var(--accent); }

.pending-card { border-left: 4px solid var(--accent); }
.pending-card h2 { margin-bottom: 6px; }
.pending-card p { margin-bottom: 12px; }
