/* ABOUTME: Stylesheet for 14-day Panchakarma tour availability calendar widget */
/* ABOUTME: Provides responsive design with Bootstrap integration and accessible color schemes */

/* ===== CALENDAR CONTAINER ===== */
.availability-calendar {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  padding: 1.5rem;
  margin: 2rem 0;
  border: 1px solid #dee2e6;
}

/* ===== CALENDAR HEADER ===== */
.calendar-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.calendar-header h3 {
  color: #2d5016;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

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

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #6c757d;
}

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

.legend-color.available {
  background-color: #28a745;
}

.legend-color.unavailable {
  background-color: #dc3545;
}

/* ===== CALENDAR GRID ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ===== MONTH CONTAINERS ===== */
.month-container {
  background: #f8f9fa;
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #e9ecef;
}

.month-title {
  text-align: center;
  margin-bottom: 1rem;
  color: #495057;
  font-size: 1.1rem;
  font-weight: 600;
}

.month-grid {
  width: 100%;
}

/* ===== WEEKDAY HEADERS ===== */
.weekday-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  margin-bottom: 0.5rem;
}

.weekday {
  text-align: center;
  padding: 0.5rem 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== DAYS GRID ===== */
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: #dee2e6;
  border-radius: 0.25rem;
  overflow: hidden;
}

/* ===== DAY CELLS ===== */
.day-cell {
  background: #fff;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: default;
  position: relative;
  transition: all 0.2s ease;
}

.day-cell.empty {
  background: transparent;
}

/* ===== DAY STATES ===== */
.day-cell.available {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.day-cell.available:hover {
  background-color: #c3e6cb;
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
  z-index: 1;
}

.day-cell.unavailable {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.day-cell.past {
  background-color: #f8f9fa;
  color: #adb5bd;
  border: 1px solid #e9ecef;
}

.day-cell.today {
  position: relative;
  font-weight: 700;
}

.day-cell.today::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: #007bff;
  border-radius: 50%;
}

.day-cell.today.available::after {
  background-color: #155724;
}

.day-cell.today.unavailable::after {
  background-color: #721c24;
}

/* ===== CALENDAR FOOTER ===== */
.calendar-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #dee2e6;
}

.calendar-note {
  margin: 0;
  color: #6c757d;
}

.calendar-note a {
  color: #28a745;
  font-weight: 500;
}

.calendar-note a:hover {
  color: #1e7e34;
}

/* ===== LOADING AND ERROR STATES ===== */
.calendar-loading {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.calendar-error {
  margin: 2rem 0;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.day-cell[title] {
  position: relative;
}

.day-cell:focus {
  outline: 2px solid #007bff;
  outline-offset: -2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .day-cell.available {
    background-color: #000;
    color: #fff;
    border: 2px solid #fff;
  }
  
  .day-cell.unavailable {
    background-color: #fff;
    color: #000;
    border: 2px solid #000;
  }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large screens: 3 columns */
@media (min-width: 1200px) {
  .calendar-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Medium screens: 2 columns */
@media (min-width: 768px) and (max-width: 1199px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .calendar-legend {
    gap: 1.5rem;
  }
}

/* Small screens: 1 column */
@media (max-width: 767px) {
  .availability-calendar {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .calendar-header h3 {
    font-size: 1.25rem;
  }
  
  .calendar-legend {
    gap: 1rem;
    font-size: 0.85rem;
  }
  
  .month-container {
    padding: 0.75rem;
  }
  
  .month-title {
    font-size: 1rem;
  }
  
  .day-cell {
    font-size: 0.8rem;
    min-height: 2.5rem;
  }
  
  .weekday {
    font-size: 0.7rem;
    padding: 0.375rem 0.125rem;
  }
}

/* Extra small screens */
@media (max-width: 480px) {
  .availability-calendar {
    padding: 0.75rem;
    margin: 0.5rem 0;
  }
  
  .calendar-legend {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
  
  .day-cell {
    font-size: 0.75rem;
    min-height: 2rem;
  }
  
  .weekday {
    font-size: 0.65rem;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .availability-calendar {
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .day-cell.available {
    background: #f0f0f0 !important;
    border: 1px solid #000;
  }
  
  .day-cell.unavailable {
    background: #d0d0d0 !important;
    border: 1px solid #000;
  }
  
  .calendar-legend {
    display: none;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .day-cell,
  .day-cell:hover {
    transition: none;
    transform: none;
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  .availability-calendar {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }
  
  .month-container {
    background: #374151;
    border-color: #4b5563;
  }
  
  .calendar-header h3 {
    color: #68d391;
  }
  
  .month-title {
    color: #e2e8f0;
  }
  
  .weekday {
    color: #a0aec0;
  }
  
  .day-cell {
    background: #2d3748;
    color: #e2e8f0;
  }
  
  .day-cell.available {
    background-color: #276749;
    color: #9ae6b4;
    border-color: #38a169;
  }
  
  .day-cell.unavailable {
    background-color: #742a2a;
    color: #feb2b2;
    border-color: #e53e3e;
  }
  
  .day-cell.past {
    background-color: #2d3748;
    color: #718096;
    border-color: #4a5568;
  }
  
  .calendar-footer {
    border-color: #4a5568;
  }
  
  .calendar-note {
    color: #a0aec0;
  }
  
  .calendar-note a {
    color: #68d391;
  }
  
  .days-grid {
    background-color: #4a5568;
  }
}