/* ============================
   COOKIE CONSENT BANNER
   ============================ */
.cookie-consent {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    padding: 0 16px;
    animation: cookieSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-consent.cookie-bottom {
    bottom: 0;
}

.cookie-consent.cookie-top {
    top: 0;
}

@keyframes cookieSlideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent.cookie-top .cookie-banner {
    border-radius: 0 0 16px 16px;
}

.cookie-banner {
    max-width: 1200px;
    margin: 0 auto 16px;
    background: var(--bg-secondary, rgba(15, 23, 42, 0.97));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color, rgba(99, 102, 241, 0.2));
    border-radius: 16px;
    padding: 0;
    box-shadow: var(--shadow-xl, 0 -8px 40px rgba(0, 0, 0, 0.4));
    overflow: hidden;
}

.cookie-main {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
}

.cookie-info {
    flex: 1;
    min-width: 0;
}

.cookie-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #f8fafc);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-text {
    font-size: 0.85rem;
    color: var(--text-secondary, #94a3b8);
    margin: 0;
    line-height: 1.5;
}

.cookie-link {
    font-size: 0.8rem;
    color: var(--primary-color, #818cf8);
    text-decoration: none;
    display: inline-block;
    margin-top: 6px;
    transition: color 0.2s;
}

.cookie-link:hover {
    color: var(--primary-hover, #a5b4fc);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.cookie-btn-reject {
    background: var(--bg-tertiary, rgba(71, 85, 105, 0.5));
    color: var(--text-secondary, #cbd5e1);
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
}

.cookie-btn-reject:hover {
    background: var(--bg-hover, rgba(71, 85, 105, 0.8));
    color: var(--text-primary, #f1f5f9);
    transform: translateY(-2px);
}

.cookie-btn-customize {
    background: transparent;
    color: var(--primary-color, #818cf8);
    border: 1px solid rgba(var(--color-accent-rgb, 129, 140, 248), 0.3);
}

.cookie-btn-customize:hover {
    background: rgba(var(--color-accent-rgb, 129, 140, 248), 0.1);
    border-color: rgba(var(--color-accent-rgb, 129, 140, 248), 0.5);
    transform: translateY(-2px);
}

.cookie-btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.cookie-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(16, 185, 129, 0.6);
}

/* Cookie Details Panel */
.cookie-details {
    border-top: 1px solid var(--border-color, rgba(99, 102, 241, 0.15));
    padding: 20px 24px;
    background: var(--bg-tertiary, rgba(15, 23, 42, 0.5));
    animation: cookieExpand 0.3s ease;
}

@keyframes cookieExpand {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.cookie-category {
    background: var(--bg-secondary, rgba(30, 41, 59, 0.6));
    border: 1px solid var(--border-color, rgba(99, 102, 241, 0.1));
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color 0.2s;
}

.cookie-category:hover {
    border-color: rgba(var(--color-accent-rgb, 99, 102, 241), 0.3);
}

.cookie-cat-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cookie-cat-info {
    flex: 1;
    min-width: 0;
}

.cookie-cat-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary, #e2e8f0);
    margin-bottom: 2px;
}

.cookie-cat-info small {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
}

.cookie-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cookie-badge-required {
    background: rgba(var(--color-accent-rgb, 99, 102, 241), 0.15);
    color: var(--primary-color, #818cf8);
    border: 1px solid rgba(var(--color-accent-rgb, 99, 102, 241), 0.3);
}

/* Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary, #334155);
    border-radius: 24px;
    transition: all 0.3s;
}

.cookie-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-switch input:checked + .cookie-slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.cookie-switch input:checked + .cookie-slider:before {
    transform: translateX(20px);
}

.cookie-slider-locked {
    opacity: 0.7;
    cursor: not-allowed;
}

.cookie-switch input:checked + .cookie-slider-locked {
    background: linear-gradient(135deg, #667eea, #764ba2);
    opacity: 0.7;
}

/* Cookie Settings Float Button */
.cookie-settings-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary, rgba(15, 23, 42, 0.9));
    backdrop-filter: blur(10px);
    color: var(--primary-color, #818cf8);
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg, 0 4px 15px rgba(0, 0, 0, 0.3));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-settings-float:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 25px rgba(var(--color-accent-rgb, 102, 126, 234), 0.4);
    color: var(--primary-hover, #a5b4fc);
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-main {
        flex-direction: column;
        text-align: center;
        padding: 16px;
        gap: 16px;
    }

    .cookie-actions {
        flex-direction: column;
        width: 100%;
    }

    .cookie-btn {
        justify-content: center;
        width: 100%;
    }

    .cookie-details {
        padding: 16px;
    }

    .cookie-cat-header {
        flex-wrap: wrap;
    }

    .cookie-badge {
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    .cookie-consent {
        padding: 0 8px;
    }

    .cookie-banner {
        border-radius: 12px;
        margin-bottom: 8px;
    }

    .cookie-title {
        font-size: 0.9rem;
    }

    .cookie-text {
        font-size: 0.8rem;
    }
}

/* Light theme override */
[data-theme="light"] .cookie-banner {
    background: rgba(255, 255, 255, 0.97);
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .cookie-title {
    color: #1e293b;
}
[data-theme="light"] .cookie-text {
    color: #475569;
}
[data-theme="light"] .cookie-link {
    color: #4f46e5;
}
[data-theme="light"] .cookie-link:hover {
    color: #3730a3;
}
[data-theme="light"] .cookie-btn-reject {
    background: rgba(226, 232, 240, 0.8);
    color: #334155;
    border-color: rgba(148, 163, 184, 0.3);
}
[data-theme="light"] .cookie-btn-reject:hover {
    background: rgba(203, 213, 225, 0.9);
    color: #1e293b;
}
[data-theme="light"] .cookie-btn-customize {
    color: #4f46e5;
    border-color: rgba(79, 70, 229, 0.3);
}
[data-theme="light"] .cookie-btn-customize:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.5);
}
[data-theme="light"] .cookie-details {
    background: rgba(248, 250, 252, 0.8);
    border-top-color: rgba(99, 102, 241, 0.1);
}
[data-theme="light"] .cookie-category {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(203, 213, 225, 0.5);
}
[data-theme="light"] .cookie-category:hover {
    border-color: rgba(99, 102, 241, 0.3);
}
[data-theme="light"] .cookie-cat-info strong {
    color: #1e293b;
}
[data-theme="light"] .cookie-cat-info small {
    color: #64748b;
}
[data-theme="light"] .cookie-slider {
    background: #cbd5e1;
}
[data-theme="light"] .cookie-settings-float {
    background: rgba(255, 255, 255, 0.95);
    color: #4f46e5;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(99, 102, 241, 0.15);
}
[data-theme="light"] .cookie-settings-float:hover {
    box-shadow: 0 6px 25px rgba(79, 70, 229, 0.2), 0 0 0 1px rgba(99, 102, 241, 0.3);
    color: #3730a3;
}

[data-theme="light"] .cookie-text {
    color: #64748b;
}

[data-theme="light"] .cookie-category {
    background: rgba(241, 245, 249, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .cookie-cat-info strong {
    color: #1e293b;
}

[data-theme="light"] .cookie-cat-info small {
    color: #64748b;
}

[data-theme="light"] .cookie-details {
    background: rgba(248, 250, 252, 0.8);
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .cookie-btn-reject {
    background: rgba(226, 232, 240, 0.8);
    color: #475569;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .cookie-slider {
    background: #cbd5e1;
}

[data-theme="light"] .cookie-settings-float {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(99, 102, 241, 0.15);
}

@keyframes cookieSlideOut {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}
