/* ============================================
   Calendar Page - Specific Styles Only
   Shared styles are in All.css
   ============================================ */

/* Calendar page body styles (only for standalone Calendar.html, not Programs.html) */
body:not(.programs-page) {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 20px;
  background-color: var(--bg-light);
}

/* Calendar page container (only for standalone Calendar.html) */
body:not(.programs-page) .container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

body:not(.programs-page) header {
  text-align: center;
  margin-bottom: 20px;
}

body:not(.programs-page) .main-content {
  display: flex;
  gap: 20px;
  width: 70%;
}

/* Calendar section container (for Programs.html calendar section) */
#event-calendar-section .container {
  max-width: 1200px;
  margin: 0 auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

#event-calendar-section header {
  text-align: center;
  margin-bottom: 20px;
}

#event-calendar-section .main-content {
  display: flex;
  gap: 20px;
  width: 70%;
}

#event-calendar-section #cal-main-content {
  position: relative;
  left: 200px;
}

.calendar-container {
  flex: 3;
  margin-bottom: 30px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  background: var(--secondary-color);
  height: 100px;
  border-radius: 10px 10px 10px 10px;
}

/* Programs page: align nav, year, title, next in one balanced row */
#event-calendar-section .calendar-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: auto;
  min-height: 88px;
  padding: 12px 16px;
  box-sizing: border-box;
}

#event-calendar-section .calendar-header #prev-month,
#event-calendar-section .calendar-header #next-month {
  flex: 0 0 auto;
  white-space: nowrap;
}

#event-calendar-section .calendar-header .year-selector {
  flex: 0 0 auto;
  min-width: 88px;
  max-width: 120px;
}

#event-calendar-section .calendar-header h2#calendar-title {
  flex: 1 1 auto;
  text-align: center;
  margin: 0;
  padding: 0 8px;
  min-width: 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.25;
  order: 0;
}

.calendar-header button {
  background-color: var(--success-color);
  color: var(--text-light);
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  transition: var(--transition);
}

.calendar-header .btn-left {
  margin-left: 10px;
}

.calendar-header .btn-right {
  margin-right: 10px;
}

.calendar-header button:hover {
  background-color: #218838;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.calendar-header h2#calendar-title {
  color: var(--text-light);
}

.calendar-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  margin-bottom: 8px;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

/* responsive_fixes.css uses * { max-width: 100% } which breaks 7-column grids */
@media (max-width: 768px) {
  .calendar-weekdays,
  .calendar-weekdays .weekday,
  .calendar-days-grid,
  .calendar-days-grid .calendar-day {
    max-width: none !important;
  }
}

.weekday {
  text-align: center;
  font-weight: bold;
  padding: 10px;
  background-color: var(--bg-light);
  border-radius: 5px;
}

.calendar-day {
  min-height: 60px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 5px;
  position: relative;
  background-color: var(--text-light);
  cursor: pointer;
  transition: background-color 0.2s;
}

.calendar-day:hover {
  background-color: var(--bg-light);
}

.calendar-day.past-day {
  background-color: var(--bg-light);
}

.day-number {
  position: absolute;
  top: 5px;
  right: 8px;
  font-size: 14px;
  color: #555;
}

.calendar-day.other-month {
  background-color: var(--bg-light);
}

.calendar-day.other-month .day-number {
  color: var(--text-muted, #999);
}

.calendar-day.today {
  background-color: rgba(0, 74, 173, 0.05);
  border-color: var(--primary-color);
}

.day-marker {
  height: 4px;
  width: 20px;
  border-radius: 2px;
  margin: 0 auto;
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.today-marker {
  background-color: var(--primary-color);
}

.event-markers {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 25px;
  padding: 0 5px;
}

.event-marker {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.event-marker:hover {
  transform: scale(1.3);
}

.event-marker.past-event {
  opacity: 0.8;
}

.event-marker.upcoming-event {
  opacity: 1;
}

/* Calendar Legend */
.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-marker {
  height: 8px;
  width: 8px;
  border-radius: 50%;
}

.legend-marker.past {
  background-color: var(--text-muted, #666);
}

.legend-marker.upcoming {
  background-color: var(--primary-color);
}

.legend-marker.today {
  background-color: var(--primary-color);
  height: 4px;
  width: 20px;
  border-radius: 2px;
}

.workshop-item {
  margin-top: 25px;
  padding: 5px;
  background-color: rgba(0, 123, 255, 0.1);
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}

.workshop-item:hover {
  background-color: rgba(0, 123, 255, 0.2);
}

.workshop-details {
  flex: 1;
  padding: 15px;
  background-color: var(--bg-light);
  border-radius: 8px;
  min-width: 270px;
  max-width: 350px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: 610px;
}

.workshop-details h3 {
  margin-top: 0;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
  background-color: var(--secondary-color);
  width: 270px;
  position: relative;
  right: 15px;
  height: 100px;
  top: -15px;
  align-content: center;
  color: var(--text-light);
}

/* Responsive adjustments */
@media (max-width: 900px) {
  #event-calendar-section .main-content,
  body:not(.programs-page) .main-content {
    flex-direction: column;
  }
  
  .workshop-details {
    max-width: none;
  }
}

/* Year selector styling */
.year-selector {
  padding: 6px 10px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  margin: 0 10px;
  background-color: var(--text-light);
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  color: var(--text-color);
  transition: var(--transition);
}

.year-selector:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.1);
}
