/* calendar.css */

/* Base container */
.built-calendar {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px;
}

/* FullCalendar base */
#calendarModal .fc {
  background: transparent;
}

#calendarModal .fc .fc-toolbar-title {
  font-size: 1.2rem;
  font-weight: 700;
}

/* =========================================================
   CALENDAR MODAL — DEFAULT LIGHT
   ========================================================= */

body:not(.dark-mode) #calendarModal {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

/* Modal sizing (prevents huge empty bottom area) */
body:not(.dark-mode) #calendarModal .modal-content {
  background: #f9fafb;
  color: #111827;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

  height: auto !important;
  min-height: 0 !important;
  max-height: 85vh !important;
  overflow: auto !important;
  display: block !important;
}

/* Toolbar buttons */
body:not(.dark-mode) #calendarModal .fc-button {
  background: #e5e7eb;
  color: #111827;
  border: none;
  border-radius: 10px;
}

body:not(.dark-mode) #calendarModal .fc-button:hover {
  background: #d1d5db;
}

body:not(.dark-mode) #calendarModal .fc-button:disabled {
  opacity: 0.5;
}

/* Weekday header bar */
body:not(.dark-mode) #calendarModal .fc-col-header-cell {
  background: #111827;
  border-color: rgba(0, 0, 0, 0.15);
}

body:not(.dark-mode) #calendarModal .fc-col-header-cell-cushion {
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 700;
}

/* Day tiles */
body:not(.dark-mode) #calendarModal .fc-daygrid-day-frame {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

body:not(.dark-mode) #calendarModal .fc-daygrid-day-number {
  color: #111827;
}

body:not(.dark-mode) #calendarModal .fc-day-other .fc-daygrid-day-number {
  color: #9ca3af;
}

/* Today highlight */
body:not(.dark-mode) #calendarModal .fc-day-today {
  background: #e0f2fe !important;
}

/* =========================================================
   CALENDAR MODAL — DARK MODE (dark grey palette)
   ========================================================= */

body.dark-mode #calendarModal {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
}

/* Modal sizing (same rules as light, different colors) */
body.dark-mode #calendarModal .modal-content {
  background: #121212;
  /* dark grey modal */
  color: #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);

  height: auto !important;
  min-height: 0 !important;
  max-height: 85vh !important;
  overflow: auto !important;
  display: block !important;
}

/* Toolbar title */
body.dark-mode #calendarModal .fc-toolbar-title {
  color: #e5e7eb !important;
}

/* Toolbar buttons */
body.dark-mode #calendarModal .fc-button {
  background: #2a2a2a !important;
  color: #e5e7eb !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 10px;
}

body.dark-mode #calendarModal .fc-button:hover {
  background: #3a3a3a !important;
}

/* Weekday header bar (dark strip) */
body.dark-mode #calendarModal .fc-col-header-cell {
  background: #1c1c1c !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
}

body.dark-mode #calendarModal .fc-col-header-cell-cushion {
  color: #ffffff !important;
  text-decoration: none !important;
  font-weight: 700;
}

/* Day tiles (darker) */
body.dark-mode #calendarModal .fc-daygrid-day-frame {
  background: #1a1a1a !important;
  /* dark grey tile */
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
}

body.dark-mode #calendarModal .fc-daygrid-day-number {
  color: #e5e7eb !important;
}

body.dark-mode #calendarModal .fc-day-other .fc-daygrid-day-number {
  color: #8b93a3 !important;
}

/* Today highlight (subtle, still grey-themed) */
body.dark-mode #calendarModal .fc-day-today {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Ensure FC internals don’t force light backgrounds */
body.dark-mode #calendarModal .fc,
body.dark-mode #calendarModal .fc-scrollgrid,
body.dark-mode #calendarModal .fc-scrollgrid-section,
body.dark-mode #calendarModal table {
  background: transparent !important;
}

/* Keep day-of-week links from turning blue anywhere */
#calendarModal .fc-col-header-cell-cushion {
  text-decoration: none !important;
}

/* ===============================
   DAY OVERVIEW MODAL — LIGHT MODE
   =============================== */

#dayOverviewModal {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

#dayOverviewModal>div {
  background: #f9fafb;
  color: #111827;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Header */
#dayOverviewModal #domTitle {
  color: #111827;
}

/* Event cards */
#dayOverviewModal .day-event {
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

/* Event title */
#dayOverviewModal .day-event-title {
  color: #111827;
}

/* Event meta (time, labels) */
#dayOverviewModal .day-event-meta {
  color: #374151;
}

/* Notes box */
#dayOverviewModal .day-event-notes {
  background: #f3f4f6;
  color: #111827;
}

/* ===============================
   DAY OVERVIEW MODAL — DARK MODE
   =============================== */

body.dark-mode #dayOverviewModal {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
}

body.dark-mode #dayOverviewModal>div {
  background: #121212;
  /* dark grey modal */
  color: #e5e7eb;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
}

/* Header */
body.dark-mode #dayOverviewModal #domTitle {
  color: #e5e7eb;
}

/* Event cards */
body.dark-mode #dayOverviewModal .day-event {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

/* Event title */
body.dark-mode #dayOverviewModal .day-event-title {
  color: #e5e7eb;
}

/* Event meta */
body.dark-mode #dayOverviewModal .day-event-meta {
  color: #9ca3af;
}

/* Notes box */
body.dark-mode #dayOverviewModal .day-event-notes {
  background: #0f0f0f;
  color: #e5e7eb;
}

/* ===============================
   DAY OVERVIEW MODAL THEME
   default = light, dark-mode = dark grey
   =============================== */

/* Backdrop */
#dayOverviewModal {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

/* Card */
#dayOverviewModal .day-overview-card {
  width: min(760px, 100%);
  max-height: min(78vh, 760px);
  overflow: auto;
  background: #f9fafb;
  color: #111827;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Header */
#dayOverviewModal .day-overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  background: #f9fafb;
}

#dayOverviewModal .day-overview-subtitle {
  font-size: 12px;
  opacity: 0.7;
}

#dayOverviewModal .day-overview-title {
  font-size: 16px;
  font-weight: 800;
}

#dayOverviewModal .day-overview-close {
  border: 0;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: inherit;
}

#dayOverviewModal .day-overview-body {
  padding: 14px 16px;
}

/* Empty day */
#dayOverviewModal .day-empty {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
}

/* Event cards */
#dayOverviewModal .day-event {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(0, 0, 0, 0.02);
}

#dayOverviewModal .day-event-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

#dayOverviewModal .day-event-title {
  font-weight: 800;
  font-size: 15px;
}

#dayOverviewModal .day-event-meta {
  font-size: 12px;
  opacity: 0.8;
  white-space: nowrap;
}

#dayOverviewModal .day-event-line {
  margin-top: 8px;
  font-size: 13px;
}

#dayOverviewModal .day-event-notes {
  margin-top: 6px;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
}

/* ---------- DARK MODE ---------- */
body.dark-mode #dayOverviewModal {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
}

body.dark-mode #dayOverviewModal .day-overview-card {
  background: #121212;
  color: #e5e7eb;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
}

body.dark-mode #dayOverviewModal .day-overview-header {
  background: #121212;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

body.dark-mode #dayOverviewModal .day-overview-close {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode #dayOverviewModal .day-empty {
  background: rgba(255, 255, 255, 0.06);
}

body.dark-mode #dayOverviewModal .day-event {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

body.dark-mode #dayOverviewModal .day-event-notes {
  background: #0f0f0f;
}

/* ===============================
   CURRENT DAY HIGHLIGHT
   =============================== */

/* Light mode: subtle blue */
body:not(.dark-mode) #calendarModal .fc-day-today {
  background: rgba(59, 130, 246, 0.15) !important;
  /* blue-500 */
}

/* Dark mode: softer blue, lower opacity */
body.dark-mode #calendarModal .fc-day-today {
  background: rgba(59, 130, 246, 0.20) !important;
}

/* ===============================
   CURRENT DAY (TODAY) HIGHLIGHT
   Month view: target the day cell + its frame
   =============================== */

/* LIGHT MODE */
body:not(.dark-mode) #calendarModal .fc-daygrid-day.fc-day-today .fc-daygrid-day-frame {
  background: rgba(59, 130, 246, 0.16) !important;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.35) !important;
}

/* DARK MODE */
body.dark-mode #calendarModal .fc-daygrid-day.fc-day-today .fc-daygrid-day-frame {
  background: rgba(59, 130, 246, 0.18) !important;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.30) !important;
}

/* Ensure the highlight isn't hidden by inner layers */
#calendarModal .fc-daygrid-day.fc-day-today {
  background: transparent !important;
}