/* ═══════════════════════════════════════════════════
   EVENT CALENDAR DASHBOARD STYLES
   Overstrand Municipality - Events Management System
   ═══════════════════════════════════════════════════ */
   
   .wrap_site.layout_1c {
    display: flex;
    max-width: 1000px; 
    margin: 0 auto;
    padding: 0 10px;
    flex-wrap: wrap;
}

/* ═══════════════ 1. RESET & BASE ═══════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #222;
}

body {
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
}

/* ═══════════════ 2. LAYOUT ═══════════════ */
.calendar-page {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  padding: 8px;
  gap: 8px;
}

/* ═══════════════ 3. CONTROLS BAR ═══════════════ */
.controls-bar {
  background: #fff;
  border-bottom: 2px solid #eaeaea;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.month-heading {
  font-size: 16px;
  font-weight: 700;
  color: #00467e;
  min-width: 160px;
}

.month-event-count {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  background: #f4f6f9;
  border: 1px solid #dce3ed;
  border-radius: 12px;
  padding: 2px 10px;
}

.nav-group { display: flex; align-items: center; gap: 6px; }

.nav-btn {
  background: #f4f6f9;
  border: 1px solid #dce3ed;
  border-radius: 4px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #00467e;
  font-size: 13px; font-weight: 700;
  transition: background 0.15s;
}
.nav-btn:hover { background: #dce3ed; }

.month-select {
  background: #f4f6f9;
  border: 1px solid #dce3ed;
  border-radius: 4px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  color: #333; cursor: pointer; outline: none;
}
.month-select:focus { border-color: #00467e; }

.filter-group { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.ctrl-label {
  font-size: 11px; font-weight: 600;
  color: #888; text-transform: uppercase;
  letter-spacing: 0.06em; white-space: nowrap;
}

.filter-select {
  background: #f4f6f9;
  border: 1px solid #dce3ed;
  border-radius: 4px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12px; font-weight: 600;
  color: #333; cursor: pointer; outline: none;
  min-width: 140px;
}
.filter-select:focus { border-color: #00467e; }

/* ── Availability toggle ── */
.avail-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.avail-toggle input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #00467e;
  cursor: pointer;
}

.avail-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}

/* ═══════════════ 4. CALENDAR CONTAINER ═══════════════ */
.calendar-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-bottom: 2px solid #eaeaea;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 8px 8px 6px;
  background: #f4f6f9;
  border-bottom: 2px solid #dce3ed;
  flex-shrink: 0;
}

.cal-header-cell {
  text-align: center;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #00467e; padding: 4px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: auto;
  gap: 4px;
  padding: 6px 8px 8px;
  flex: 1 1 auto;
  overflow-y: auto;
  min-height: 0;
  align-content: start;
}

/* ═══════════════ 5. DAY CELLS ═══════════════ */
.cal-empty {
  background: #fafbfc;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  min-height: 80px;
}

.cal-day {
  background: #fff;
  border: 1px solid #e6edf4;
  border-radius: 8px;
  padding: 6px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: visible;
  transition: box-shadow 0.15s;
}

.cal-day:hover { box-shadow: 0 2px 8px rgba(0,70,126,0.1); border-color: #c5d9f0; }

.cal-day.today {
  border-color: #00467e;
  border-width: 2px;
  background: #f0f7ff;
}

/* ── Day number row ── */
.cal-day-num-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 4px;
}

.cal-day-num {
  font-size: 11px; font-weight: 700;
  color: #555; background: #f4f6f9;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.cal-day-num.today-badge { background: #00467e; color: #fff; }

/* ── Inline availability pill (sits right of day number) ── */
.cal-avail-inline {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.cal-avail-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  font-family: "Consolas", monospace;
  border-radius: 10px;
  padding: 2px 7px;
  white-space: nowrap;
  border: 1px solid;
}

.cal-avail-pill i { font-size: 8px; }

.cal-avail-pill-green {
  background: rgba(46,125,50,0.12);
  border-color: rgba(46,125,50,0.35);
  color: #2e7d32;
}

.cal-avail-pill-red {
  background: rgba(176,0,32,0.1);
  border-color: rgba(176,0,32,0.3);
  color: #b00020;
}

.cal-no-events {
  font-size: 10px; color: #ddd;
  text-align: center; flex: 1;
  display: flex; align-items: center; justify-content: center;
}

/* ═══════════════ 6. AREA BADGES ═══════════════ */
.cal-area-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px; font-weight: 700;
  border: 1px solid;
  border-radius: 12px;
  padding: 3px 8px;
  cursor: pointer;
  transition: filter 0.12s, transform 0.12s;
  align-self: flex-start;
  width: 100%;
  justify-content: space-between;
}

.cal-area-badge:hover {
  filter: brightness(0.92);
  transform: translateX(1px);
}

.cal-area-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 9px; font-weight: 900;
  min-width: 17px; height: 17px;
  padding: 0 4px;
}

/* ═══════════════ 7. LOADING & ERROR ═══════════════ */
.cal-loader {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #888; font-size: 13px;
  padding: 60px 0;
}

.spinner {
  width: 18px; height: 18px;
  border: 2px solid #ddd;
  border-top-color: #00467e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════ 8. MODAL ═══════════════ */
.modal {
  display: none;
  position: fixed; inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  align-items: center; justify-content: center;
  animation: fadeIn 0.2s;
}
.modal.active { display: flex; }

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 90%; max-width: 480px;
  max-height: 80vh; overflow: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  animation: slideIn 0.25s;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 2px solid #e0e0e0;
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0;
  background: #fff; z-index: 10;
  border-radius: 12px 12px 0 0;
}

.modal-title { font-size: 15px; font-weight: 700; color: #00467e; }

.modal-close {
  background: none; border: none;
  font-size: 24px; cursor: pointer; color: #666;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  line-height: 1; padding: 0;
}
.modal-close:hover { background: #f0f0f0; }

.modal-body { padding: 16px 20px 20px; }

/* ── Area modal event list ── */
.area-modal-list { display: flex; flex-direction: column; gap: 12px; }

.area-modal-event-card {
  border: 1px solid #dce3ed;
  border-radius: 8px;
  overflow: hidden;
}

.area-modal-time {
  background: #00467e;
  color: #fff;
  padding: 7px 12px;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}
.area-modal-time i { opacity: 0.8; }

.area-modal-rows { display: flex; flex-direction: column; }

.area-modal-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f2f5;
}
.area-modal-row:last-child { border-bottom: none; }

.area-modal-row i {
  color: #00467e; font-size: 12px;
  width: 14px; margin-top: 3px;
  flex-shrink: 0; opacity: 0.7;
}

.area-modal-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: #aaa; margin-bottom: 1px;
}

.area-modal-value {
  font-size: 13px; font-weight: 600; color: #222;
}

/* ── Availability modal ── */
.avail-modal-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}


.avail-modal-slot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(46,125,50,0.08);
  border: 1px solid rgba(46,125,50,0.25);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}

.avail-modal-venue-name {
  font-size: 12px;
  font-weight: 700;
  color: #00467e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.avail-modal-venue-name i {
  font-size: 11px;
  opacity: 0.7;
}

.avail-modal-slot-time {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.avail-modal-slot-time i {
  color: #2e7d32;
  font-size: 15px;
  margin-top: 2px;
  flex-shrink: 0;
}


/* ═══════════════ 9. ANIMATIONS ═══════════════ */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }