/* Cookie Consent BR Styles */
:root {
    /* Fallbacks if not set */
    --ccbr-primary: #000000;
    --ccbr-banner-bg: #ffffff;
    --ccbr-banner-text: #333333;
    --ccbr-modal-bg: #ffffff;
    --ccbr-modal-text: #333333;

    --ccbr-border: rgba(0, 0, 0, 0.1);
    --ccbr-radius: 12px;
    --ccbr-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --ccbr-overlay: rgba(0, 0, 0, 0.5);
    /* For glassmorphism, we'll try to add opacity in css */
}

/* Base resets for banner */
#ccbr-banner *,
#ccbr-revisit-btn,
#ccbr-modal-overlay * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#ccbr-banner {
    position: fixed;
    background: var(--ccbr-banner-bg);
    border: 1px solid var(--ccbr-border);
    padding: 24px;
    box-shadow: var(--ccbr-shadow);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
    color: var(--ccbr-banner-text);
}

/* Add glassmorphism if modern browsers */
@supports (backdrop-filter: blur(10px)) {
    #ccbr-banner {
        background-color: transparent !important;
        background-image: linear-gradient(var(--ccbr-banner-bg), var(--ccbr-banner-bg));
    }

    #ccbr-modal-overlay .ccbr-modal {
        background-color: transparent !important;
        background-image: linear-gradient(var(--ccbr-modal-bg), var(--ccbr-modal-bg));
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

/* We override background using relative color syntax if supported. */
@supports (background: rgb(from var(--ccbr-banner-bg) r g b / 90%)) {
    #ccbr-banner {
        background: rgb(from var(--ccbr-banner-bg) r g b / 90%) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }

    #ccbr-modal-overlay .ccbr-modal {
        background: rgb(from var(--ccbr-modal-bg) r g b / 95%) !important;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

#ccbr-banner.ccbr-visible {
    opacity: 1;
    visibility: visible;
}

/* Positioning */
.ccbr-pos-bottom {
    bottom: 20px;
    left: 20px;
    right: 20px;
    border-radius: var(--ccbr-radius);
    transform: translateY(20px);
}

.ccbr-pos-bottom.ccbr-visible {
    transform: translateY(0);
}

.ccbr-pos-top {
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    transform: translateY(-20px);
    border-top: none;
    border-left: none;
    border-right: none;
}

.ccbr-pos-top.ccbr-visible {
    transform: translateY(0);
}

.ccbr-pos-modal {
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 600px;
    border-radius: var(--ccbr-radius);
    transform: translate(-50%, -40%);
}

.ccbr-pos-modal.ccbr-visible {
    transform: translate(-50%, -50%);
}

@media (min-width: 768px) {
    .ccbr-pos-bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        max-width: 1000px;
        margin: 0 auto;
        bottom: 30px;
        left: 50%;
        transform: translate(-50%, 20px);
    }

    .ccbr-pos-bottom.ccbr-visible {
        transform: translate(-50%, 0);
    }

    .ccbr-pos-top {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.ccbr-content {
    flex: 1;
}

.ccbr-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ccbr-banner-text);
}

.ccbr-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: inherit;
    opacity: 0.8;
}

.ccbr-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.ccbr-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.ccbr-btn-primary {
    background: var(--ccbr-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ccbr-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.ccbr-btn-outline {
    background: transparent;
    color: var(--ccbr-banner-text);
    border: 1px solid var(--ccbr-banner-text);
    opacity: 0.8;
}

.ccbr-btn-outline:hover {
    opacity: 1;
}

/* Modal Styles */
#ccbr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--ccbr-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}

#ccbr-modal-overlay.ccbr-visible {
    opacity: 1;
    visibility: visible;
}

.ccbr-modal {
    background: var(--ccbr-modal-bg);
    color: var(--ccbr-modal-text);
    border-radius: var(--ccbr-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--ccbr-shadow);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* very light border for glass effect definition */
}

#ccbr-modal-overlay.ccbr-visible .ccbr-modal {
    transform: scale(1);
}

.ccbr-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--ccbr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ccbr-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--ccbr-modal-text);
}

.ccbr-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    line-height: 1;
}

.ccbr-close-btn:hover {
    opacity: 1;
}

.ccbr-modal-body {
    padding: 12px 24px;
}

.ccbr-pref-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--ccbr-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.ccbr-pref-item:last-child {
    border-bottom: none;
}

.ccbr-pref-info h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: var(--ccbr-modal-text);
}

.ccbr-pref-info p {
    margin: 0;
    font-size: 13px;
    color: inherit;
    opacity: 0.7;
    line-height: 1.4;
}

.ccbr-modal-actions {
    padding: 20px 24px;
    border-top: 1px solid var(--ccbr-border);
    display: flex;
    justify-content: flex-end;
}

/* Modal Button Override (we might want the outline button here to match modal text instead of banner text if it existed, but we only have save button which is primary btn) */

/* Switch styling for Checkboxes */
.ccbr-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ccbr-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.ccbr-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    background-color: rgba(128, 128, 128, 0.4);
    transition: .4s;
}

.ccbr-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.ccbr-slider {
    background-color: var(--ccbr-primary);
}

input:focus+.ccbr-slider {
    box-shadow: 0 0 1px var(--ccbr-primary);
}

input:checked+.ccbr-slider:before {
    transform: translateX(20px);
}

.ccbr-slider.round {
    border-radius: 24px;
}

.ccbr-slider.round:before {
    border-radius: 50%;
}

input:disabled+.ccbr-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

input:disabled+.ccbr-slider:before {
    background-color: #f4f4f4;
}

/* Revisit Button */
#ccbr-revisit-btn {
    position: fixed;
    bottom: 20px;
    background: var(--ccbr-primary);
    color: #fff;
    /* Always white inside the primary circle */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 999998;
    /* Under the banner if they overlap */
    transition: transform 0.2s ease, opacity 0.3s;
}

#ccbr-revisit-btn svg {
    fill: currentColor;
    width: 24px;
    height: 24px;
}

#ccbr-revisit-btn:hover {
    transform: scale(1.08);
}

.ccbr-rv-bottom-left {
    left: 20px;
}

.ccbr-rv-bottom-right {
    right: 20px;
}

/* Utility to toggle modal bg when it's closed vs hidden entirely */
.ccbr-hidden {
    visibility: hidden;
    opacity: 0;
}