/* Page Header (reusing from about.css for consistency) */
.page-header {
  padding: 5rem 0;
  background-image: url('../images/calendar.webp'); /* You can use a different image */
  background-size: cover;
  background-position: center 70%;
  position: relative;
  text-align: center;
  color: var(--white);
}
.page-header-overlay {
  content: '';
  position: absolute; top:0; left:0; right:0; bottom:0;
  background: rgba(44, 62, 80, 0.7); /* --primary-color with opacity */
  z-index: 1;
}
.page-header .container {
  position: relative;
  z-index: 2;
}
.page-header h1 {
  color: var(--white);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
}
.page-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  opacity: 0.9;
}

/* Main Calendar Section */
.calendar-section {
  padding: 4rem 0;
}

/* Calendar Header (Month Name + Nav) */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  text-align: center;
}
.calendar-header h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  flex-grow: 1;
}
.nav-arrow {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  transition: background-color 0.3s;
}
.nav-arrow:hover {
  background-color: #e9e9e9;
  text-decoration: none;
}
.nav-arrow i {
  vertical-align: middle;
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  background-color: #ddd;
  border: 1px solid #ddd;
}

/* Day Name Headers (Sun, Mon, etc.) */
.day-name {
  background-color: var(--secondary-color);
  color: var(--white);
  font-weight: 600;
  text-align: center;
  padding: 0.75rem 0.25rem;
  font-size: 0.9rem;
}

/* Individual Day Cells */
.day {
  background-color: var(--white);
  padding: 0.5rem;
  min-height: 120px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background-color 0.2s;
}
.day:hover {
  background-color: #fcfcfc;
}
.day span {
  font-weight: 600;
  align-self: flex-end; /* Position number to the top right */
  color: var(--text-color);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

/* Day State Modifiers */
.day.today {
  background-color: #fffdf5;
  border: 2px solid var(--accent-color);
  padding: calc(0.5rem - 2px); /* Adjust padding to account for border */
}
.day.today span {
  background-color: var(--accent-color);
  color: var(--white);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.day.other-month {
  background-color: var(--light-gray);
}
.day.other-month span {
  opacity: 0.4;
}

/* Event Styling */
.event {
  background-color: rgba(44, 62, 80, 0.9); /* --primary-color with opacity */
  color: var(--white);
  font-size: 0.8rem;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color 0.3s;
}
.event:hover {
  background-color: var(--primary-color);
}
/* Special event style */
.event.special {
  background-color: rgba(192, 57, 43, 0.9); /* --accent-color with opacity */
}
.event.special:hover {
  background-color: var(--accent-color);
}

/* Add to bottom of calendar.css */
.nav-arrow.disabled {
  color: #ccc;
  pointer-events: none;
  cursor: default;
}

.calendar-key {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #555;
}

/* FILE: app/static/css/calendar.css (ADDITIONS) */

/* ... existing styles ... */

/* [NEW] Event Modal Styles */
.modal-overlay {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.modal-content {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  position: relative;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 2rem;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover {
  color: #333;
}

.modal-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  color: var(--primary-color);
}

.modal-meta {
  margin-bottom: 1.5rem;
  color: #555;
  font-size: 1.1rem;
}
.modal-meta p {
  margin: 0.25rem 0;
}
.modal-meta i {
  margin-right: 0.75rem;
  color: var(--accent-color);
}

.modal-description {
  line-height: 1.7;
  color: var(--text-color);
}

/* Event Styling Update */
.event.event-item { /* Add event-item class for JS targeting */
  cursor: pointer;
}


/* Responsive Adjustments */
@media (max-width: 900px) {
  .day {
    min-height: 100px;
    padding: 0.3rem;
  }
  .event {
    font-size: 0.75rem;
  }
}

@media (max-width: 600px) {
  .calendar-header h2 {
    font-size: 1.25rem;
  }
  .day {
    min-height: 0; /* Let height be determined by content */
    padding-bottom: 1rem;
  }
  .day span {
    align-self: center;
    margin-bottom: 0.5rem;
  }
  .day-name {
    font-size: 0.8rem;
    padding: 0.5rem 0.1rem;
  }
  .event {
    text-align: center;
    white-space: normal;
  }
}