/* Simple Calendar Styling */
.simple-calendar {
  font-family: inherit;
}

.simple-calendar .calendar-heading {
  min-height: 60px;
  position: relative;
}

.simple-calendar .calendar-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}

.simple-calendar table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.simple-calendar tbody td {
  height: 120px;
  vertical-align: top;
  position: relative;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  overflow: hidden;
  padding: 0.5rem;
  background-color: #ffffff;
}

.simple-calendar tbody td:last-child {
  border-right: none;
}

.simple-calendar tbody tr:last-child td {
  border-bottom: none;
}

.simple-calendar .day-number-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.simple-calendar .day-number {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}

.simple-calendar .day-number.font-bold {
  font-weight: 700;
}

.simple-calendar .day-number.today-highlight {
  background-color: var(--school-primary-color, #3b82f6);
  color: white;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.simple-calendar .today-indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--school-primary-color, #3b82f6);
  opacity: 0.1;
  z-index: 0;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.2;
  }
}

.simple-calendar tbody td > div:not(.day-number) {
  max-height: calc(120px - 45px);
  overflow: hidden;
  position: relative;
}

.simple-calendar .events-container {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.simple-calendar .event-item {
  font-size: 0.75rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.simple-calendar .event-item:hover {
  transform: translateX(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  opacity: 0.9;
}

.simple-calendar .event-item .event-title {
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.simple-calendar .event-item .event-time {
  font-size: 0.625rem;
  opacity: 0.8;
  margin-top: 0.125rem;
  font-weight: 400;
}

.simple-calendar .more-events-indicator {
  font-size: 0.625rem;
  color: #6b7280;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.simple-calendar .more-events-indicator:hover {
  color: #374151;
}

/* Calendar day states */
.simple-calendar .day {
  transition: background-color 0.2s ease;
  position: relative;
}

.simple-calendar .day:hover {
  background-color: #f9fafb;
}

.simple-calendar .day:hover .day-number {
  background-color: #f3f4f6;
}

.simple-calendar .day:hover .day-number.today-highlight {
  background-color: var(--school-primary-color, #3b82f6);
  transform: scale(1.05);
}

/* Today's date highlighting */
.simple-calendar .today {
  background-color: rgba(59, 130, 246, 0.05);
  position: relative;
}

.simple-calendar .today .day-number {
  color: #374151;
  font-weight: 600;
  color: white;
}

.simple-calendar .past {
  opacity: 0.6;
}

.simple-calendar .past .day-number {
  color: #9ca3af;
}

.simple-calendar .prev-month,
.simple-calendar .next-month {
  opacity: 0.4;
  background-color: #f9fafb;
}

.simple-calendar .prev-month .day-number,
.simple-calendar .next-month .day-number {
  color: #d1d5db;
}


.simple-calendar .has-events.today {
  background-color: #f3f4f6 !important;
}

/* Weekday headers */
.simple-calendar thead th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  color: #4b5563;
  background: linear-gradient(to bottom, #f9fafb, #f3f4f6);
  border-right: 1px solid #e5e7eb;
  border-bottom: 2px solid #e5e7eb;
  font-size: 0.75rem;
  transition: background-color 0.2s ease;
}

.simple-calendar thead th:last-child {
  border-right: none;
}

.simple-calendar thead th:hover {
  background: linear-gradient(to bottom, #f3f4f6, #e5e7eb);
}

/* Weekend styling */
.simple-calendar tbody td:first-child:not(.today),
.simple-calendar tbody td:last-child:not(.today) {
  background-color: #fafbfc;
}

.simple-calendar tbody td:first-child:not(.today):hover,
.simple-calendar tbody td:last-child:not(.today):hover {
  background-color: #f3f4f6;
}

/* Week calendar specific styling */
.simple-calendar tbody td[style*="min-height: 500px"] {
  height: 500px !important;
  min-height: 500px !important;
  vertical-align: top;
  border-right: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  overflow: hidden;
  padding: 0.5rem;
}

.simple-calendar tbody td[style*="min-height: 500px"] > div:not(.day-number) {
  max-height: calc(500px - 45px);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.simple-calendar tbody td[style*="min-height: 500px"]:last-child {
  border-right: none;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .simple-calendar tbody td {
    height: 100px;
    padding: 0.375rem;
  }

  .simple-calendar tbody td > div:not(.day-number-wrapper) {
    max-height: calc(100px - 45px);
    overflow: hidden;
  }

  .simple-calendar .day-number {
    font-size: 0.75rem;
    width: 28px;
    height: 28px;
  }

  .simple-calendar .today-indicator {
    width: 28px;
    height: 28px;
  }

  .simple-calendar .event-item {
    font-size: 0.625rem;
    padding: 0.25rem 0.375rem;
  }

  .simple-calendar .event-item .event-title {
    font-size: 0.625rem;
  }

  .simple-calendar .event-item .event-time {
    font-size: 0.5rem;
  }

  .simple-calendar .more-events-indicator {
    font-size: 0.5rem;
    padding: 0.125rem 0.375rem;
  }

  .simple-calendar .calendar-heading {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .simple-calendar .calendar-title {
    order: -1;
    font-size: 1rem;
  }

  .simple-calendar .events-container {
    gap: 0.25rem;
  }
}

