/* QD Consent Mode v2 — Minimalist sticky banner */

/* ─── Banner container ─────────────────────────────────────── */

#qd-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.10);
    padding: 14px 16px 18px;
    box-sizing: border-box;

    /* slide-up cu delay 2s */
    transform: translateY(100%);
    animation: qd-slide-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) 2s forwards;
}

@keyframes qd-slide-up {
    to { transform: translateY(0); }
}

/* Pe desktop: toast in coltul dreapta-jos */
@media (min-width: 768px) {
    #qd-cookie-banner {
        left: auto;
        right: 24px;
        bottom: 24px;
        max-width: 400px;
        border-radius: 14px;
        border: 1px solid rgba(0, 0, 0, 0.08);
        transform: translateY(calc(100% + 24px));
    }

    @keyframes qd-slide-up {
        to { transform: translateY(0); }
    }
}

/* ─── View toggle ──────────────────────────────────────────── */

.qd-cookie-preferences {
    display: none;
}

.qd-cookie-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Pe desktop: main view = row layout */
@media (min-width: 768px) {
    .qd-cookie-main {
        flex-direction: column;
        gap: 12px;
    }
}

/* ─── Texte ────────────────────────────────────────────────── */

.qd-banner-text-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qd-banner-title {
    font-size: 13px;
    font-weight: 600;
    color: #111111;
    margin: 0;
    line-height: 1.3;
}

.qd-banner-desc {
    font-size: 12px;
    color: #666666;
    margin: 0;
    line-height: 1.5;
}

/* ─── Butoane ──────────────────────────────────────────────── */

.qd-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.qd-btn {
    font-size: 12px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.2;
    transition: opacity 0.15s, background 0.15s;
    font-family: inherit;
}

.qd-btn-primary {
    background: #111111;
    color: #ffffff;
}

.qd-btn-outline {
    background: transparent;
    color: #444444;
    border: 1px solid #cccccc;
}

.qd-btn-ghost {
    background: transparent;
    color: #888888;
    padding-left: 0;
}

.qd-btn:hover { opacity: 0.75; }
.qd-btn:active { transform: scale(0.97); }

/* ─── Preferinte view ──────────────────────────────────────── */

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

.qd-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999999;
    line-height: 1;
    padding: 0;
    font-family: inherit;
}
.qd-close-btn:hover { color: #333333; }

.qd-pref-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #f0f0f0;
    margin-bottom: 12px;
}

.qd-pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.qd-pref-row:last-child { border-bottom: none; }

.qd-pref-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qd-pref-text strong {
    font-size: 12px;
    font-weight: 600;
    color: #111111;
}

.qd-pref-text span {
    font-size: 11px;
    color: #888888;
    line-height: 1.4;
}

.qd-always-on {
    font-size: 11px;
    color: #aaaaaa;
    white-space: nowrap;
    flex-shrink: 0;
}

.qd-buttons-prefs .qd-btn-primary {
    width: 100%;
    text-align: center;
    border-radius: 8px;
    padding: 9px 14px;
}

/* ─── Toggle switch ────────────────────────────────────────── */

.qd-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

.qd-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.qd-slider {
    position: absolute;
    inset: 0;
    background: #dddddd;
    border-radius: 11px;
    transition: background 0.2s;
}

.qd-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.qd-switch input:checked + .qd-slider {
    background: #111111;
}

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

.qd-switch input:focus-visible + .qd-slider {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

/* ─── Buton setari persistent (dupa accept) ────────────────── */

#qd-cookie-settings-link {
    display: none;
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 99998;
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    padding: 6px 12px 6px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #ffffff;
    color: #666666;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: opacity 0.15s;
}

#qd-cookie-settings-link:hover { opacity: 0.75; }

/* ─── Dark mode ────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    #qd-cookie-banner {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.08);
        box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.40);
    }

    .qd-banner-title { color: #f0f0f0; }
    .qd-banner-desc { color: #999999; }

    .qd-btn-primary { background: #f0f0f0; color: #111111; }
    .qd-btn-outline { color: #bbbbbb; border-color: #444444; }
    .qd-btn-ghost { color: #777777; }

    .qd-pref-list,
    .qd-pref-row { border-color: #2e2e2e; }
    .qd-pref-text strong { color: #f0f0f0; }
    .qd-pref-text span { color: #777777; }
    .qd-always-on { color: #666666; }

    .qd-slider { background: #444444; }
    .qd-switch input:checked + .qd-slider { background: #f0f0f0; }
    .qd-slider::before { background: #ffffff; }
    .qd-switch input:checked + .qd-slider::before { background: #111111; }

    #qd-cookie-settings-link {
        background: #1a1a1a;
        border-color: rgba(255,255,255,0.1);
        color: #888888;
    }
}