/* The cookie banner and settings dialog on the site template (Views/Shared/Site/_Cookies.cshtml), with Ajebhom.
   Design base tokens (ds.css), so day and night follow the site. Behaviour: Common/js/cookie-consent.js. */

.cc [hidden] {
    display: none !important;
}

.cc-title {
    margin: 0 0 4px !important;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.5;
    color: var(--ds-ink);
}

.cc-text {
    margin: 0 !important;
    font-size: 14.5px;
    line-height: 1.85;
    color: var(--ds-text);
}

    .cc-text a {
        font-weight: 700;
        color: var(--ds-red);
        text-decoration: underline;
        text-underline-offset: 3px;
    }

.cc-bot {
    flex: none;
    width: 84px;
    height: 84px;
    animation: cc-bob 3.2s ease-in-out infinite;
}

.cc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- the banner: a card at the bottom, Ajebhom at its start ---------- */
.cc-banner {
    position: fixed;
    inset-inline: 20px;
    bottom: 20px;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1080px;
    margin-inline: auto;
    padding: 16px 22px 16px 16px;
    border-radius: var(--ds-r-xl, 22px);
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-top: 3px solid var(--ds-red);
    box-shadow: var(--ds-shadow-lg);
    animation: cc-rise .5s cubic-bezier(.16, 1, .3, 1) both;
}

    .cc-banner .cc-bot {
        margin: -26px 0 -10px;
    }

.cc-body {
    flex: 1;
    min-width: 0;
}

.cc-banner .cc-actions {
    flex: none;
}

/* ---------- the settings dialog ---------- */
.cc-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483001;
    display: grid;
    place-items: center;
    padding: 20px;
}

.cc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 13, 14, .55);
    backdrop-filter: blur(3px);
}

.cc-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    padding: 22px 24px;
    border-radius: var(--ds-r-xl, 22px);
    background: var(--ds-surface);
    border-top: 3px solid var(--ds-red);
    box-shadow: var(--ds-shadow-lg);
    animation: cc-pop .3s cubic-bezier(.34, 1.56, .64, 1) both;
}

    .cc-dialog:focus {
        outline: 0;
    }

.cc-dialog-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

    .cc-dialog-head .cc-bot {
        width: 72px;
        height: 72px;
        margin: -6px 0 -8px;
    }

    .cc-dialog-head > div {
        flex: 1;
        min-width: 0;
    }

.cc-close {
    display: grid;
    flex: none;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: var(--ds-soft);
    font-size: 15px;
    color: var(--ds-muted);
    cursor: pointer;
}

    .cc-close:hover {
        background: var(--ds-red-soft);
        color: var(--ds-red);
    }

.cc-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cc-category {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--ds-surface-2);
    border: 1px solid var(--ds-line-soft);
}

.cc-category-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--ds-red-soft);
    font-size: 15px;
    color: var(--ds-red);
}

.cc-category-body {
    flex: 1;
    min-width: 0;
}

.cc-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    cursor: pointer;
}

    .cc-category-head b {
        font-size: 15.5px;
        color: var(--ds-ink);
    }

.cc-always {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 100px;
    background: var(--ds-ok-soft);
    font-size: 13px;
    font-weight: 700;
    color: var(--ds-ok);
}

/* a switch: the real checkbox is invisible on top of it */
.cc-switch {
    position: relative;
    flex: none;
    width: 46px;
    height: 26px;
}

    .cc-switch input {
        position: absolute;
        inset: 0;
        z-index: 1;
        margin: 0;
        opacity: 0;
        cursor: pointer;
    }

    .cc-switch span {
        position: absolute;
        inset: 0;
        border-radius: 100px;
        background: var(--ds-line);
        transition: background .2s ease;
    }

        .cc-switch span::after {
            content: "";
            position: absolute;
            top: 3px;
            inset-inline-start: 3px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #FFF;
            box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
            transition: transform .2s ease;
        }

    .cc-switch input:checked + span {
        background: var(--ds-red);
    }

        .cc-switch input:checked + span::after {
            transform: translateX(20px);
        }

[dir="rtl"] .cc-switch input:checked + span::after {
    transform: translateX(-20px);
}

.cc-switch input:focus-visible + span {
    box-shadow: 0 0 0 3px var(--ds-red-soft);
}

.cc-dialog .cc-actions {
    justify-content: flex-end;
}

@keyframes cc-rise {
    from { opacity: 0; transform: translateY(24px); }
}

@keyframes cc-pop {
    from { opacity: 0; transform: scale(.94); }
}

@keyframes cc-bob {
    50% { transform: translateY(-4px); }
}

/* ---------- smaller screens ---------- */
@media (max-width: 991px) {
    .cc-banner {
        flex-wrap: wrap;
    }

        .cc-banner .cc-body {
            flex-basis: calc(100% - 110px);
        }

        .cc-banner .cc-actions {
            width: 100%;
            justify-content: flex-end;
        }
}

@media (max-width: 575px) {
    .cc-banner {
        inset-inline: 10px;
        bottom: 10px;
        gap: 10px 12px;
        padding: 14px;
    }

        .cc-banner .cc-bot {
            width: 64px;
            height: 64px;
            margin: -24px 0 -6px;
        }

        .cc-banner .cc-body {
            flex-basis: calc(100% - 80px);
        }

    .cc-text {
        font-size: 13.5px;
    }

    .cc-actions .ds-btn {
        flex: 1 1 auto;
    }

    .cc-modal {
        align-items: end;
        padding: 0;
    }

    .cc-dialog {
        width: 100%;
        max-height: 90vh;
        padding: 18px 16px;
        border-radius: 22px 22px 0 0;
    }

        .cc-dialog-head .cc-bot {
            display: none;
        }
}

@media (prefers-reduced-motion: reduce) {
    .cc-bot,
    .cc-banner,
    .cc-dialog {
        animation: none;
    }
}
