/* ============================================
   Calendar Component Styles
   Airbnb-style availability calendar
   ============================================ */

.calendar-container {
    max-width: 100%;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.calendar-month-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: var(--airbnb-dark);
}

.calendar-nav-buttons {
    display: flex;
    gap: var(--space-sm);
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
    color: var(--airbnb-dark);
}

.calendar-nav-btn:hover:not(:disabled) {
    background: var(--airbnb-background-hover);
}

.calendar-nav-btn:disabled {
    color: var(--airbnb-border);
    cursor: not-allowed;
}

.calendar-nav-btn svg {
    width: 12px;
    height: 12px;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.calendar-weekday {
    text-align: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--airbnb-gray);
    padding: var(--space-sm) 0;
    text-transform: capitalize;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--airbnb-dark);
    cursor: pointer;
    position: relative;
    border: 1.5px solid transparent;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    min-height: 42px;
}

.calendar-day:hover:not(.calendar-day--disabled):not(.calendar-day--booked):not(.calendar-day--empty) {
    border-color: var(--airbnb-dark);
}

/* Empty cells (padding days) */
.calendar-day--empty {
    cursor: default;
}

/* Past dates */
.calendar-day--past {
    color: var(--airbnb-border);
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Booked/Unavailable dates */
.calendar-day--booked {
    color: var(--airbnb-gray-light);
    cursor: not-allowed;
    text-decoration: line-through;
    position: relative;
}

.calendar-day--booked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    right: 20%;
    height: 1px;
    background: var(--airbnb-gray-light);
}

/* Disabled (general) */
.calendar-day--disabled {
    color: var(--airbnb-border);
    cursor: not-allowed;
}

/* Selected dates */
.calendar-day--selected {
    background: var(--airbnb-dark);
    color: white;
    border-color: var(--airbnb-dark);
}

/* Date range between selected start and end */
.calendar-day--in-range {
    background: var(--airbnb-background-hover);
    border-radius: 0;
}

.calendar-day--range-start {
    background: var(--airbnb-dark);
    color: white;
    border-radius: var(--radius-full) 0 0 var(--radius-full);
}

.calendar-day--range-end {
    background: var(--airbnb-dark);
    color: white;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

/* Today indicator */
.calendar-day--today {
    font-weight: var(--font-weight-bold);
}

.calendar-day--today::before {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--airbnb-dark);
}

.calendar-day--today.calendar-day--selected::before {
    background: white;
}

/* Two-month view for wider screens */
.calendar-two-months {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.calendar-month {
    min-width: 0;
}

/* Calendar loading state */
.calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--airbnb-gray);
    font-size: var(--font-size-sm);
}

.calendar-loading .spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--airbnb-border);
    border-top-color: var(--airbnb-dark);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    margin-right: var(--space-sm);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Calendar error state */
.calendar-error {
    text-align: center;
    padding: var(--space-xl);
    color: var(--airbnb-gray);
    font-size: var(--font-size-sm);
}

.calendar-error button {
    margin-top: var(--space-base);
    padding: var(--space-sm) var(--space-base);
    border: 1px solid var(--airbnb-dark);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.calendar-error button:hover {
    background: var(--airbnb-background-hover);
}

/* Calendar legend */
.calendar-legend {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    padding-top: var(--space-base);
    font-size: var(--font-size-xs);
    color: var(--airbnb-gray);
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.calendar-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.calendar-legend-dot--available {
    background: var(--airbnb-background);
    border: 1px solid var(--airbnb-border);
}

.calendar-legend-dot--booked {
    background: var(--airbnb-background-dark);
    position: relative;
}

.calendar-legend-dot--booked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 2px;
    right: 2px;
    height: 1px;
    background: var(--airbnb-gray-light);
}

/* Last updated info */
.calendar-last-updated {
    margin-top: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--airbnb-gray-light);
    text-align: right;
}
