/* ==========================================================================
   EVENT CALENDAR & SCHEDULE STYLES
   ========================================================================== */

.calendar-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  overflow: hidden;
}

.calendar-top-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.calendar-title-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.calendar-current-month {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  min-width: 220px;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.cal-nav-btn:hover {
  background: var(--gold-400);
  color: var(--primary-950);
}

.calendar-view-toggles {
  display: flex;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  padding: 0.25rem;
  border-radius: var(--radius-full);
}

.cal-view-btn {
  padding: 0.4rem 1rem;
  font-size: var(--text-xs);
  font-weight: 700;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.cal-view-btn.active {
  background: var(--primary-900);
  color: var(--white);
}

/* Category Filter Tags */
.calendar-category-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.cal-filter-chip {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cal-filter-chip:hover, .cal-filter-chip.active {
  background: var(--gold-500);
  color: var(--primary-950);
  border-color: var(--gold-500);
}

/* Monthly Grid View */
.calendar-grid-view {
  display: block;
}

.cal-weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.5rem;
}

.cal-day-cell {
  background: var(--bg-surface);
  min-height: 110px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: background var(--transition-fast);
}

.cal-day-cell.other-month {
  background: var(--bg-surface-alt);
  opacity: 0.45;
}

.cal-day-cell.today {
  background: var(--gold-50);
}

.cal-day-cell.today .day-number {
  background: var(--gold-500);
  color: var(--primary-950);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-number {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.cal-event-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  background: var(--primary-50);
  color: var(--primary-700);
  border-left: 2.5px solid var(--primary-600);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cal-event-pill:hover {
  transform: scale(1.02);
  background: var(--primary-100);
}

.cal-event-pill.cat-worship {
  background: var(--gold-100);
  color: var(--gold-600);
  border-left-color: var(--gold-500);
}

.cal-event-pill.cat-support {
  background: var(--ruby-100);
  color: var(--ruby-600);
  border-left-color: var(--ruby-500);
}

.cal-event-pill.cat-children {
  background: var(--emerald-100);
  color: var(--emerald-600);
  border-left-color: var(--emerald-500);
}

/* Agenda / List View */
.calendar-agenda-view {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

.agenda-event-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  transition: all var(--transition-fast);
}

.agenda-event-card:hover {
  border-color: var(--gold-400);
  box-shadow: var(--shadow-md);
}

.agenda-date-box {
  text-align: center;
  background: var(--bg-surface-alt);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.agenda-date-box .month {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--gold-600);
}

.agenda-date-box .day {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.agenda-event-info h4 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.agenda-event-meta {
  display: flex;
  gap: 1rem;
  font-size: var(--text-xs);
  color: var(--text-secondary);
  flex-wrap: wrap;
}

/* Modal Event Detail Dialog */
.event-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.event-modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  max-width: 540px;
  width: 100%;
  padding: 2.25rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  position: relative;
  animation: zoom-in 0.25s ease;
}

@keyframes zoom-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
  .cal-day-cell {
    min-height: 75px;
    padding: 0.25rem;
  }
  .cal-event-pill {
    font-size: 0.6rem;
    padding: 0.15rem;
  }
  .agenda-event-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
