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

.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: var(--surface-light);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    animation: slideUp 0.5s ease-out;

    /* Theme variables handling */
    :global([data-theme='dark']) & {
        background: rgba(30, 30, 30, 0.9);
        border-color: rgba(255, 255, 255, 0.1);
        color: #f1f1f1;
    }

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

        @media (min-width: 768px) {
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
        }
    }

    &__text {
        flex: 1;

        h3 {
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

        p {
            font-size: 0.9rem;
            line-height: 1.4;
            opacity: 0.9;
            margin: 0;
        }
    }

    &__actions {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
        justify-content: flex-end;

        @media (max-width: 768px) {
            width: 100%;
            justify-content: stretch;

            button {
                flex: 1;
            }
        }
    }

    &__button {
        padding: 0.6rem 1.2rem;
        border-radius: 0.5rem;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        border: none;

        &--primary {
            background: var(--primary);
            color: white;

            &:hover {
                opacity: 0.9;
                transform: translateY(-1px);
            }
        }

        &--secondary {
            background: transparent;
            border: 1px solid currentColor;
            color: inherit;

            &:hover {
                background: rgba(128, 128, 128, 0.1);
            }
        }

        &--text {
            background: transparent;
            color: inherit;
            text-decoration: underline;
            padding: 0.6rem 0.5rem;

            &:hover {
                opacity: 0.8;
            }
        }
    }

    /* Settings Modal/Panel styles could go here if managed within the same CSS, 
     but keeping it simple for now */
    &__settings {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border-light);
        display: flex;
        flex-direction: column;
        gap: 0.8rem;

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

    &__option {
        display: flex;
        align-items: center;
        justify-content: space-between;

        label {
            font-size: 0.9rem;
            cursor: pointer;
            display: flex;
            flex-direction: column;

            small {
                font-size: 0.75rem;
                opacity: 0.7;
            }
        }
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}