/* ===== Community Directory — Custom Styles ===== */

:root {
  --primary:    #1e5799;
  --primary-dk: #153f72;
  --gold:       #f8a100;
  --gold-lt:    #fff3cd;
  --bg:         #f5f7fa;
  --card-bg:    #ffffff;
  --text:       #222;
  --muted:      #6c757d;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(0,0,0,.09);
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.65;
}

/* ── Typography ── */
h1, h2, h3, h4, h5 { font-weight: 700; color: var(--primary); }
a { color: var(--primary); }

/* ── Cards ── */
.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
  font-weight: 700;
  font-size: 1.1rem;
}
.card-header.primary-header {
  background: var(--primary);
  color: #fff;
}

/* ── Hero Banner ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2e7acc 100%);
  color: #fff;
  padding: 3.5rem 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  text-align: center;
}
.hero h1 { color: #fff; font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: .5rem; }
.hero p  { color: rgba(255,255,255,.88); font-size: 1.15rem; }
.hero .badge-event {
  background: var(--gold);
  color: #333;
  font-size: .95rem;
  padding: .35em .8em;
  border-radius: 20px;
  font-weight: 600;
}

/* ── Stat Cards ── */
.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.stat-card .stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.stat-card .stat-label {
  color: var(--muted);
  font-size: .9rem;
  margin-top: .25rem;
}
.stat-card .stat-icon {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: .5rem;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dk);
  border-color: var(--primary-dk);
}
.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #222;
  font-weight: 600;
}
.btn-gold:hover { background: #e09500; border-color: #e09500; color: #222; }

/* ── Forms ── */
.form-label { font-weight: 600; margin-bottom: .3rem; }
.form-control, .form-select {
  border-radius: 7px;
  padding: .6rem .9rem;
  font-size: 1rem;
  border-color: #c9d4e0;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(30,87,153,.18);
}
.required-star { color: #dc3545; }

/* ── Tables ── */
.table th { background: #e9eff7; color: var(--primary); font-weight: 700; }
.table td { vertical-align: middle; }

/* ── Admin Sidebar ── */
.admin-sidebar {
  min-height: calc(100vh - 120px);
  background: #fff;
  border-right: 1px solid #dee2e6;
  padding: 1.5rem 0;
}
.admin-sidebar .nav-link {
  color: var(--text);
  padding: .6rem 1.2rem;
  border-radius: 0 30px 30px 0;
  margin-right: .75rem;
  font-size: 1rem;
  transition: all .15s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: #e8f0fb;
  color: var(--primary);
  font-weight: 600;
}
.admin-sidebar .nav-link i { width: 22px; }

/* ── Status badges ── */
.badge { font-size: .82rem; }

/* ── Address autocomplete ── */
.pac-container { border-radius: 8px; font-size: 1rem; }

/* ── Member card grid ── */
.member-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  height: 100%;
  transition: transform .15s;
}
.member-card:hover { transform: translateY(-2px); }
.member-card .member-name { font-weight: 700; font-size: 1.1rem; color: var(--primary); }
.member-card .member-meta { font-size: .9rem; color: var(--muted); }

/* ── Print — Avery 5305 tent card (3" × 5", 4 per sheet)
       Top half rotated 180° so it reads from the back when folded ── */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: fixed; top: 0; left: 0; width: 100%; }
  .no-print { display: none !important; }

  @page {
    size: letter portrait;
    margin: 0.5in 1.25in;
  }

  .label-sheet {
    display: grid;
    grid-template-columns: 3in 3in;
    grid-auto-rows: 5in;
    column-gap: 0;
    row-gap: 0;
  }

  .avery-label {
    width: 3in;
    height: 5in;
    box-sizing: border-box;
    border: 1px dashed #ccc;
    display: flex;
    flex-direction: column;
    page-break-inside: avoid;
    break-inside: avoid;
    overflow: hidden;
  }

  .print-excluded {
    display: none !important;
  }

  /* Each half fills exactly 2.5in */
  .label-half {
    height: 2.5in;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.2in 0.25in;
  }

  /* Top half flipped — reads correctly from the back when tent is folded */
  .label-top {
    transform: rotate(180deg);
  }

  /* Dashed fold guide line */
  .label-fold {
    flex-shrink: 0;
    border-top: 1pt dashed #aaa;
  }

  /* Typography — same for both halves */
  .label-half .lbl-event   { font-size: 7pt;  color: #888; text-transform: uppercase; letter-spacing: 1pt; margin-bottom: 6pt; }
  .label-half .lbl-name    { font-size: 20pt; font-weight: 900; color: #000; line-height: 1.15; margin-bottom: 0; }
  .label-half .lbl-divider { border-top: 1.5pt solid #1e5799; width: 1.4in; margin: 8pt auto; }
  .label-half .lbl-table   { font-size: 13pt; font-weight: 700; color: #1e5799; margin-bottom: 4pt; }
  .label-half .lbl-meal    { font-size: 11pt; color: #333; }
}

/* ── Screen preview of labels ── */
.label-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.label-preview-card {
  position: relative;
  background: #fff;
  border: 2px dashed #bcd;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, opacity .15s;
  user-select: none;
}
.label-preview-card:hover {
  border-color: var(--primary);
}
.label-preview-card.label-selected {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(30,87,153,.2);
}
.label-select-cb {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}
.label-preview-card .lbl-name  { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.label-preview-card .lbl-table { font-weight: 700; color: #555; }
.label-preview-card .lbl-meal  { color: var(--muted); font-size: .9rem; }

/* ── Responsive tweaks ── */
@media (max-width: 768px) {
  .hero { padding: 2rem 1rem; }
  .admin-sidebar { min-height: auto; border-right: none; border-bottom: 1px solid #dee2e6; padding: .5rem 0; }
  .admin-sidebar .nav-link { border-radius: 6px; margin-right: 0; display: inline-flex; }
}
