/* ===================================
   CALENDAR COMPONENT
   Modern calendar interface for date selection
   =================================== */

.abs-calendar {
    width: 100%;
    max-width: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.abs-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px 6px 0px 0px;
}

.abs-calendar-nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.abs-calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.abs-calendar-month-year {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    flex: 1;
}

.abs-calendar-body {
    padding: 0.5rem;
}

.abs-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.abs-calendar-weekday {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.abs-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    transition: opacity 0.2s ease;
}
.abs-calendar-days.loading {
    opacity: 0.4;
    pointer-events: none;
}

.abs-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    min-height: 36px;
    position: relative;
}

.abs-calendar-day:hover {
    background: #f3f4f6;
    transform: scale(1.05);
}

.abs-calendar-day.other-month {
    color: #d1d5db;
    cursor: not-allowed;
}

.abs-calendar-day.disabled {
    color: #d1d5db;
    cursor: not-allowed;
    background: #f9fafb;
}

/* Disabled day variants */
.abs-calendar-day.disabled.fully-booked {
    background: #fee2e2; /* light red */
    color: #b91c1c;      /* dark red text */
    border: 1px solid #fecaca;
}

.abs-calendar-day.disabled.fully-booked::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #ef4444; /* red dot */
    border-radius: 50%;
}

.abs-calendar-day.disabled.no-slots {
    background: #f3f4f6; /* neutral gray */
    color: #9ca3af;
    border: 1px dashed #e5e7eb;
}

.abs-calendar-day.available {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.abs-calendar-day.available:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.abs-calendar-day.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 700;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.abs-calendar-day.today {
    position: relative;
}

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

.abs-calendar-day.has-availability::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
}

/* Loading state for calendar */
.abs-calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.abs-calendar-loading .abs-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #667eea;
}

/* Calendar legend */
.abs-calendar-legend {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: #f9fafb;
    font-size: 0.8rem;
    color: #6b7280;
    border-radius: 0px 0px 6px 6px;
}

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

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

.abs-legend-available {
    background: #10b981;
}

.abs-legend-selected {
    background: #667eea;
}

.abs-legend-today {
    background: #f59e0b;
}

/* Responsive design */
@media (max-width: 768px) {
    .abs-calendar-header {
        padding: 1rem;
    }
    
    .abs-calendar-body {
        padding: 1rem;
    }
    
    .abs-calendar-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .abs-calendar-month-year {
        font-size: 1rem;
    }
    
    .abs-calendar-day {
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .abs-calendar-weekday {
        padding: 0.75rem 0.25rem;
        font-size: 0.8rem;
    }
}

@media (min-width: 769px) {
    .abs-calendar-day {
        min-height: 56px;
        font-size: 1.1rem;
    }
    
    .abs-calendar-weekday {
        font-size: 1rem;
        padding: 1.25rem 0.5rem;
    }
    
    .abs-calendar-body {
        padding: 0rem;
    }
}
