/**
 * Cookie Consent Overlay - Firefox-compatible version
 * Avoids filter:blur() which causes click-blocking issues in Firefox
 */

.consent-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    /* Semi-transparent overlay instead of blur - works in all browsers */
    background-color: rgba(10, 12, 18, 0.92);
    /* Ensure overlay captures all clicks */
    pointer-events: auto;
    /* Allow scrolling when dialog is taller than viewport (small phones) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    box-sizing: border-box;
}

.consent-overlay__dialog {
    position: relative;
    z-index: 100000;
    background-color: #1c2230;
    color: #fff;
    padding: 32px 28px;
    width: 90%;
    max-width: 440px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: center;
    /* Explicit pointer-events to ensure clickability */
    pointer-events: auto;
    /* Prevent dialog from being squashed; let overlay scroll instead */
    margin: auto;
    max-height: none;
    flex-shrink: 0;
}

/* On very small / short screens, reduce padding and font sizes so the dialog fits */
@media (max-height: 560px), (max-width: 360px) {
    .consent-overlay {
        align-items: flex-start;
    }
    .consent-overlay__dialog {
        padding: 20px 18px;
    }
    .consent-overlay__title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }
    .consent-overlay__text {
        font-size: 0.85rem;
        margin-bottom: 16px;
        line-height: 1.5;
    }
    .consent-overlay__btn {
        min-width: 110px;
        padding: 12px 18px;
        font-size: 0.9rem;
    }
}

.consent-overlay__title {
    margin: 0 0 14px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.consent-overlay__text {
    margin: 0 0 24px;
    line-height: 1.65;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
}

.consent-overlay__actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.consent-overlay__btn {
    display: inline-block;
    min-width: 130px;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    /* Critical: explicit pointer-events for Firefox */
    pointer-events: auto !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Ensure button is above everything */
    position: relative;
    z-index: 100001;
    /* Prevent text selection issues */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Ensure touch targets work */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.consent-overlay__btn:hover {
    cursor: pointer;
}

.consent-overlay__btn:focus {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

.consent-overlay__btn--accept {
    background-color: #3b82f6;
    color: #fff;
}

.consent-overlay__btn--accept:hover,
.consent-overlay__btn--accept:focus {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.consent-overlay__btn--accept:active {
    background-color: #1d4ed8;
    transform: translateY(0);
}

.consent-overlay__btn--reject {
    background-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.consent-overlay__btn--reject:hover,
.consent-overlay__btn--reject:focus {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.consent-overlay__btn--reject:active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(0);
}

/* Hide page content when consent required - no blur, just hide */
body.is-consent-required .page-wrapper {
    opacity: 0.15;
    /* NO filter:blur - this causes Firefox click issues */
    pointer-events: none;
}

/* When overlay is hidden */
.consent-overlay[hidden],
.consent-overlay.is-hidden {
    display: none;
}
