// =========================================================
// * Matcha Calendar Picker Styles
// =========================================================
@mixin matcha-calendar-picker-theme($theme) {
    $foreground: map-get($theme, foreground);

    matcha-calendar-picker {
        display: block;
    }

    .matcha-calendar-picker {
        width: 100%;
        padding: 8px;
        background: getSurface($theme);
        color: map-get($foreground, text);
        box-sizing: border-box;
        user-select: none;
    }

    // ----- Cabeçalho -----
    .matcha-calendar-header {
        margin-bottom: 8px;
        gap: 4px;
    }

    // .matcha-calendar-toggle {
    //     display: inline-flex;
    //     align-items: center;
    //     gap: 4px;
    //     padding: 4px 6px;
    //     border: none;
    //     background: transparent;
    //     font: inherit;
    //     font-size: clamp(12px, 3.4vw, 14px);
    //     font-weight: 500;
    //     color: map-get($foreground, text);
    //     cursor: pointer;
    //     border-radius: 6px;
    //     white-space: nowrap;
    //     transition: background 0.2s ease;

    //     &:hover {
    //         background: getBackgroundAlpha($theme);
    //     }
    // }

    .matcha-calendar-decade-label {
        padding: 4px 6px;
        font-size: clamp(12px, 3.4vw, 14px);
        font-weight: 500;
        color: map-get($foreground, text);
        white-space: nowrap;
    }

    // ----- View de dias -----
    .matcha-calendar-weekdays,
    .matcha-calendar-days {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 2px;
    }

    .matcha-calendar-weekday {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 26px;
        font-size: clamp(10px, 2.8vw, 12px);
        color: getGrey($theme);
    }

    .matcha-calendar-day {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 38px;
        aspect-ratio: 1;
        min-width: 0;
        margin: 0 auto;
        padding: 0;
        border: none;
        background: transparent;
        font: inherit;
        font-size: clamp(11px, 3vw, 13px);
        color: map-get($foreground, text);
        cursor: pointer;
        border-radius: 50%;
        transition: background 0.2s ease, color 0.2s ease;

        &:hover:not(:disabled) {
            background: getBackgroundAlpha($theme);
        }

        &.matcha-calendar-day-outside {
            color: getGrey($theme);
        }

        &.matcha-calendar-day-today {
            font-weight: 700;
            color: getAccent($theme);
        }

        &.matcha-calendar-day-selected {
            background: getAccent($theme);
            color: getAccentContrast($theme);
            font-weight: 500;

            &:hover {
                background: getAccent($theme);
            }
        }

        &:disabled {
            color: getDisabled($theme);
            cursor: not-allowed;
        }
    }

    // ----- Views de meses / anos -----
    .matcha-calendar-month-view,
    .matcha-calendar-year-view {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .matcha-calendar-month,
    .matcha-calendar-year {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 36px;
        min-width: 0;
        padding: 0 4px;
        border: none;
        background: transparent;
        font: inherit;
        font-size: clamp(11px, 3vw, 13px);
        color: map-get($foreground, text);
        cursor: pointer;
        border-radius: 8px;
        white-space: nowrap;

        &:hover:not(:disabled) {
            background: getBackgroundAlpha($theme);
        }

        &.matcha-calendar-month-selected,
        &.matcha-calendar-year-selected {
            background: getAccent($theme);
            color: getAccentContrast($theme);
            font-weight: 500;
        }

        &:disabled {
            color: getDisabled($theme);
            cursor: not-allowed;
        }
    }

    // ----- Telas estreitas: compacta ainda mais -----
    @media (max-width: 360px) {
        .matcha-calendar-header {
            margin-bottom: 6px;
        }

        .matcha-calendar-weekday {
            height: 22px;
        }

        .matcha-calendar-month,
        .matcha-calendar-year {
            height: 32px;
        }
    }
}
