/* Scheduler Styles */

#scheduler-root {
    margin: 2rem 0;
}

/* Navigation row - arrows above the calendar */
.scheduler-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.scheduler-nav button {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--fg-primary);
    transition: background 0.2s;
}

.scheduler-nav button:hover {
    background: var(--bg-hover);
}

.scheduler-months-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
}

.scheduler-month {
    flex: 1 1 300px;
    max-width: 100%;
    /* Was 400px static, causes overflow if parent is small */
    background: var(--bg-card);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-sizing: border-box;
    /* Ensure padding doesn't add to width */
}

.scheduler-month h4 {
    text-align: center;
    margin: 0 0 1rem 0;
    color: var(--fg-primary);
}

.scheduler-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    /* Reduced from 0.25rem to prevent overflow on tight screens */
}

.day-header {
    text-align: center;
    font-size: 0.85rem;
    color: var(--fg-secondary);
    font-weight: 500;
    padding-bottom: 0.5rem;
}

.day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--fg-primary);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    /* Reset browser default */
    margin: 0;
    width: 100%;
    /* Fill grid cell */
}

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

.day-cell.selected {
    background: var(--accent);
    color: white;
    font-weight: bold;
}

.day-cell:disabled {
    color: var(--fg-muted);
    cursor: not-allowed;
    opacity: 0.5;
}

.day-cell.disabled:hover {
    background: transparent;
}

/* Slots Panel */
#scheduler-slots {
    max-width: 600px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.slots-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.btn-slot {
    padding: 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    color: var(--primary);
    transition: all 0.2s;
}

.btn-slot:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.success-message {
    text-align: center;
    padding: 2rem;
    background: var(--bg-success-soft);
    border-radius: var(--radius-md);
    color: var(--fg-success);
}

/* Old button styles removed - now styled via .scheduler-nav button */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .scheduler-months-container {
        justify-content: flex-start;
        /* Was center, caused cut-off */
        flex-direction: column;
        align-items: stretch;
        /* Stretch to fill width, don't center (avoids left clip if overflow triggers) */
        padding: 0 0.5rem;
        /* Add slight visual padding to container */
    }

    .scheduler-month {
        max-width: 100%;
        width: 100%;
        padding: 0.5rem;
        /* Reduce padding on mobile to save space */
        box-sizing: border-box;
    }

    .day-cell {
        font-size: 0.8rem;
        /* Slightly smaller text */
    }

    /* Reduce header size to bring content up */
    h1 {
        font-size: 1.8rem !important;
        margin-bottom: 0.5rem;
    }
}