/* ============================================================
   Vale of Clwyd Scout District — Booking System Stylesheet
   ============================================================ */

/* ── Custom properties ─────────────────────────────────────── */
:root {
  --purple-dark:  #2D0A5E;
  --purple:       #7B1FA2;
  --purple-light: #CE93D8;
  --purple-pale:  #F3E5F5;
  --teal:         #00897B;
  --teal-light:   #E0F2F1;
  --amber:        #E65100;
  --amber-light:  #FFF3E0;
  --green:        #2E7D32;
  --green-light:  #E8F5E9;
  --red:          #C62828;
  --red-light:    #FFEBEE;
  --blue:         #1565C0;
  --blue-light:   #E3F2FD;
  --grey-50:      #FAFAFA;
  --grey-100:     #F5F5F5;
  --grey-200:     #EEEEEE;
  --grey-300:     #E0E0E0;
  --grey-500:     #9E9E9E;
  --grey-700:     #616161;
  --grey-900:     #212121;

  --radius:       12px;
  --radius-sm:    6px;
  --shadow:       0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --transition:   0.15s ease;
  --max-width:    1100px;
  --nav-height:   56px;
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--grey-900);
  background: var(--grey-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: 'Nunito', 'Arial Black', system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.25;
  color: var(--purple-dark);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

hr.divider { border: none; border-top: 1px solid var(--grey-200); margin: 1.5rem 0; }
.section-heading { font-size: 0.95rem; font-weight: 700; color: var(--grey-700); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.75rem; }
.text-muted { color: var(--grey-500); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--purple-dark);
  height: var(--nav-height);
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.navbar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.navbar__brand { color: #fff; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.1rem; letter-spacing: 0.02em; white-space: nowrap; }
.navbar__brand:hover { text-decoration: none; color: var(--purple-light); }
.navbar__links { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.navbar__link {
  color: rgba(255,255,255,.85);
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  border: none; background: none; cursor: pointer; font-family: inherit; font-weight: 600;
}
.navbar__link:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.navbar__link--cta { background: var(--purple); color: #fff; margin-left: 0.25rem; }
.navbar__link--cta:hover { background: var(--purple-light); }
.navbar__link--btn { appearance: none; }
.navbar__toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; margin-left: auto; }

@media (max-width: 640px) {
  .navbar__toggle { display: block; }
  .navbar__links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--purple-dark);
    padding: 0.75rem 1.25rem 1rem;
    gap: 0.15rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
  }
  .navbar__links.open { display: flex; }
  .navbar__link { width: 100%; }
}

/* ── Main content ──────────────────────────────────────────── */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  background: var(--purple-dark);
  color: rgba(255,255,255,.7);
  font-size: 0.875rem;
  padding: 1.25rem 1.25rem;
}
.footer__inner { max-width: var(--max-width); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.footer__links { display: flex; gap: 1rem; }
.footer__links a { color: rgba(255,255,255,.7); }
.footer__links a:hover { color: #fff; }

/* ── Auth layout ───────────────────────────────────────────── */
.auth-wrap { display: flex; justify-content: center; padding-top: 2rem; }
.auth-card { width: 100%; max-width: 440px; }

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card__header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--grey-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card__title { font-size: 1.05rem; font-weight: 800; color: var(--purple-dark); margin: 0; }
.card__action { font-size: 0.875rem; color: var(--purple); font-weight: 600; white-space: nowrap; }
.card__body { padding: 1.25rem; }
.card__footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--grey-200); background: var(--grey-50); font-size: 0.9rem; }
.card__footer p { margin: 0.25rem 0; }

/* ── Page header ───────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header__eyebrow { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--purple); margin-bottom: 0.25rem; }
.page-header__eyebrow a { color: var(--purple); }
.page-header__title { font-size: 2rem; font-weight: 900; color: var(--purple-dark); }
.page-header__subtitle { color: var(--grey-700); margin-top: 0.25rem; }
.page-header__actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Stat cards ────────────────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card__value { font-family: 'Nunito', sans-serif; font-size: 2.25rem; font-weight: 900; color: var(--purple-dark); line-height: 1; }
.stat-card__label { font-size: 0.85rem; color: var(--grey-700); margin-top: 0.25rem; font-weight: 600; }
.stat-card--amber .stat-card__value { color: var(--amber); }
.stat-card--red .stat-card__value { color: var(--red); }
.stat-card--green .stat-card__value { color: var(--green); }

/* ── Event cards ───────────────────────────────────────────── */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.event-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 4px solid var(--purple);
  transition: box-shadow var(--transition), transform var(--transition);
}
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.event-card--district { border-top-color: var(--purple); }
.event-card--county   { border-top-color: var(--teal); }
.event-card--camp     { border-top-color: var(--green); }
.event-card--residential { border-top-color: var(--amber); }
.event-card__body { padding: 1rem 1.125rem 1rem; }
.event-card__meta-top { display: flex; gap: 0.4rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.event-card__title { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.35rem; }
.event-card__title a { color: var(--purple-dark); }
.event-card__meta { font-size: 0.875rem; color: var(--grey-700); margin: 0.2rem 0; }
.event-card__cost { font-size: 0.875rem; margin-top: 0.5rem; }
.event-card__footer { padding: 0.75rem 1.125rem; border-top: 1px solid var(--grey-100); display: flex; gap: 0.5rem; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  white-space: nowrap;
}
.badge--purple  { background: var(--purple-pale); color: var(--purple); }
.badge--teal    { background: var(--teal-light);  color: var(--teal); }
.badge--amber   { background: var(--amber-light); color: var(--amber); }
.badge--red     { background: var(--red-light);   color: var(--red); }
.badge--green   { background: var(--green-light); color: var(--green); }
.badge--blue    { background: var(--blue-light);  color: var(--blue); }
.badge--grey    { background: var(--grey-200);    color: var(--grey-700); }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus { outline: 3px solid var(--purple-light); outline-offset: 2px; }
.btn--primary   { background: var(--purple); color: #fff; border-color: var(--purple); }
.btn--primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); }
.btn--outline   { background: transparent; color: var(--purple); border-color: var(--purple); }
.btn--outline:hover { background: var(--purple-pale); }
.btn--teal      { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn--teal:hover { background: #00695C; border-color: #00695C; }
.btn--danger    { background: var(--red); color: #fff; border-color: var(--red); }
.btn--danger:hover { background: #B71C1C; border-color: #B71C1C; }
.btn--ghost     { background: transparent; color: var(--grey-700); border-color: var(--grey-300); }
.btn--ghost:hover { background: var(--grey-100); }
.btn--grey      { background: var(--grey-200); color: var(--grey-900); border-color: var(--grey-200); }
.btn--amber     { background: var(--amber); color: #fff; border-color: var(--amber); }
.btn--sm        { padding: 0.3rem 0.75rem; font-size: 0.82rem; }
.btn--block     { width: 100%; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .form-row { grid-template-columns: 1fr; } }
.form-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--grey-900); }
.form-hint  { font-size: 0.8rem; color: var(--grey-500); margin-top: 0.25rem; }
.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--grey-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--grey-900);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: auto;
}
.form-control:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(123,31,162,.15);
}
.form-control[disabled] { background: var(--grey-100); color: var(--grey-500); cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-check { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; font-size: 0.9rem; }
.form-check input[type="checkbox"] { margin-top: 0.2rem; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--purple); }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.4rem; }

/* ── Alerts ────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border-left: 4px solid transparent;
}
.alert--success { background: var(--green-light); border-color: var(--green); color: #1B5E20; }
.alert--error   { background: var(--red-light);   border-color: var(--red);   color: #7F0000; }
.alert--warning { background: var(--amber-light); border-color: var(--amber); color: #BF360C; }
.alert--info    { background: var(--blue-light);  border-color: var(--blue);  color: #0D47A1; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--grey-100); color: var(--grey-700); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.6rem 0.75rem; text-align: left; border-bottom: 2px solid var(--grey-200); white-space: nowrap; }
td { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--grey-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--grey-50); }

/* ── Detail list ───────────────────────────────────────────── */
.detail-list { display: grid; grid-template-columns: 150px 1fr; gap: 0.35rem 1rem; font-size: 0.9rem; margin-bottom: 1rem; }
.detail-list dt { color: var(--grey-500); font-weight: 600; }
.detail-list dd { margin: 0; }
@media (max-width: 480px) { .detail-list { grid-template-columns: 1fr; } .detail-list dt { margin-top: 0.5rem; } }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--grey-500); font-size: 0.95rem; }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--grey-200); margin-bottom: 1.25rem; }
.tab {
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--grey-700);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  font-family: inherit;
}
.tab:hover { color: var(--purple); }
.tab--active { color: var(--purple); border-bottom-color: var(--purple); }

/* ── Pagination ────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; font-size: 0.9rem; }

/* ── Young person list item ────────────────────────────────── */
.yp-list { display: flex; flex-direction: column; gap: 0.75rem; }
.yp-item { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem; background: var(--grey-50); border-radius: var(--radius-sm); border: 1px solid var(--grey-200); gap: 1rem; flex-wrap: wrap; }
.yp-item__info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.yp-item__actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ── Invite item ───────────────────────────────────────────── */
.invite-item { padding: 0.75rem 0; border-bottom: 1px solid var(--grey-100); }
.invite-item:last-child { border-bottom: none; }
.invite-item--revoked { opacity: 0.5; }
.invite-item__info { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.25rem; }
.invite-code { background: var(--grey-100); padding: 0.15rem 0.4rem; border-radius: 4px; font-family: monospace; }

/* ── Event description ─────────────────────────────────────── */
.event-description { font-size: 0.95rem; line-height: 1.7; color: var(--grey-700); margin: 1rem 0; white-space: pre-line; }

/* ── Code ──────────────────────────────────────────────────── */
code { background: var(--grey-100); padding: 0.1em 0.4em; border-radius: 4px; font-family: monospace; font-size: 0.9em; }
pre { background: var(--grey-100); padding: 0.75rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.85rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .page-header__title { font-size: 1.5rem; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .events-grid { grid-template-columns: 1fr; }
  .main-content { padding: 1rem 1rem 2rem; }
  .card__body { padding: 1rem; }
}
