/* ============================================================
   ELECTION HUB — Election Calendar CSS
   ============================================================ */

/* Theme color tokens for election types */
:root {
  --city:    #1d6fa4;   /* muted blue */
  --state:   #2a7a47;   /* forest green */
  --federal: #0d1f3c;   /* navy */
  --primary: #c9952a;   /* gold */
  --early:   #5b6fa4;   /* slate blue */
}

/* ── Page Wrapper ── */
.cal-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Hero ── */
.cal-hero {
  text-align: center;
  margin-bottom: 32px;
  padding-top: 8px;
}

.cal-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: #0d1f3c;
  margin: 0 0 8px;
  line-height: 1.2;
}

.cal-hero h1 em {
  font-style: normal;
  color: #c9952a;
}

.cal-hero p {
  font-size: 1rem;
  color: #6b7a92;
  margin: 0;
  font-weight: 300;
}

.cal-hero-accent {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #c9952a, #e8b84b);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7a92;
  margin-right: 4px;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid #dde3ed;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
  color: #6b7a92;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(13,31,60,0.06);
}

.filter-btn:hover {
  border-color: #c9952a;
  color: #0d1f3c;
  background: #fdf8ef;
}

.filter-btn.active {
  background: linear-gradient(135deg, #0d1f3c, #1e3f6f);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(13,31,60,0.2);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
  opacity: 0.7;
}

/* ── Calendar Card ── */
.cal-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #dde3ed;
  box-shadow: 0 2px 16px rgba(13,31,60,0.08);
}

/* ── FullCalendar Overrides ── */
#calendar { margin-top: 8px; }

.fc .fc-toolbar {
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.fc .fc-toolbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: #0d1f3c;
}

.fc .fc-button {
  background: linear-gradient(135deg, #0d1f3c, #1e3f6f) !important;
  border-color: transparent !important;
  border-radius: 8px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.85rem !important;
  box-shadow: 0 2px 6px rgba(13,31,60,0.15) !important;
}

.fc .fc-button:hover {
  background: linear-gradient(135deg, #162d52, #2a5298) !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
  background: linear-gradient(135deg, #c9952a, #e8b84b) !important;
  color: #0d1f3c !important;
}

.fc-daygrid-day { min-height: 88px !important; }

.fc-daygrid-event {
  border-radius: 6px !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  font-family: 'DM Sans', sans-serif !important;
  border: none !important;
}

.fc-daygrid-event:hover {
  transform: scale(1.02);
  transition: 0.15s;
  opacity: 0.9;
}

.fc-event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-bg-event {
  background: rgba(91,111,164,0.18) !important;
  opacity: 1 !important;
}

.fc-day-today {
  background: rgba(201,149,42,0.07) !important;
}

.fc-scrollgrid { border: 1px solid #dde3ed !important; }

.fc-col-header-cell {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  color: #6b7a92;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Legend ── */
.legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #dde3ed;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #6b7a92;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Loading ── */
.cal-loading {
  display: none;
  text-align: center;
  padding: 20px;
  color: #6b7a92;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
}

.cal-loading.active { display: block; }

/* ── Modal Overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,31,60,0.5);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

/* ── Modal Box ── */
.modal-box {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0;
  box-shadow: 0 16px 48px rgba(13,31,60,0.22);
  border: 1px solid #dde3ed;
  animation: fadeUp 0.22s ease both;
}

/* ── Modal Header ── */
.modal-head {
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, #0d1f3c 0%, #1e3f6f 100%);
  border-radius: 12px 12px 0 0;
  position: relative;
}

.modal-head * { background: transparent !important; }

.modal-head h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: #ffffff;
  margin: 28px 0 4px;
  line-height: 1.3;
}

.modal-head p {
  font-size: 0.825rem;
  color: rgba(255,255,255,0.65);
  margin: 0;
}

/* ── Modal Close ── */
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close-btn:hover {
  background: rgba(201,149,42,0.3) !important;
  color: #e8b84b;
}

/* ── Modal Body ── */
.modal-body { padding: 16px 22px 20px; }

.modal-items {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-items li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #0d1f3c;
  font-family: 'DM Sans', sans-serif;
  padding: 7px 10px;
  border-radius: 6px;
  background: #f7f4ef;
  border: 1px solid #dde3ed;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .cal-page { padding: 24px 16px 60px; }
  .filter-bar { gap: 6px; }
  .filter-btn { padding: 6px 12px; font-size: 0.8rem; }
  .legend { gap: 10px; }
  .legend-item { font-size: 0.75rem; }
  .fc .fc-toolbar { flex-direction: column; align-items: flex-start; }
}
