/* Cookie Title Styles */
h2#id-cookie-title {
    font-family: "Roboto", sans-serif;
    font-size: 22px;
    font-weight: 400;
    font-style: normal;
}

/* Button Base Styles (Unified) */
.klaro .cookie-modal .cm-btn, 
.klaro .context-notice .cm-btn, 
.klaro .cookie-notice .cm-btn, 
.klaro.learn-more-as-button .cookie-notice:not(.cookie-modal-notice) a.cm-link.cn-learn-more {
    display: inline-block;
    width: fit-content;
    padding: var(--klaro-button-padding);
    color: var(--klaro-button-text-color);
    border: 2px solid #a70000;
    border-radius: var(--klaro-button-border-radius);
    background-color: #c10302;
    box-shadow: var(--klaro-button-box-shadow);
    font-size: var(--klaro-button-font-size);
    font-weight: var(--klaro-button-font-weight);
    line-height: var(--klaro-button-line-height);
    text-decoration: none; /* Added for the 'a' tag link */
}

/* Button Hover States */
.klaro .cookie-modal .cm-btn:hover, 
.klaro .context-notice .cm-btn:hover, 
.klaro .cookie-notice .cm-btn:hover, 
.klaro.learn-more-as-button .cookie-notice:not(.cookie-modal-notice) a.cm-link.cn-learn-more:hover {
    color: white;
    border: 2px solid #a70000;
    background-color: #9d0100;
    transition: background-color 0.3s ease; /* Smooth transition as requested */
}

/* Responsive Adjustments */
@media (max-width: 1023px) {
    .klaro .cookie-notice:not(.cookie-modal-notice) {
        border-style: none;
        border-radius: 0;
    }
}

/* 1. Base State: Force Red Background and White Text */
.klaro.klaro-theme-mars .cookie-modal .cm-btn, 
.klaro.klaro-theme-mars .context-notice .cm-btn, 
.klaro.klaro-theme-mars .cookie-notice .cm-btn, 
.klaro.klaro-theme-mars.learn-more-as-button .cookie-notice:not(.cookie-modal-notice) a.cm-link.cn-learn-more {
    background-color: #c10302 !important; /* UNLV Red */
    border: 2px solid #a70000 !important;
    color: #ffffff !important;
    display: inline-block;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 2. Hover State: Force Dark Red */
.klaro.klaro-theme-mars .cookie-modal .cm-btn:hover, 
.klaro.klaro-theme-mars .context-notice .cm-btn:hover, 
.klaro.klaro-theme-mars .cookie-notice .cm-btn:hover, 
.klaro.klaro-theme-mars.learn-more-as-button .cookie-notice:not(.cookie-modal-notice) a.cm-link.cn-learn-more:hover {
    background-color: #880100 !important; /* Darker Red */
    border-color: #700100 !important;
    color: #ffffff !important;
}

/* 3. Handling Specific Klaro Color Classes (Success/Danger/Info) */
.klaro.klaro-theme-mars .cm-btn.cm-btn-success,
.klaro.klaro-theme-mars .cm-btn.cm-btn-danger,
.klaro.klaro-theme-mars .cm-btn.cm-btn-info,
.klaro.klaro-theme-mars .cm-btn.cm-btn-decline {
    background-color: #c10302 !important;
    color: #ffffff !important;
    border: 2px solid #a70000 !important;
}

.klaro .cookie-notice:not(.cookie-modal-notice) {
    background-color: #333;
    background-color: rgb(238 238 238 / 85%);
}

/* Focus states for the Modal and Notices */
.klaro .cm-modal.cm-klaro:focus, 
.klaro .cm-modal.cm-klaro:focus-visible, 
.klaro .context-notice:focus, 
.klaro .context-notice:focus-visible, 
.klaro .cookie-notice:focus, 
.klaro .cookie-notice:focus-visible {
    outline: var(--klaro-dialog-focus-outline);
    /* Using a multi-layered shadow for better accessibility visibility */
    box-shadow: var(--klaro-dialog-focus-box-shadow), 0 0 0 10px #ad1a16 !important;
}

/* Focus state for all Klaro buttons and the Learn More link */
.klaro.klaro-theme-mars .cookie-modal .cm-btn:focus, 
.klaro.klaro-theme-mars .context-notice .cm-btn:focus, 
.klaro.klaro-theme-mars .cookie-notice .cm-btn:focus, 
.klaro.klaro-theme-mars.learn-more-as-button .cookie-notice:not(.cookie-modal-notice) a.cm-link.cn-learn-more:focus {
    outline: 2px solid #a70000 !important;
    outline-offset: var(--klaro-button-focus-outline-offset) !important;
    box-shadow: var(--klaro-button-focus-box-shadow) !important;
}

/* Also applying to focus-visible for modern browser accessibility */
.klaro.klaro-theme-mars .cookie-modal .cm-btn:focus-visible, 
.klaro.klaro-theme-mars .context-notice .cm-btn:focus-visible, 
.klaro.klaro-theme-mars .cookie-notice .cm-btn:focus-visible, 
.klaro.klaro-theme-mars.learn-more-as-button .cookie-notice:not(.cookie-modal-notice) a.cm-link.cn-learn-more:focus-visible {
    outline: 2px solid #a70000 !important;
    outline-offset: var(--klaro-button-focus-outline-offset) !important;
    box-shadow: var(--klaro-button-focus-box-shadow) !important;
}

/* Close Button Base State */
.klaro .klaro-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 45px;
    padding: 0;
    cursor: pointer;
    color: var(--light1, #fafafa);
    border: none;
    background: none;
    /* Reset default browser outline to use our custom one */
    outline: none; 
    transition: all 0.2s ease;
}

/* Close Button Focus State */
.klaro .klaro-close:focus,
.klaro .klaro-close:focus-visible {
    outline: 2px solid #a70000 !important;
    outline-offset: -2px; /* Pulls the outline inside slightly so it doesn't get cut off at the edge */
    box-shadow: 0 0 5px rgba(167, 0, 0, 0.5);
}

/* Close Button Hover State for better UX */
.klaro .klaro-close:hover {
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Required Checkbox Sliders (Checked State) */
.klaro .cookie-modal .cm-list-input.required:checked + .cm-list-label .slider,
.klaro .context-notice .cm-list-input.required:checked + .cm-list-label .slider,
.klaro .cookie-notice .cm-list-input.required:checked + .cm-list-label .slider {
    background-color: #c10302 !important;
}

/* Only-Required Checkbox Sliders (Warning/Disabled State) */
.klaro .cookie-modal .cm-list-input.only-required + .cm-list-label .slider,
.klaro .context-notice .cm-list-input.only-required + .cm-list-label .slider,
.klaro .cookie-notice .cm-list-input.only-required + .cm-list-label .slider {
    background-color: #d04640 !important; /* Kept the red-tone to match UNLV branding */
    opacity: 0.8;
}

/* General Checkbox Sliders (All other checked states) */
.klaro .cookie-modal .cm-list-input:checked + .cm-list-label .slider,
.klaro .context-notice .cm-list-input:checked + .cm-list-label .slider,
.klaro .cookie-notice .cm-list-input:checked + .cm-list-label .slider {
    background-color: #c10302 !important;
}
/* Styles for screens 480px wide or smaller */

    .klaro .cookie-modal .cm-modal.cm-klaro {
        top: 12% !important;
        max-height: calc(100vh - 100px) !important;
        transform: none !important;
        margin-top: 0 !important;
    }
    
/* Styles for backend theme to account for 100px top banner */
.cm-modal.cm-klaro {
    /* Anchors the modal 100px from the top to sit flush with your banner */
    position: relative !important;
    top: 100px !important;

    /* Adjusts the height so the modal doesn't overflow the bottom of the screen */
    /* Total Viewport Height - Banner Height = Correct Modal Height */
    max-height: calc(100vh - 100px) !important;

    /* Removes default centering transforms that would push it back under the banner */
    transform: none !important;
    margin-top: 0 !important;
    
    /* Ensures it stays above other backend UI elements */
    z-index: 999999 !important;
}

/* Internal scroll support for long cookie lists */
.cm-modal.cm-klaro .cm-body {
    max-height: calc(100vh - 250px) !important;
    overflow-y: auto !important;
}

.klaro_toggle_dialog:focus {
    transform: scale(1.2);
    outline: 4px solid #bd2a2a;
}

button#klaro_toggle_dialog {
    display: none!important;
}

div#klaro-cookie-notice {
    display: none;
}