﻿:root {
    --color-primary: #006EB3;
    --color-secondary: #233E6F;
    --Extended-Palette-Ice-Blue: #EBF3F9;
    --Supporting-Grey: #B8B6B0;
    --Supporting-Silver-Gray: #e2e5ea;
    --color-accent: #DA291C;
    --Extended-Palette-Grayish-Blue: #F5F7FA);
}

body:has(.modal-overlay.open) header.sticky-top {
    z-index: 1000;
    background-color: #fff;
}

/* ---------- Scrollable body ---------- */
.modal-body {
    flex: 1 1 auto;
    overflow-y: scroll;
    padding: 24px 20px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--Supporting-Silver-Gray);
}

.divider {
    height: 1px;
    background: var(--Supporting-Grey);
    margin: 4px 0;
    transition: background-color 0.8s ease;
}

/* ---------- Accordion ---------- */
.accordion-item{
    border:0px;
}

.accordion-trigger {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    cursor: pointer;
    text-align: left;
    color: var(--color-secondary);
}

.chevron {
    width: 22px;
    min-width: 22px;
    height: 22px;
    padding: 0px;
    border-radius: 50%;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    /*flex-shrink: 0;*/
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
    background-color: var(--Extended-Palette-Ice-Blue);
}

.chevron i {
    font-size: 10px;
}

    .chevron:hover {
        background-color: var(--color-secondary);
        color: #fff;
        border-color: var(--color-secondary);
    }

.divider:has(+ .accordion-item .accordion-trigger[aria-expanded="true"]) {
    background: var(--color-primary);
}

.accordion-trigger[aria-expanded="true"] .chevron {
    transform: rotate(180deg);
    background-color: var(--color-secondary);
    color: #fff !important;
    border-color: var(--color-secondary);
}

.accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease;
}

.accordion-panel-inner {
    padding-bottom: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    color: #3c4450;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 30, 0.45);
    display: none;
    align-items: baseline;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    max-height: 100vh;
}

    .modal-overlay.open {
        display: flex;
    }

.modal {
    position: relative;
    background: #fff;
    width: 100%;
    border-radius: 14px;
    align-self: flex-start;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 85vh;
}

@media (min-width: 768px) {
    .modal {
        max-width: 50%;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--Supporting-Silver-Gray);
}

.close-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    padding: 0px;
    background: var(--color-primary);
    border: none;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .close-btn:hover {
        background: var(--color-secondary);
    }

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 8px;
}

    .calendar-nav .month-label {
        font-weight: 700;
        font-size: 15px;
        color: #1f2733;
    }

.nav-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    padding: 0px;
    border: 1px solid var(--color-primary);
    background: #fff;
    color: var(--color-primary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .nav-btn:disabled {
        color: #c7cbd1;
        border-color: var(--Supporting-Silver-Gray);
        cursor: not-allowed;
    }

    .nav-btn:not(:disabled):hover {
        background: #f0f6ff;
    }

.weekday-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 4px 12px 0;
    text-align: center;
}

    .weekday-row span {
        font-size: 12px;
        color: var(--Supporting-Gray);
        padding: 6px 0;
    }

.day-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 6px;
    padding: 4px 12px 14px;
}

.day-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.day-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    padding: 0px;
    border: none;
    background: var(--Extended-Palette-Grayish-Blue);
    color: var(--Supporting-Charcoal);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .day-btn:hover:not(:disabled) {
        background: var(--Extended-Palette-Ice-Blue);
    }

    .day-btn:disabled {
        background: transparent;
        color: #d3d6db;
        cursor: not-allowed;
    }

    .day-btn.other-month {
        background: transparent;
        color: #d3d6db;
    }

    .day-btn.selected {
        background: var(--color-primary);
        color: #fff;
        font-weight: 700;
    }

.helper-text {
    padding: 20px 0px;
    margin: 0px 25px;
    border-top: 1px solid var(--Supporting-Silver-Gray);
    font-size: 13px;
    line-height: 1.45;
    color: #3c4450;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: var( --Extended-Palette-Grayish-Blue);
    border-top: 1px solid var(--Supporting-Silver-Gray);
}

.done-btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 10px 0px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

    .done-btn:hover {
        background: var(--color-secondary);
    }

/* --- the scrolling filter bar --- */
.filter-scroll {
    display: flex;
    flex-wrap: nowrap; /* keep buttons on one line */
    overflow-x: auto; /* scroll instead of wrap */
    -webkit-overflow-scrolling: touch; /* momentum scroll on iOS */
    scroll-snap-type: x proximity;
    gap: 0.5rem;
    padding-bottom: 0.5rem; /* room for the scrollbar */
    scrollbar-width: thin; /* Firefox */
}

    .filter-scroll::-webkit-scrollbar {
        height: 4px;
    }

    .filter-scroll::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 4px;
    }

    .filter-scroll input[type="radio"] {
        position: absolute;
        opacity: 0;
        width: 0;
        height: 0;
    }

        .filter-scroll input[type="radio"] + label {
            display: flex;
            height: 50px;
            padding: 0 20px;
            gap: 20px;
            border-radius: 4px;
            font-size: 15px;
            font-weight: 600;
            background: #fff;
            color: var(--color-secondary);
            border: 1px solid var(--Supporting-Silver-Gray);
            width: auto;
            justify-content: center;
            align-items: center;
            text-wrap: nowrap;
        }

.filter-scroll input[type="radio"] + label:hover {
    border: 2px solid var(--color-secondary);
    font-weight: 700;
    /*color: #fff;*/
}

.filter-scroll input[type="radio"]:checked + label:hover,
.filter-scroll input[type="radio"]:checked + label {
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
}
