/* =========================================
   Simple Cookie Banner V2
   Stil: CookieYes-like (Light default)
   ========================================= */

/* ===== BANNER PRINCIPAL ===== */

#scb-cookie-banner {
    position: fixed;
    z-index: 99999;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #ffffff;
    color: #111827;
    padding: 18px 20px;
    box-sizing: border-box;
    border-radius: 16px;
    max-width: 440px;
}

/* layout interior → BUTOANE SUB TEXT */
#scb-cookie-banner .scb-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
}

#scb-cookie-banner .scb-text {
    font-size: 14px;
    line-height: 1.55;
}

#scb-cookie-banner .scb-text p {
    margin: 0 0 8px;
}

#scb-cookie-banner .scb-more-link {
    color: #22c55e;
    text-decoration: underline;
    font-weight: 500;
    font-size: 13px;
}

/* zona de butoane */
#scb-cookie-banner .scb-buttons {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 100%;
    justify-content: flex-start;
}

/* stil general butoane */
#scb-cookie-banner .scb-btn {
    border: none;
    cursor: pointer;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    transition:
        transform 0.1s ease,
        box-shadow 0.1s ease,
        background 0.15s ease,
        color 0.15s ease;
    white-space: nowrap;
}

/* ACCEPT – buton principal verde */
#scb-cookie-banner .scb-accept-all {
    background: #22c55e;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(34, 197, 94, 0.35);
}

/* Preferințe + Respinge – albe cu shadow */
#scb-cookie-banner .scb-prefs,
#scb-cookie-banner .scb-reject-all {
    background: #ffffff;
    color: #111827;
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
}

/* Respinge – variantă mai discretă */
#scb-cookie-banner .scb-reject-all {
    color: #6b7280;
    box-shadow: none;
    border-color: transparent;
}

/* hover efecte */
#scb-cookie-banner .scb-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.26);
}

#scb-cookie-banner .scb-accept-all:hover {
    filter: brightness(1.05);
}

#scb-cookie-banner .scb-prefs:hover {
    background: #f9fafb;
}

/* ===== POZIȚIONARE ===== */

.scb-pos-bottom-right {
    right: 20px;
    bottom: 20px;
}

.scb-pos-bottom-left {
    left: 20px;
    bottom: 20px;
}

.scb-pos-bottom,
.scb-pos-top {
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: 0;
    box-shadow: 0 -2px 20px rgba(15, 23, 42, 0.18);
}

.scb-pos-bottom { bottom: 0; }
.scb-pos-top { top: 0; }

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {

    #scb-cookie-banner {
        left: 8px;
        right: 8px;
        bottom: 8px;
        max-width: none;
        border-radius: 14px;
    }

    .scb-pos-bottom-right,
    .scb-pos-bottom-left {
        left: 8px;
        right: 8px;
    }

    #scb-cookie-banner .scb-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    #scb-cookie-banner .scb-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    #scb-cookie-banner .scb-btn {
        font-size: 13px;
    }
}

/* ===== Layout butoane pe mobil – toate pe același rând ===== */

/* Telefoane până la ~480px lățime */
@media (max-width: 480px) {
    #scb-cookie-banner .scb-buttons {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    #scb-cookie-banner .scb-btn {
        flex: 1 1 0;
        text-align: center;
        padding: 8px 6px;
        font-size: 12px;
    }
}

/* Extra mic (320–360px) – încă un pic mai compacte */
@media (max-width: 360px) {
    #scb-cookie-banner .scb-btn {
        padding: 7px 4px;
        font-size: 11px;
    }
}

/* =========================================
   MODAL PREFERINȚE COOKIE
   ========================================= */

.scb-modal {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scb-modal.scb-open { display: flex; }

.scb-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.scb-modal-dialog {
    position: relative;
    background: #ffffff;
    color: #111827;
    border-radius: 18px;
    padding: 20px 22px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
    z-index: 1;
}

.scb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.scb-modal-title {
    font-size: 18px;
    margin: 0;
    font-weight: 600;
}

.scb-modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
}

.scb-modal-body {
    font-size: 14px;
    line-height: 1.6;
}

/* LISTĂ CATEGORII */
.scb-category-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
}

.scb-category-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

/* Switch toggle – vizibil, nu doar „punct alb” */
.scb-switch {
    position: relative;
    width: 46px;
    height: 24px;
    display: inline-block;
}

.scb-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.scb-slider {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    cursor: pointer;
    transition: .2s;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.9);
}

.scb-slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.scb-switch input:checked + .scb-slider {
    background: #22c55e;
    box-shadow: inset 0 0 0 1px rgba(21, 128, 61, 0.9);
}

.scb-switch input:checked + .scb-slider:before {
    transform: translateX(22px);
}

.scb-modal-footer {
    margin-top: 16px;
    text-align: right;
}

.scb-modal-footer .scb-btn {
    background: #111827;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 14px;
}

/* =========================================
   BUTON REVISIT CONSENT (ROTIȚĂ)
   ========================================= */

#scb-revisit-consent {
    position: fixed;
    /* Mereu în colțul stânga-jos (desktop + mobile), cu suport pentru safe-area pe iOS */
    left: calc(16px + env(safe-area-inset-left, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(15,23,42,0.08);
    cursor: pointer;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 8px 18px rgba(15,23,42,0.25);

    display: none; /* ascuns by default; JS adaugă .scb-visible */

    align-items: center;
    justify-content: center;
    z-index: 99997;
}

/* când are consimțământ → JS pune clasa și devine vizibil */
#scb-revisit-consent.scb-visible {
    display: flex;
}

#scb-revisit-consent::before {
    content: "\2699"; /* ⚙ icon de setări */
    font-size: 24px;
    line-height: 1;
    display: block;
}

#scb-revisit-consent:hover {
    transform: translateY(-1px);
}

/* (Nu mai offsetăm pe mobil; butonul rămâne stânga-jos) */

/* =========================================
   RAPOARTE ADMIN
   ========================================= */

.scb-report-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 20px 0;
}

.scb-report-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    flex: 1 1 160px;
    box-shadow: 0 2px 4px rgba(15,23,42,.03);
}

.scb-report-card h3 {
    margin-top: 0;
    font-size: 14px;
}

.scb-report-number {
    font-size: 24px;
    margin-top: 8px;
    font-weight: 600;
}

/* =========================================
   ALWAYS ON TOP (peste orice alt element)
   ========================================= */

#scb-cookie-banner,
#scb-preferences-modal,
#scb-preferences-modal .scb-modal-dialog,
#scb-revisit-consent {
    z-index: 2147483647 !important;
}

/* Optional: pe mobil forțăm și position: fixed dacă vreo temă face transform-uri dubioase */
@media (max-width: 768px) {
    #scb-cookie-banner,
    #scb-preferences-modal,
    #scb-preferences-modal .scb-modal-dialog,
    #scb-revisit-consent {
        position: fixed !important;
    }
}
