/* Modern Cookie Consent Banner - Cutting-Edge Web Technologies */
/* CSP Compliant - No inline styles */
/* Uses: CSS @property, @starting-style, backdrop-filter, CSS animations */

/* =================================================================
   CSS @property - Animated Custom Properties (Houdini)
   ================================================================= */

@property --gradient-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@property --glow-intensity {
    syntax: '<number>';
    initial-value: 0;
    inherits: false;
}

@property --particle-rotation {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* =================================================================
   Full-Page Overlay with Modern Backdrop
   ================================================================= */

.cookie-consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(0, 207, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 0, 255, 0.15) 0%, transparent 50%),
        rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    z-index: 999998;
    display: none;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-consent-overlay.active {
    display: block;
    opacity: 1;
}

/* Entry animation using @starting-style (2024 feature) */
@starting-style {
    .cookie-consent-overlay.active {
        opacity: 0;
        backdrop-filter: blur(0px) saturate(100%);
    }
}

/* =================================================================
   Main Banner - Advanced Glass Morphism
   ================================================================= */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background:
        linear-gradient(
            var(--gradient-angle),
            rgba(0, 20, 40, 0.95) 0%,
            rgba(0, 40, 80, 0.95) 50%,
            rgba(0, 20, 40, 0.95) 100%
        );
    backdrop-filter: blur(24px) saturate(180%) brightness(110%);
    -webkit-backdrop-filter: blur(24px) saturate(180%) brightness(110%);
    border-top: 2px solid transparent;
    border-image: linear-gradient(
        90deg,
        rgba(0, 207, 255, 0.3),
        rgba(139, 0, 255, 0.3),
        rgba(0, 207, 255, 0.3)
    ) 1;
    box-shadow:
        0 -8px 40px rgba(0, 0, 0, 0.4),
        0 -4px 20px rgba(0, 207, 255, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    padding: 2rem 2rem 2.5rem 2rem;
    z-index: 999999;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: none;
    --gradient-angle: 45deg;
    animation: rotateGradient 8s linear infinite;
}

.cookie-consent-banner.active {
    display: block !important;
    transform: translateY(0);
}

/* Entry animation using @starting-style */
@starting-style {
    .cookie-consent-banner.active {
        transform: translateY(100%) scale(0.9);
        opacity: 0;
    }
}

/* Animated gradient rotation */
@keyframes rotateGradient {
    0% { --gradient-angle: 45deg; }
    100% { --gradient-angle: 405deg; }
}

/* Animated border glow */
.cookie-consent-banner::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 207, 255, var(--glow-intensity, 0.5)),
        rgba(139, 0, 255, var(--glow-intensity, 0.5)),
        rgba(0, 207, 255, var(--glow-intensity, 0.5)),
        transparent
    );
    background-size: 200% 100%;
    animation: borderFlow 3s linear infinite;
}

@keyframes borderFlow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* Legal pages have purple accent */
body[data-legal-page] .cookie-consent-banner {
    background:
        linear-gradient(
            135deg,
            rgba(40, 0, 60, 0.95) 0%,
            rgba(80, 0, 120, 0.95) 50%,
            rgba(40, 0, 60, 0.95) 100%
        );
}

/* =================================================================
   Container Layout with Modern Flexbox
   ================================================================= */

.cookie-consent-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}

/* =================================================================
   Content Section with Animated Text
   ================================================================= */

.cookie-consent-content {
    flex: 1;
    min-width: 300px;
}

.cookie-consent-title {
    color: #00CFFF;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-shadow: 0 0 20px rgba(0, 207, 255, 0.5);
}

.cookie-consent-icon {
    font-size: 2rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(0, 207, 255, 0.6));
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

.cookie-consent-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.cookie-consent-link {
    color: #00CFFF;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 600;
    position: relative;
}

.cookie-consent-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00CFFF, #8B00FF);
    transition: width 0.3s ease;
}

.cookie-consent-link:hover::after {
    width: 100%;
}

.cookie-consent-link:hover {
    color: #8B00FF;
}

/* =================================================================
   Action Buttons with Advanced Effects
   ================================================================= */

.cookie-consent-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-consent-button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 180px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cookie-consent-button .button-main {
    font-weight: 700;
    font-size: 0.95rem;
    z-index: 1;
}

.cookie-consent-button .button-benefit {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.9;
    text-transform: none;
    letter-spacing: 0;
    z-index: 1;
}

/* Animated background layer */
.cookie-consent-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.cookie-consent-button:hover::before {
    width: 400px;
    height: 400px;
}

/* Particle effect layer */
.cookie-consent-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(255, 255, 255, 0.2) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cookie-consent-button:hover::after {
    opacity: 1;
}

/* =================================================================
   Accept Button - Cyan Gradient
   ================================================================= */

.cookie-consent-accept {
    background:
        linear-gradient(135deg,
            #00CFFF 0%,
            #00A8CC 50%,
            #0080FF 100%
        );
    color: #0a0a1a;
    box-shadow:
        0 8px 32px rgba(0, 207, 255, 0.4),
        0 4px 16px rgba(0, 207, 255, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-consent-accept .button-benefit {
    color: rgba(10, 10, 26, 0.85);
}

.cookie-consent-accept:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 16px 48px rgba(0, 207, 255, 0.6),
        0 8px 24px rgba(0, 207, 255, 0.4),
        inset 0 2px 2px rgba(255, 255, 255, 0.4);
    filter: brightness(110%);
}

.cookie-consent-accept:active {
    transform: translateY(-2px) scale(1.01);
}

/* Animated shimmer effect */
.cookie-consent-accept::before {
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-50%); }
    100% { transform: translateX(100%) translateY(-50%); }
}

/* =================================================================
   Decline Button - Subtle Glass
   ================================================================= */

.cookie-consent-decline {
    background: rgba(50, 50, 70, 0.3);
    color: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(179, 179, 179, 0.3);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.cookie-consent-decline .button-benefit {
    color: rgba(179, 179, 179, 0.8);
}

.cookie-consent-decline:hover {
    border-color: rgba(179, 179, 179, 0.6);
    background: rgba(70, 70, 90, 0.4);
    transform: translateY(-4px) scale(1.02);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.cookie-consent-decline:hover .button-benefit {
    color: rgba(255, 255, 255, 0.9);
}

.cookie-consent-decline:active {
    transform: translateY(-2px) scale(1.01);
}

/* =================================================================
   Responsive Design with Container Queries
   ================================================================= */

@media (max-width: 1024px) {
    .cookie-consent-container {
        gap: 2rem;
    }

    .cookie-consent-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 1.5rem 1rem 2rem 1rem;
    }

    .cookie-consent-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .cookie-consent-content {
        min-width: 100%;
    }

    .cookie-consent-title {
        font-size: 1.2rem;
    }

    .cookie-consent-text {
        font-size: 0.95rem;
    }

    .cookie-consent-actions {
        width: 100%;
        justify-content: center;
    }

    .cookie-consent-button {
        flex: 1;
        min-width: 140px;
        padding: 0.85rem 1.5rem;
    }

    .cookie-consent-button .button-main {
        font-size: 0.85rem;
    }

    .cookie-consent-button .button-benefit {
        font-size: 0.7rem;
    }
}

/* =================================================================
   View Transitions API Support (Chrome 111+)
   ================================================================= */

@media (prefers-reduced-motion: no-preference) {
    .cookie-consent-banner {
        view-transition-name: cookie-banner;
    }
}

/* =================================================================
   Accessibility - Respects User Preferences
   ================================================================= */

@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-consent-overlay,
    .cookie-consent-button,
    .cookie-consent-icon {
        animation: none !important;
        transition: opacity 0.2s ease !important;
    }

    .cookie-consent-button::before,
    .cookie-consent-button::after {
        display: none !important;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: light) {
    .cookie-consent-banner {
        background:
            linear-gradient(
                135deg,
                rgba(240, 248, 255, 0.98) 0%,
                rgba(220, 238, 255, 0.98) 100%
            );
    }

    .cookie-consent-text {
        color: rgba(0, 0, 0, 0.85);
    }

    .cookie-consent-accept {
        color: #ffffff;
    }
}

/* =================================================================
   Performance Optimization
   ================================================================= */

.cookie-consent-banner,
.cookie-consent-overlay,
.cookie-consent-button {
    will-change: transform, opacity;
    contain: layout style paint;
}

/* GPU acceleration hints */
.cookie-consent-icon,
.cookie-consent-button::before,
.cookie-consent-button::after {
    transform: translateZ(0);
    backface-visibility: hidden;
}
