/* includes/slot-picker/slot-picker.css */

.custom-calendar-component {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.calendar-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}

.calendar-month-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.calendar-month-nav {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.calendar-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.15s ease;
    padding: 0;
}

.calendar-nav-btn:hover:not(:disabled) {
    background: var(--bg-light);
    color: var(--text-primary);
    border-color: var(--text-light);
}

.calendar-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.calendar-days-header .weekend-hdr {
    color: var(--text-light);
    opacity: 0.6;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 20px;
}

/* Day grid cells */
.cal-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-day-cell:hover:not(.disabled) {
    border-color: var(--text-light);
    background: var(--bg-light);
}

.cal-day-cell.selected {
    background: var(--bg-accent);
    color: var(--primary);
    border-color: var(--primary);
}

/* Blocked calendar states */
.cal-day-cell.disabled {
    background: var(--bg-card);
    color: var(--text-light);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.4;
    pointer-events: none;
}

.cal-day-cell.other-month:not(.disabled) {
    color: var(--text-muted);
    opacity: 0.55;
}

.cal-day-cell.weekend {
    background: var(--bg);
    color: var(--text-light);
}

/* --- Available Slots Layout Matrix --- */
.slots-sub-section {
    margin-top: 20px;
    border-top: 1px dashed var(--border);
    padding-top: 16px;
}

#calendar-slots-flex-target {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* 4 in a line on desktop browsers */
    gap: 10px !important;
    width: 100%;
}

.cal-slot-btn {
    width: 100% !important;
    min-width: 0 !important;
    padding: 10px 4px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cal-slot-btn .slot-time {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.cal-slot-btn .slot-lbl {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
    white-space: nowrap;
}

.cal-slot-btn:hover:not(:disabled) {
    border-color: var(--text-light);
}

.cal-slot-btn.selected {
    border-color: var(--primary);
    background: var(--bg-accent);
}

.cal-slot-btn.selected .slot-time,
.cal-slot-btn.selected .slot-lbl {
    color: var(--primary);
}

.cal-slot-btn:disabled {
    background: var(--bg-light);
    border-color: var(--border);
    cursor: not-allowed;
}

.cal-slot-btn:disabled .slot-time {
    color: var(--text-light);
    text-decoration: line-through;
    opacity: 0.5;
}

.cal-slot-btn:disabled .slot-lbl {
    color: var(--text-light) !important;
    opacity: 0.4;
}

/* --- Optimized Responsive Viewport Mix --- */
@media (max-width: 768px) {
    /* Wraps buttons into a clean 2x2 grid layout on tablets and laptops to eliminate container overflow */
    #calendar-slots-flex-target {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}

@media (max-width: 480px) {
    .custom-calendar-component {
        max-width: 100%;
    }

    .calendar-days-grid {
        gap: 4px;
    }
    
    .cal-day-cell {
        font-size: 11px;
        border-radius: 4px;
    }
    
    .cal-slot-btn {
        padding: 12px 4px;
    }

    .cal-slot-btn .slot-time {
        font-size: 11px;
    }

    .cal-slot-btn .slot-lbl {
        font-size: 9px;
    }
}