/**
 * Cookie Consent Banner Styles
 * Version: 1.1.0
 *
 * GDPR-compliant cookie consent banner with:
 * - Modern glassmorphism design
 * - Smooth animations
 * - Orange gradient accents (matching admin design)
 * - Dark mode support
 * - Mobile responsive design
 *
 * Changelog:
 * - v1.1.0: Enhanced design with glassmorphism, better animations
 * - v1.0.0: Initial implementation
 */

/* ===== Banner Container ===== */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(calc(100% + 40px));
    z-index: var(--z-notification, 1080);
    width: calc(100% - 40px);
    max-width: 520px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.cookie-banner.is-visible {
    transform: translateX(-50%) translateY(0);
}

.cookie-banner__backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: calc(var(--z-notification, 1080) - 1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    pointer-events: none;
}

.cookie-banner__backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ===== Header ===== */
.cookie-banner__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--color-primary, #f97316) 0%, #fb923c 100%);
    color: white;
}

.cookie-banner__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.cookie-banner__title-icon {
    font-size: 22px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.cookie-banner__close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cookie-banner__close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.cookie-banner__close svg {
    width: 18px;
    height: 18px;
}

/* ===== Content ===== */
.cookie-banner__content {
    padding: 20px;
}

.cookie-banner__description {
    font-size: 13px;
    color: var(--text-secondary, #64748b);
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.cookie-banner__description a {
    color: var(--color-primary, #f97316);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.cookie-banner__description a:hover {
    color: var(--color-primary-dark, #ea580c);
    text-decoration: underline;
}

/* ===== Cookie Categories ===== */
.cookie-banner__categories {
    background: var(--color-gray-50, #f8fafc);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 18px;
}

.cookie-category {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    gap: 16px;
    border-bottom: 1px solid var(--color-gray-100, #f1f5f9);
    transition: background 0.2s;
}

.cookie-category:last-child {
    border-bottom: none;
}

.cookie-category:hover {
    background: rgba(249, 115, 22, 0.03);
}

.cookie-category--essential {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.06) 0%, transparent 100%);
}

.cookie-category--essential:hover {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.1) 0%, transparent 100%);
}

.cookie-category__info {
    flex: 1;
    min-width: 0;
}

.cookie-category__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0 0 3px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cookie-category__badge {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, var(--color-primary, #f97316) 0%, #fb923c 100%);
    color: white;
    padding: 3px 8px;
    border-radius: 20px;
}

.cookie-category__desc {
    font-size: 12px;
    color: var(--text-secondary, #64748b);
    margin: 0;
    line-height: 1.4;
}

/* ===== Toggle Switch ===== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch__input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-switch__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    border-radius: 26px;
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
    border: 2px solid transparent;
}

.toggle-switch__slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.toggle-switch__input:checked + .toggle-switch__slider {
    background-color: #f97316;
    background-image: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}

.toggle-switch__input:checked + .toggle-switch__slider::before {
    transform: translateY(-50%) translateX(22px);
}

.toggle-switch__input:disabled + .toggle-switch__slider {
    background-color: #f97316;
    background-image: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    opacity: 0.8;
    cursor: not-allowed;
}

.toggle-switch__input:disabled + .toggle-switch__slider::before {
    transform: translateY(-50%) translateX(22px);
}

.toggle-switch__input:focus + .toggle-switch__slider {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

.toggle-switch:hover .toggle-switch__slider {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.toggle-switch:hover .toggle-switch__input:checked + .toggle-switch__slider {
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

/* ===== Buttons ===== */
.cookie-banner__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-banner__btn {
    padding: 11px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.cookie-banner__btn--primary {
    background: linear-gradient(135deg, var(--color-primary, #f97316) 0%, #fb923c 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.cookie-banner__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.cookie-banner__btn--primary:active {
    transform: translateY(0);
}

.cookie-banner__btn--secondary {
    background: white;
    color: var(--text-primary, #1e293b);
    border: 1px solid var(--color-gray-200, #e2e8f0);
}

.cookie-banner__btn--secondary:hover {
    background: var(--color-gray-50, #f8fafc);
    border-color: var(--color-gray-300, #cbd5e1);
}

.cookie-banner__btn--ghost {
    background: transparent;
    color: var(--text-secondary, #64748b);
    padding: 11px 14px;
}

.cookie-banner__btn--ghost:hover {
    background: var(--color-gray-100, #f1f5f9);
    color: var(--text-primary, #1e293b);
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .cookie-banner {
    background: rgba(30, 41, 59, 0.95);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cookie-banner__backdrop {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .cookie-banner__description {
    color: var(--text-secondary, #94a3b8);
}

[data-theme="dark"] .cookie-banner__categories {
    background: rgba(15, 23, 42, 0.6);
}

[data-theme="dark"] .cookie-category {
    border-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .cookie-category:hover {
    background: rgba(249, 115, 22, 0.05);
}

[data-theme="dark"] .cookie-category--essential {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.1) 0%, transparent 100%);
}

[data-theme="dark"] .cookie-category__name {
    color: var(--text-primary, #f1f5f9);
}

[data-theme="dark"] .cookie-category__desc {
    color: var(--text-secondary, #94a3b8);
}

[data-theme="dark"] .toggle-switch__slider {
    background-color: #475569;
}

[data-theme="dark"] .toggle-switch__slider::before {
    background-color: #e2e8f0;
}

[data-theme="dark"] .cookie-banner__btn--secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #f1f5f9);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cookie-banner__btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .cookie-banner__btn--ghost {
    color: var(--text-secondary, #94a3b8);
}

[data-theme="dark"] .cookie-banner__btn--ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary, #f1f5f9);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 540px) {
    .cookie-banner {
        bottom: 12px;
        width: calc(100% - 24px);
        border-radius: 16px;
    }

    .cookie-banner__header {
        padding: 14px 16px;
    }

    .cookie-banner__content {
        padding: 16px;
    }

    .cookie-banner__title {
        font-size: 14px;
    }

    .cookie-banner__description {
        font-size: 12px;
    }

    .cookie-category {
        padding: 12px 14px;
    }

    .cookie-category__name {
        font-size: 12px;
    }

    .cookie-category__desc {
        font-size: 11px;
    }

    .cookie-banner__actions {
        flex-direction: column;
    }

    .cookie-banner__btn {
        width: 100%;
        text-align: center;
        padding: 13px 16px;
        justify-content: center;
    }

    .cookie-banner__btn--ghost {
        order: 3;
    }

    .cookie-banner__btn--secondary {
        order: 2;
    }

    .cookie-banner__btn--primary {
        order: 1;
    }
}

/* ===== Animations ===== */
@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(calc(100% + 40px));
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
    }
    50% {
        box-shadow: 0 4px 20px rgba(249, 115, 22, 0.5);
    }
}

.cookie-banner__btn--primary:focus {
    animation: pulse 1.5s ease-in-out infinite;
}
