/* ============================================================
   EduJA — Cookie consent banner, preferences modal, and the
   persistent "Cookie Settings" reopen pill. Loaded on every page
   alongside js/cookie-consent.js. Kept in its own file/namespace
   (eduja-cc- prefix) so it never collides with each page's own
   .modal / .footer-btn styling.
   ============================================================ */

#eduja-cc-root, #eduja-cc-root * { box-sizing: border-box; }

/* ---------------- Banner ---------------- */
.eduja-cc-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9998;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #020804ee;
    backdrop-filter: blur(4px);
    border-top: 2px solid #FDB827;
    padding: 16px 20px;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.45);
}
.eduja-cc-banner.eduja-cc-visible { display: flex; }

.eduja-cc-banner-text {
    color: #f5e7c8;
    max-width: 640px;
    flex: 1 1 320px;
}
.eduja-cc-banner-text strong {
    color: #FDB827;
    display: block;
    font-size: 0.95rem;
    margin-bottom: 4px;
}
.eduja-cc-banner-text p { font-size: 0.8rem; line-height: 1.45; opacity: 0.95; margin: 0; }
.eduja-cc-banner-text a { color: #00cc66; text-decoration: underline; }

.eduja-cc-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

/* ---------------- Shared buttons ---------------- */
.eduja-cc-btn {
    border-radius: 30px;
    padding: 9px 16px;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    min-height: 38px;
}
.eduja-cc-btn-primary { background: #FDB827; color: #000; border: none; }
.eduja-cc-btn-primary:hover { background: #ffcf5c; }
.eduja-cc-btn-outline { background: transparent; color: #FDB827; border: 1px solid #FDB827; }
.eduja-cc-btn-outline:hover { background: rgba(253, 184, 39, 0.12); }

/* ---------------- Preferences modal ---------------- */
.eduja-cc-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.72);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.eduja-cc-modal.eduja-cc-visible { display: flex; }

.eduja-cc-modal-content {
    background: #ffffff;
    color: #1a1a2e;
    border: 2px solid #FDB827;
    border-radius: 20px;
    padding: 22px 22px 18px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}
.eduja-cc-modal-content h3 { color: #006633; font-size: 1.1rem; margin-bottom: 8px; }
.eduja-cc-modal-intro { font-size: 0.8rem; opacity: 0.85; margin-bottom: 14px; line-height: 1.4; }

.eduja-cc-close-x {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    line-height: 1;
}
.eduja-cc-close-x:hover { color: #000; }

.eduja-cc-category {
    border: 1px solid #e5e5e0;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.eduja-cc-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}
.eduja-cc-category-title { font-weight: 700; font-size: 0.88rem; color: #1a1a2e; }
.eduja-cc-category p { font-size: 0.76rem; line-height: 1.4; color: #444; margin: 0; }
.eduja-cc-category code { background: #f0f0e8; padding: 1px 5px; border-radius: 4px; font-size: 0.72rem; }

/* Toggle switch */
.eduja-cc-switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.eduja-cc-switch input { opacity: 0; width: 0; height: 0; }
.eduja-cc-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 22px;
    transition: 0.2s;
}
.eduja-cc-slider::before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.eduja-cc-switch input:checked + .eduja-cc-slider { background: #006633; }
.eduja-cc-switch input:checked + .eduja-cc-slider::before { transform: translateX(18px); }
.eduja-cc-switch-disabled { opacity: 0.7; cursor: not-allowed; }
.eduja-cc-switch-disabled .eduja-cc-slider { cursor: not-allowed; background: #006633; }
.eduja-cc-switch-disabled .eduja-cc-slider::before { transform: translateX(18px); }

.eduja-cc-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

/* ---------------- Reopen pill ---------------- */
.eduja-cc-reopen {
    display: none;
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 1400;
    background: #1e2a1e;
    color: #f5e7c8;
    border: 1px solid #3a4a3a;
    border-radius: 30px;
    padding: 7px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.eduja-cc-reopen.eduja-cc-visible { display: inline-flex; align-items: center; }
.eduja-cc-reopen:hover { background: #2a3a2a; border-color: #FDB827; }

@media (max-width: 640px) {
    .eduja-cc-banner { justify-content: flex-start; padding: 14px 14px 16px; }
    .eduja-cc-banner-actions { width: 100%; }
    .eduja-cc-banner-actions .eduja-cc-btn { flex: 1 1 auto; text-align: center; }
    .eduja-cc-reopen { font-size: 0.66rem; padding: 6px 12px; left: 10px; bottom: 10px; }
}
