@use '../../styles/variables' as *;
@use '../../styles/mixins' as *;

.cookie-banner {
    position: relative;
    width: min(860px, 94vw);
    max-height: min(86vh, 860px);
    overflow: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(19, 35, 65, 0.12);
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 20px 48px rgba(12, 22, 46, 0.2);
    z-index: 1001;
    animation: slideUp 0.24s ease-out;

    [data-theme='dark'] & {
        background: rgba(15, 23, 42, 0.94);
        border-color: rgba(152, 180, 237, 0.22);
        color: #e8efff;
        box-shadow: 0 20px 48px rgba(2, 6, 23, 0.45);
    }

    &__content {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    &__text {
        h3 {
            font-size: 1.1rem;
            margin: 0;
            font-weight: 600;
        }

        p {
            font-size: 0.92rem;
            line-height: 1.45;
            opacity: 0.95;
            margin: 0.3rem 0 0;
        }
    }

    &__details {
        margin-top: 0.6rem;
        background: rgba(78, 129, 224, 0.08);
        border: 1px solid rgba(78, 129, 224, 0.15);
        border-radius: 10px;
        padding: 0.55rem 0.65rem;

        [data-theme='dark'] & {
            background: rgba(83, 140, 245, 0.12);
            border-color: rgba(110, 166, 255, 0.22);
        }

        strong {
            font-size: 0.78rem;
            opacity: 0.9;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        ul {
            margin: 0.3rem 0 0;
            padding-left: 1rem;
            display: grid;
            gap: 0.14rem;
        }

        li {
            font-size: 0.78rem;
            opacity: 0.88;
        }
    }

    &__actions {
        display: grid;
        gap: 0.5rem;
        grid-template-columns: 1fr 1fr 1fr;
    }

    @media (max-width: 640px) {
        &__actions {
            grid-template-columns: 1fr;
        }
    }

    &__button {
        padding: 0.62rem 0.8rem;
        border-radius: 0.62rem;
        font-size: 0.86rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid transparent;
        min-height: 40px;

        &--primary {
            background: linear-gradient(135deg, #2a6de0, #2390c2);
            color: white;

            &:hover {
                filter: brightness(1.06);
            }
        }

        &--secondary {
            background: var(--bg-primary);
            border-color: var(--border-color);
            color: var(--text-secondary);

            &:hover {
                background: rgba(120, 136, 164, 0.12);
            }
        }

        &--text {
            background: transparent;
            color: inherit;
            text-decoration: none;
            padding: 0.3rem 0.5rem;
            border: 1px solid var(--border-light);
            border-radius: 0.45rem;
            cursor: pointer;

            &:hover {
                opacity: 0.8;
            }
        }

        &--link {
            background: none;
            border: none;
            color: var(--primary);
            cursor: pointer;
            text-decoration: underline;
            font-size: 0.9rem;
            padding: 0;
        }
    }

    &__settings {
        margin-top: 0.8rem;
        padding-top: 0.8rem;
        border-top: 1px solid var(--border-light);
        display: flex;
        flex-direction: column;
        gap: 0.6rem;

        [data-theme='dark'] & {
            border-color: rgba(255, 255, 255, 0.16);
        }
    }

    &__option {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.8rem;
        padding: 0.46rem 0.1rem;

        label {
            font-size: 0.86rem;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            gap: 0.2rem;

            small {
                font-size: 0.76rem;
                opacity: 0.78;
            }
        }

        input[type='checkbox'] {
            width: 18px;
            height: 18px;
            accent-color: #2a6de0;
            margin-top: 3px;
        }
    }

    &__header-actions {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 0.2rem;
    }

    &__actions--settings {
        margin-top: 0.8rem;
    }
}

.cookie-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(8, 14, 27, 0.56);
    backdrop-filter: blur(4px);
}

@keyframes slideUp {
    from {
        transform: translateY(14px) scale(0.985);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}
