/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background-color: #f8f9fa;
  color: #333;
}

/* Layout utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.text-center {
  text-align: center;
}

/* Header styles */
header {
  background-color: #fff;
  border-bottom: 2px solid #e9ecef;
  padding: 1rem 0;
}

header h1 {
  font-size: 2rem;
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

header p {
  color: #6c757d;
  font-size: 1.1rem;
}

/* Main content */
main {
  padding: 2rem 0;
  min-height: 60vh;
}

/* Date Information Bar */
.date-info-bar {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-bottom: 1px solid #dee2e6;
  padding: 1.5rem 0;
  margin-bottom: 1rem;
}

.date-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.date-info-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.date-info-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.date-info-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.date-info-date {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.date-info-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.day-type-indicator {
  font-size: 1.2rem;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.day-type-indicator.a-day {
  background-color: rgba(127, 184, 0, 0.1);
}

.day-type-indicator.b-day {
  background-color: rgba(255, 227, 27, 0.1);
}

.day-type-indicator.non-instructional {
  background-color: rgba(108, 117, 125, 0.1);
}

.day-type-indicator.unknown {
  background-color: rgba(108, 117, 125, 0.1);
}

/* Calendar styles */
.calendar-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin: 1rem 0 2rem 0;
}

.calendar-header {
  text-align: center;
  margin-bottom: 2rem;
}

.calendar-header h2 {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: #dee2e6;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  overflow: hidden;
}

.calendar-day-header {
  background-color: #495057;
  color: white;
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.calendar-day {
  background-color: white;
  padding: 0.75rem;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.calendar-day.other-month {
  color: #adb5bd;
  background-color: #f8f9fa;
}

/* Day type colors */
.calendar-day.a-day {
  background-color: #d4edda;
  color: #155724;
}

.calendar-day.b-day {
  background-color: #cce5ff;
  color: #004085;
}

.calendar-day.non-instructional {
  background-color: #e2e3e5;
  color: #495057;
}

.calendar-day.m-a-day {
  background-color: #d1ecf1;
  color: #0c5460;
}

.calendar-day.m-b-day {
  background-color: #f8d7da;
  color: #721c24;
}

.calendar-day.today {
  border: 2px solid #007bff;
  font-weight: bold;
}

/* Legend */
.calendar-legend {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #dee2e6;
}

.legend-items {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.legend-color.a-day {
  background-color: #d4edda;
}

.legend-color.b-day {
  background-color: #cce5ff;
}

.legend-color.non-instructional {
  background-color: #e2e3e5;
}

.legend-color.m-a-day {
  background-color: #d1ecf1;
}

.legend-color.m-b-day {
  background-color: #f8d7da;
}

.legend-text {
  font-size: 0.95rem;
  color: #495057;
}

/* About page styles */
.about-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 3rem 2rem;
  margin: 2rem 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.about-content h2 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

.about-content p {
  margin-bottom: 1.5rem;
  color: #495057;
  font-size: 1.1rem;
}

/* jsCalendar customizations */

/* Make calendar larger and more responsive */
.jsCalendar {
  font-size: 1.1rem;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.jsCalendar table {
  width: 100%;
  border-spacing: 2px;
}

.jsCalendar td {
  width: 14.28%;
  height: 60px;
  text-align: center;
  vertical-align: middle;
  font-weight: 500;
}

/* Base styling - all selected days get white background initially */
.jsCalendar tbody td.jsCalendar-selected {
  background-color: #FFFFFF;
  border: 2px solid #E6E6E6;
}

/* A Days - Green outline only (not filled) */
.jsCalendar tbody td.jsCalendar-colorful-green.calendar-a-day {
  border-color: #7FB800;
  border-width: 3px;
  border-style: solid;
  background-color: transparent;
  color: inherit;
}

/* B Days - Yellow outline only (not filled) */
.jsCalendar tbody td.jsCalendar-colorful-yellow.calendar-b-day {
  border-color: #FFE31B;
  border-width: 3px;
  border-style: solid;
  background-color: transparent;
  color: inherit;
}

/* TODAY - Always filled regardless of day type (will be applied via select()) */
.jsCalendar tbody td.calendar-today.calendar-today-a {
  background-color: #7FB800 !important;
  color: white !important;
  border-color: #7FB800 !important;
  border-width: 3px !important;
  border-style: solid !important;
}

.jsCalendar tbody td.calendar-today.calendar-today-b {
  background-color: #FFE31B !important;
  color: #333 !important;
  border-color: #FFE31B !important;
  border-width: 3px !important;
  border-style: solid !important;
}

.jsCalendar tbody td.calendar-today.calendar-today-non-instructional {
  background-color: #007bff !important;
  color: white !important;
  border-color: #007bff !important;
  border-width: 2px !important;
  border-style: solid !important;
}

/* Hover effects for A and B days (not today) - Fill on hover */
.jsCalendar tbody td.jsCalendar-colorful-green.calendar-a-day:hover:not(.calendar-today) {
  background-color: #7FB800 !important;
  color: white !important;
}

.jsCalendar tbody td.jsCalendar-colorful-yellow.calendar-b-day:hover:not(.calendar-today) {
  background-color: #FFE31B !important;
  color: #333 !important;
}

/* Non-instructional days remain completely unstyled (no CSS rules needed) */
/* They keep default calendar styling: no border, no fill, gray hover from jsCalendar default */

/* Selected Date Information */
.selected-date-info {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 1px solid #2196f3;
  border-radius: 8px;
  margin: 1.5rem 0;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.selected-date-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.selected-date-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.selected-date-details {
  flex: 1;
}

.selected-date-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1976d2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.selected-date-date {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0d47a1;
  margin-bottom: 0.5rem;
}

.selected-date-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #1565c0;
}

/* Updated legend colors to match jsCalendar */
.legend-color.legend-a-day {
  background-color: transparent;
  border: 3px solid #7FB800;
}

.legend-color.legend-b-day {
  background-color: transparent;
  border: 3px solid #FFE31B;
}

.legend-color.legend-non-instructional {
  background-color: transparent;
  border: 1px solid #dee2e6;
}

/* Footer */
footer {
  background-color: #495057;
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

footer p {
  color: #adb5bd;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }

  header h1 {
    font-size: 1.6rem;
  }

  .calendar-container {
    padding: 1rem;
    margin: 1rem 0;
  }

  .calendar-day {
    padding: 0.5rem;
    min-height: 50px;
    font-size: 0.9rem;
  }

  .calendar-day-header {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  .legend-items {
    gap: 1rem;
  }

  .about-content {
    padding: 2rem 1rem;
  }

  /* jsCalendar responsive adjustments */
  .jsCalendar {
    font-size: 1rem;
  }

  .jsCalendar td {
    height: 50px;
  }

  /* Date info bar responsive */
  .date-info-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .date-info-card {
    padding: 1rem;
  }

  .date-info-date {
    font-size: 1rem;
  }

  /* Selected date info responsive */
  .selected-date-content {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .selected-date-date {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.4rem;
  }

  .calendar-day {
    min-height: 40px;
    font-size: 0.8rem;
  }

  .legend-items {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  /* jsCalendar mobile adjustments */
  .jsCalendar {
    font-size: 0.9rem;
  }

  .jsCalendar td {
    height: 40px;
  }

  /* Date info bar mobile adjustments */
  .date-info-bar {
    padding: 1rem 0;
  }

  .date-info-card {
    padding: 0.75rem;
  }

  .date-info-date {
    font-size: 0.95rem;
  }

  .date-info-type {
    font-size: 0.9rem;
  }
}