/* EUREKA COOKIE MANAGER FRONTEND CSS */

.eureka-cookie-hidden {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   BANER – WERSJA ODPORNA NA BACKDROP-FILTER I STACKING CONTEXT MOTYWU
   Problem: backdrop-filter/will-change w motywie tworzą nowy containing block
   dla position:fixed, przez co tło banera staje się przezroczyste na
   niektórych podstronach (harmonogram, rady pedagogiczne itp.)
   Rozwiązanie: zestaw właściwości izolujący baner od efektów rodzica.
   ───────────────────────────────────────────────────────────────────────────── */
#eureka-cookie-banner {
    /* Pozycjonowanie – wymuszamy własny stacking context */
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;

    /* Tło – ZAWSZE nieprzezroczyste białe */
    background-color: #ffffff !important;
    background-image: none !important;

    /* Izolacja od backdrop-filter rodziców */
    isolation: isolate !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;

    /* Własna warstwa GPU – wyjście z will-change rodzica */
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;

    /* Gwarancja widoczności */
    opacity: 1 !important;
    visibility: visible !important;

    /* Cień i styl */
    box-shadow: 0 -4px 24px rgba(0,0,0,0.13), 0 -1px 0 rgba(0,0,0,0.06) !important;
    border-top: 1px solid rgba(0,0,0,0.07) !important;
    z-index: 9999995 !important;
    padding: 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Czyszczenie wszelkich odziedziczeń */
    filter: none !important;
    mix-blend-mode: normal !important;
    contain: layout style !important;
}

.eureka-cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media(min-width: 768px) {
    .eureka-cookie-banner-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.eureka-cookie-banner-content p {
    margin: 0;
    font-size: 14px;
    color: #334155;
    line-height: 1.5;
    flex: 1;
}

.eureka-cookie-banner-content a {
    color: #2563eb;
    text-decoration: underline;
}

.eureka-cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.eureka-cookie-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.eureka-cookie-btn:focus-visible,
#eureka-cookie-modal-close:focus-visible,
#eureka-cookie-floating-btn:focus-visible,
.eureka-cookie-toggle input:focus-visible + .eureka-cookie-slider {
    outline: 3px solid rgba(37, 99, 235, 0.38);
    outline-offset: 3px;
}

.eureka-cookie-btn-primary {
    background: #2563eb;
    color: #fff;
}
.eureka-cookie-btn-primary:hover {
    background: #1d4ed8;
}

.eureka-cookie-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}
.eureka-cookie-btn-secondary:hover {
    background: #e2e8f0;
}

.eureka-cookie-btn-text {
    background: transparent;
    color: #64748b;
    text-decoration: underline;
}

/* Modal Centrum Preferencji */
.eureka-cookie-modal-overlay {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    background: rgba(0,0,0,0.5) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    isolation: isolate !important;
    transform: translateZ(0) !important;
    z-index: 2147483646 !important;
}

#eureka-cookie-modal .eureka-cookie-modal-content {
    position: fixed !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    transform: translateZ(0) !important;
    background-color: #ffffff !important;
    background-image: none !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
    z-index: 2147483647 !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    isolation: isolate !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    mix-blend-mode: normal !important;
}

@media(min-width: 768px) {
    #eureka-cookie-modal .eureka-cookie-modal-content {
        top: 50% !important; left: 50% !important;
        right: auto !important; bottom: auto !important;
        transform: translate(-50%, -50%) translateZ(0) !important;
        -webkit-transform: translate(-50%, -50%) translateZ(0) !important;
        width: 90% !important;
        max-width: 600px !important;
        height: auto !important;
        max-height: 90vh !important;
        border-radius: 12px !important;
    }
}

.eureka-cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px 20px; /* Dodano fallback 0px */
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
    position: relative; /* Zamiast sticky, skoro content-body ma overflow-y: auto */
    z-index: 10;
    flex-shrink: 0;
}
.eureka-cookie-modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}
#eureka-cookie-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}
#eureka-cookie-modal-close:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}
#eureka-cookie-modal-close svg {
    width: 24px;
    height: 24px;
}

.eureka-cookie-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1; /* Zapewnia przewijanie tej sekcji */
    overscroll-behavior: contain;
}
.eureka-cookie-modal-body p {
    font-size: 14px;
    color: #475569;
    margin-top: 0;
    margin-bottom: 20px;
}

.eureka-cookie-categories-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.eureka-cookie-category-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
}

.eureka-cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.eureka-cookie-category-header strong {
    font-size: 15px;
    color: #1e293b;
}
.eureka-cookie-required-badge {
    font-size: 11px;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
    white-space: nowrap;
}

.eureka-cookie-category-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.eureka-cookie-modal-footer {
    padding: 20px 20px calc(env(safe-area-inset-bottom) + 20px);
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    background: #fff;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}
.eureka-cookie-modal-footer .eureka-cookie-btn {
    width: 100%;
    min-height: 48px;
}
@media(min-width: 768px) {
    .eureka-cookie-modal-footer .eureka-cookie-btn {
        width: auto;
    }
}

/* Switch */
.eureka-cookie-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.eureka-cookie-toggle input {
    opacity: 0; width: 0; height: 0;
}
.eureka-cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 22px;
}
.eureka-cookie-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .eureka-cookie-slider {
    background-color: #2563eb;
}
input:focus + .eureka-cookie-slider {
    box-shadow: 0 0 1px #2563eb;
}
input:checked + .eureka-cookie-slider:before {
    transform: translateX(18px);
}
input:disabled + .eureka-cookie-slider {
    background-color: #94a3b8;
    cursor: not-allowed;
}

/* Floating Button */
#eureka-cookie-floating-btn {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 20px);
    left: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    cursor: pointer;
    z-index: 9999995;
}

@media (prefers-reduced-motion: reduce) {
    .eureka-cookie-btn,
    #eureka-cookie-modal-close,
    .eureka-cookie-slider,
    .eureka-cookie-slider::before {
        transition: none !important;
    }
}

/* Wymuszone ukrywanie bocznych widgetów przy otwartym modalu cookies */
body.eureka-cookie-modal-open .eureka-social-widget,
body.eureka-cookie-modal-open .social-floating-widget,
body.eureka-cookie-modal-open .floating-socials,
body.eureka-cookie-modal-open .side-widget,
body.eureka-cookie-modal-open .eureka-side-widget,
body.eureka-cookie-modal-open .fixed-side-widget,
body.eureka-cookie-modal-open [data-cpt="widget-social-media"],
body.eureka-cookie-modal-open [data-cpt="widget-boczny"],
body.eureka-cookie-modal-open [data-eureka-floating-widget="true"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Wymuszone ukrywanie bocznych widgetów przy otwartym banerze TYLKO NA MOBILE */
@media (max-width: 767px) {
    body.eureka-cookie-banner-open .eureka-social-widget,
    body.eureka-cookie-banner-open .social-floating-widget,
    body.eureka-cookie-banner-open .floating-socials,
    body.eureka-cookie-banner-open .side-widget,
    body.eureka-cookie-banner-open .eureka-side-widget,
    body.eureka-cookie-banner-open .fixed-side-widget,
    body.eureka-cookie-banner-open [data-cpt="widget-social-media"],
    body.eureka-cookie-banner-open [data-cpt="widget-boczny"],
    body.eureka-cookie-banner-open [data-eureka-floating-widget="true"] {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}
