/* ============================================
   CCS Academic Calendar – Notion-style Design
   ============================================ */

/* --- Wrapper --- */
.ccs-acal-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* --- Header --- */
.ccs-acal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.ccs-acal-title {
  font-family: 'Canela trial', 'Georgia', serif;
  font-size: 24px;
  font-weight: 500;
  color: #1a1a2e;
  margin: 0;
}

/* --- View Toggle --- */
.ccs-acal-view-toggle {
  display: flex;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
}

.ccs-acal-btn {
  padding: 5px 16px;
  border: none;
  background: #fff;
  color: #555;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ccs-acal-btn:hover {
  background: #f5f5f5;
}

.ccs-acal-btn.active {
  background: #1a1a2e;
  color: #fff;
}

/* --- Legend --- */
.ccs-acal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
}

.ccs-acal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #555;
  cursor: default;
}

.ccs-acal-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================
   FullCalendar Overrides – multiMonthYear
   ============================================ */

/* Calendar container */
#ccs-acal-calendar {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  overflow: hidden;
}

/* Remove default FC borders */
#ccs-acal-calendar .fc {
  --fc-border-color: #e8e8e8;
  --fc-today-bg-color: rgba(26, 26, 46, 0.05);
  --fc-neutral-bg-color: transparent;
  --fc-page-bg-color: #fff;
  --fc-small-font-size: 10px;
}

/* Multi-month title (month name) */
#ccs-acal-calendar .fc-multimonth-title {
  font-family: 'Canela trial', 'Georgia', serif;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a2e;
  padding: 8px 8px 4px;
}

/* Month grid spacing */
#ccs-acal-calendar .fc-multimonth {
  border: none;
}

#ccs-acal-calendar .fc-multimonth-month {
  padding: 2px 4px 6px;
}

/* Day header (Mon, Tue…) */
#ccs-acal-calendar .fc-col-header-cell {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: #aaa;
  padding: 2px 0;
}

#ccs-acal-calendar .fc-col-header-cell-cushion {
  text-decoration: none;
  padding: 2px 0;
}

/* Day cells */
#ccs-acal-calendar .fc-daygrid-day {
  min-height: 0 !important;
}

#ccs-acal-calendar .fc-daygrid-day-frame {
  min-height: 36px !important;
  padding: 1px !important;
}

#ccs-acal-calendar .fc-daygrid-day-top {
  flex-direction: row;
}

#ccs-acal-calendar .fc-daygrid-day-number {
  font-size: 11px;
  color: #444;
  padding: 1px 3px;
  text-decoration: none;
  line-height: 18px;
}

/* Today highlight */
#ccs-acal-calendar .fc-day-today .fc-daygrid-day-number {
  background: #1a1a2e;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 10px;
}

/* Event bars – visible color bars */
#ccs-acal-calendar .fc-daygrid-event {
  border: none;
  border-radius: 2px;
  font-size: 0;
  padding: 0;
  margin: 1px 1px;
  line-height: 1;
  min-height: 5px;
  max-height: 5px;
  overflow: hidden;
}

#ccs-acal-calendar .fc-daygrid-block-event .fc-event-title,
#ccs-acal-calendar .fc-daygrid-block-event .fc-event-time {
  display: none;
}

#ccs-acal-calendar .fc-daygrid-dot-event {
  padding: 0;
}

/* Event body */
#ccs-acal-calendar .fc-daygrid-event-harness {
  margin-bottom: 1px;
}

#ccs-acal-calendar .fc-daygrid-day-events {
  margin-top: 1px;
  min-height: 0 !important;
}

/* +more link */
#ccs-acal-calendar .fc-daygrid-more-link {
  font-size: 9px;
  color: #666;
  font-weight: 600;
  line-height: 1.2;
  padding: 1px 0;
}

/* Event cursor */
#ccs-acal-calendar .fc-event {
  cursor: pointer;
}

/* Compact table layout – override FullCalendar inline heights */
#ccs-acal-calendar .fc-scrollgrid-sync-table,
#ccs-acal-calendar .fc-multimonth-daygrid-table {
  height: auto !important;
  border-spacing: 0;
}

#ccs-acal-calendar .fc-daygrid-body,
#ccs-acal-calendar .fc-multimonth-daygrid {
  height: auto !important;
}

#ccs-acal-calendar .fc-scrollgrid-sync-table td,
#ccs-acal-calendar .fc-scrollgrid-sync-table th {
  padding: 0;
}

#ccs-acal-calendar .fc-multimonth-daygrid {
  padding: 0;
}

#ccs-acal-calendar .fc-multimonth-header {
  padding: 0;
}

#ccs-acal-calendar .fc-scrollgrid {
  border-spacing: 0;
}

/* ============================================
   FullCalendar Overrides – listYear
   ============================================ */

#ccs-acal-calendar .fc-list {
  border: none;
}

#ccs-acal-calendar .fc-list-day-cushion {
  background: #f5f5f5;
  font-family: 'Canela trial', 'Georgia', serif;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a2e;
}

#ccs-acal-calendar .fc-list-event td {
  padding: 8px 12px;
  border-color: #e8e8e8;
}

#ccs-acal-calendar .fc-list-event:hover td {
  background: #fafafa;
}

#ccs-acal-calendar .fc-list-event-dot {
  border-radius: 50%;
}

#ccs-acal-calendar .fc-list-event-title a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

#ccs-acal-calendar .fc-list-event-time {
  color: #888;
  font-size: 13px;
}

/* Empty list message */
#ccs-acal-calendar .fc-list-empty-cushion {
  font-style: italic;
  color: #999;
}

/* ============================================
   Event Modal
   ============================================ */

.ccs-acal-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ccs-acal-modal.open {
  visibility: visible;
  opacity: 1;
}

.ccs-acal-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.ccs-acal-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 85vh;
  padding: 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.ccs-acal-modal.open .ccs-acal-modal-content {
  transform: translateY(0);
}

.ccs-acal-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.15s;
}

.ccs-acal-modal-close:hover {
  background: rgba(255, 255, 255, 1);
}

.ccs-acal-modal-color-bar {
  height: 6px;
  width: 100%;
}

.ccs-acal-modal-title {
  font-family: 'Canela trial', 'Georgia', serif;
  font-size: 22px;
  font-weight: 500;
  color: #1a1a2e;
  margin: 20px 24px 8px;
}

.ccs-acal-modal-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 24px 16px;
  flex-wrap: wrap;
}

.ccs-acal-modal-dates {
  font-size: 14px;
  color: #666;
}

.ccs-acal-modal-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.ccs-acal-modal-description {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  margin: 0 24px 24px;
  padding-top: 16px;
  border-top: 1px solid #e8e8e8;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 1024px) {
  .ccs-acal-title {
    font-size: 20px;
  }

  .ccs-acal-legend {
    gap: 8px;
  }

  .ccs-acal-legend-item {
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .ccs-acal-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .ccs-acal-title {
    font-size: 18px;
  }

  .ccs-acal-legend {
    gap: 6px;
    padding: 6px 10px;
  }

  .ccs-acal-legend-item {
    font-size: 10px;
  }

  .ccs-acal-modal-content {
    width: 95%;
    max-width: none;
    max-height: 90vh;
    margin: 16px;
  }

  .ccs-acal-modal-title {
    font-size: 18px;
    margin: 16px 16px 6px;
  }

  .ccs-acal-modal-meta {
    margin: 0 16px 12px;
  }

  .ccs-acal-modal-description {
    margin: 0 16px 16px;
  }

  #ccs-acal-calendar .fc-multimonth-title {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .ccs-acal-wrap {
    padding: 0 8px;
  }

  .ccs-acal-btn {
    padding: 4px 12px;
    font-size: 12px;
  }
}
