/* Shared Calendar Styles - Used across all pages */

/* Calendar Container */
.calendar-container {
  background: #eeeeee;
  border-radius: 0.5rem;
  border: 1px solid #dddddd;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

/* Calendar Container for month calendar - matches reservations create page */
#monthCalendar {
  /*background: white;*/
  border-radius: 0.5rem;
  border: 1px solid #eeeeee;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

#monthCalendar .bg-white.rounded-lg.border.border-gray-200.p-4 {
  border: none;
  padding: 0;
  border-radius: 0;
}

/* Calendar Header */
.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 1px;
  background: white;
  border-radius: 0.5rem 0.5rem 0 0;
  overflow: hidden;
}

.calendar-header div {
  background: white;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

.calendar-header div.sat {
  color: #059669;
}

.calendar-header div.sun {
  color: #dc2626;
}

/* Calendar Weeks */
.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: white;
}

.calendar-week:last-child {
  border-radius: 0 0 0.5rem 0.5rem;
  overflow: hidden;
}

/* Calendar Days - Updated to match booking.css exactly */
.calendar-day {
  background: white;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day:hover:not(:disabled) {
  border-color: #3b82f6;
  background: #eff6ff;
}

.calendar-day.faded {
  color: #9ca3af;
  background: #f9fafb;
}

.calendar-day.today {
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
}

.calendar-day.selected {
  background-color: #2563eb;
  color: #fff;
  font-weight: 700;
  border-color: #2563eb;
}

/* Strong blue highlight for selected date tile in month calendar */
#monthCalendar .calendar-day.selected {
  background-color: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}

.calendar-day.sat {
  color: #059669;
}

.calendar-day.sun {
  color: #dc2626;
}

.calendar-day.available-ring {
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  background: none;
}

/* Darker green for dates within booking window */
.calendar-day.booking-window:not(.faded) {
  background: #dcfce7;
  border-color: #86efac;
}

/* Hover effect for booking window dates */
.calendar-day.booking-window:not(.faded):hover {
  border-color: #3b82f6;
}

/* Available dates styling - neutral for group course scheduling */
.calendar-day.available {
  background: white;
  border-color: #3b82f6;
  color: #1e40af;
  font-weight: 500;
}

.calendar-day.available:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #1d4ed8;
}

/* Past/unavailable dates styling - matches reservations create page */
.calendar-day.past,
.calendar-day.unavailable {
  color: #9ca3af;
  background: #f9fafb;
  border-color: #d1d5db;
  cursor: not-allowed;
  opacity: 0.7;
}

.calendar-day.past:hover,
.calendar-day.unavailable:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Calendar Navigation */
.calendar-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}

.calendar-nav-btn {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.calendar-nav-btn:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.calendar-nav-btn:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

.calendar-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
  text-align: center;
  flex: 1;
}

/* Calendar Day Enhancements */
.calendar-day:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.calendar-day:active:not(:disabled) {
  transform: scale(0.95);
}

/* Calendar Grid Layout */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: #e5e7eb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.calendar-day-header {
  background: #f9fafb;
  padding: 0.75rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid #e5e7eb;
}

/* Alternative Calendar Day Styling - Updated to match booking.css */
.calendar-date {
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  background-color: white;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-date:hover {
  background-color: #f3f4f6;
}

.calendar-date.today {
  background-color: #dbeafe;
  color: #1d4ed8;
  font-weight: 600;
}

.calendar-date.selected {
  background-color: #3b82f6;
  color: white;
  font-weight: 600;
}

.calendar-date.other-month {
  color: #9ca3af;
  background-color: #f9fafb;
}

.calendar-date.other-month:hover {
  background-color: #f3f4f6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .calendar-header div,
  .calendar-day-header {
    padding: 0.5rem 0.25rem;
    font-size: 0.75rem;
  }
  
  .calendar-day,
  .calendar-date {
    padding: 0.5rem 0.25rem;
    min-height: 2.5rem;
    font-size: 0.75rem;
  }
  
  .calendar-nav-btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }
  
  .calendar-title {
    font-size: 1rem;
  }
}

@media (max-width: 640px) {
  .calendar-header div,
  .calendar-day-header {
    padding: 0.375rem 0.125rem;
    font-size: 0.625rem;
  }
  
  .calendar-day,
  .calendar-date {
    padding: 0.375rem 0.125rem;
    min-height: 2rem;
    font-size: 0.625rem;
  }
  
  .calendar-nav-btn {
    padding: 0.25rem 0.375rem;
    font-size: 0.625rem;
  }
  
  .calendar-title {
    font-size: 0.875rem;
  }
}

/* Utility Classes */
.calendar-day.disabled {
  color: #9ca3af;
  cursor: not-allowed;
  background: #f9fafb;
  opacity: 0.5;
}

.calendar-day.other-month {
  color: #9ca3af;
  background: #f9fafb;
}

.calendar-day.other-month:hover {
  background: #f3f4f6;
}

/* Focus Styles for Accessibility */
*:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .calendar-day,
  .calendar-date {
    border-width: 2px;
  }
  
  .calendar-nav-btn {
    border-width: 2px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .calendar-day,
  .calendar-date,
  .calendar-nav-btn {
    transition: none;
  }
  
  .calendar-day:active:not(:disabled) {
    transform: none;
  }
}
