/* frontend/css/glassmorphism.css */

:root {
    --glass-bg-light: rgba(255, 255, 255, 0.08);
    --glass-bg-medium: rgba(255, 255, 255, 0.12);
    --glass-bg-heavy: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    --glass-backdrop: blur(16px);
    --glass-glow-primary: rgba(102, 126, 234, 0.6);
    --glass-glow-secondary: rgba(236, 72, 153, 0.6);
    --glass-glow-accent: rgba(245, 158, 11, 0.6);
}

/* Main glass card with advanced colorful border */
.glass-card {
    background: var(--glass-bg-medium);
    backdrop-filter: var(--glass-backdrop) saturate(180%);
    -webkit-backdrop-filter: var(--glass-backdrop) saturate(180%);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    box-shadow:
        var(--glass-shadow),
        inset 1px 1px 0 rgba(255, 255, 255, 0.1),
        inset -1px -1px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Enhanced animated gradient border with glow */
.glass-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(45deg,
            var(--glass-glow-primary),
            var(--glass-glow-secondary),
            var(--glass-glow-accent),
            var(--glass-glow-primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.4;
    transition: opacity 0.4s ease;
    animation: gradientRotate 8s linear infinite;
    background-size: 300% 300%;
}

/* Inner glow effect */
.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(ellipse at top right,
            rgba(102, 126, 234, 0.1),
            transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.glass-card:hover::before {
    opacity: 0.8;
    animation: gradientRotate 4s linear infinite;
}

.glass-card:hover::after {
    opacity: 1;
}

@keyframes gradientRotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Advanced card hover with multi-layer effects */
.glass-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow:
        0 20px 60px 0 rgba(31, 38, 135, 0.4),
        0 0 30px rgba(102, 126, 234, 0.3),
        inset 1px 1px 0 rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(102, 126, 234, 0.5);
}

/* Glass navigation with advanced neon effect */
.glass-nav {
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.12),
            rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 24px 0 rgba(59, 130, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.glass-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(102, 126, 234, 0.5),
            transparent);
}

/* Advanced vibrant glass buttons */
.glass-btn {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.15),
            rgba(255, 255, 255, 0.08));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 1px 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    transition: left 0.5s ease;
}

.glass-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 0%,
            rgba(102, 126, 234, 0.2),
            transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.glass-btn:hover::before {
    left: 100%;
}

.glass-btn:hover::after {
    opacity: 1;
}

.glass-btn:hover {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.25),
            rgba(255, 255, 255, 0.15));
    transform: translateY(-3px);
    box-shadow:
        0 12px 32px rgba(59, 130, 246, 0.3),
        0 0 20px rgba(102, 126, 234, 0.2),
        inset 1px 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Premium primary button with vibrant gradient and glow */
.glass-btn-primary {
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.95),
            rgba(102, 126, 234, 0.9),
            rgba(236, 72, 153, 0.95),
            rgba(245, 158, 11, 0.9));
    background-size: 300% 300%;
    animation: gradientShift 5s ease infinite;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 8px 32px rgba(59, 130, 246, 0.5),
        0 0 20px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    color: white;
    font-weight: 700;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    letter-spacing: 0.5px;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.glass-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.2),
            transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glass-btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.4) 0%,
            transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.glass-btn-primary:hover::before {
    opacity: 1;
}

.glass-btn-primary:hover::after {
    opacity: 1;
}

.glass-btn-primary:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow:
        0 16px 48px rgba(236, 72, 153, 0.6),
        0 0 40px rgba(102, 126, 234, 0.5),
        0 0 20px rgba(245, 158, 11, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
}

.glass-btn-primary:active {
    transform: translateY(-2px) scale(1.05);
}

/* Frosted glass with premium rainbow effect */
.frosted-glass {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.14),
            rgba(255, 255, 255, 0.09));
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 8px 32px 0 rgba(31, 38, 135, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset -1px -1px 0 rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.4s ease;
}

.frosted-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(45deg,
            rgba(59, 130, 246, 0.4),
            rgba(102, 126, 234, 0.3),
            rgba(236, 72, 153, 0.4),
            rgba(245, 158, 11, 0.3),
            rgba(16, 185, 129, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.frosted-glass:hover {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow:
        0 12px 48px 0 rgba(31, 38, 135, 0.35),
        0 0 30px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.frosted-glass:hover::after {
    opacity: 0.8;
}

/* Premium light glass for subtle elements */
.light-glass {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08),
            rgba(255, 255, 255, 0.04));
    backdrop-filter: blur(10px) saturate(150%);
    -webkit-backdrop-filter: blur(10px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.light-glass::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top left,
            rgba(102, 126, 234, 0.1),
            transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.light-glass:hover {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.12),
            rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.light-glass:hover::before {
    opacity: 1;
}

/* Premium neon glow effect */
.neon-glow {
    box-shadow:
        0 0 10px rgba(59, 130, 246, 0.4),
        0 0 20px rgba(102, 126, 234, 0.3),
        0 0 30px rgba(102, 126, 234, 0.2),
        0 0 40px rgba(236, 72, 153, 0.2),
        0 0 60px rgba(245, 158, 11, 0.1);
    position: relative;
}

.neon-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(45deg,
            rgba(59, 130, 246, 0.2),
            transparent 40%,
            transparent 60%,
            rgba(236, 72, 153, 0.2));
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.neon-glow:hover::before {
    opacity: 1;
}

/* Premium rainbow shimmer effect */
@keyframes rainbowShimmer {
    0% {
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }

    50% {
        background-position: 100% 50%;
        filter: hue-rotate(180deg);
    }

    100% {
        background-position: 0% 50%;
        filter: hue-rotate(360deg);
    }
}

.rainbow-shimmer {
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.4),
            rgba(102, 126, 234, 0.3),
            rgba(236, 72, 153, 0.4),
            rgba(245, 158, 11, 0.3),
            rgba(16, 185, 129, 0.3),
            rgba(139, 92, 246, 0.3));
    background-size: 400% 400%;
    animation: rainbowShimmer 10s ease infinite;
    position: relative;
}

/* Premium card variants */
.glass-card-premium {
    background: var(--glass-bg-heavy);
    backdrop-filter: var(--glass-backdrop) saturate(200%);
    -webkit-backdrop-filter: var(--glass-backdrop) saturate(200%);
    border-radius: 24px;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
    box-shadow:
        0 12px 40px 0 rgba(31, 38, 135, 0.3),
        0 0 30px rgba(102, 126, 234, 0.2),
        inset 1px 1px 0 rgba(255, 255, 255, 0.2),
        inset -1px -1px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.glass-card-premium::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 24px;
    padding: 2px;
    background: linear-gradient(45deg,
            var(--glass-glow-primary),
            var(--glass-glow-secondary),
            var(--glass-glow-accent),
            var(--glass-glow-secondary),
            var(--glass-glow-primary));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.6;
    animation: gradientRotate 6s linear infinite;
    background-size: 300% 300%;
}

.glass-card-premium:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow:
        0 24px 60px 0 rgba(31, 38, 135, 0.5),
        0 0 50px rgba(102, 126, 234, 0.4),
        inset 1px 1px 0 rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(102, 126, 234, 0.6);
}

.glass-card-premium:hover::before {
    opacity: 1;
    animation: gradientRotate 3s linear infinite;
}

/* Subtle glass accent */
.glass-accent {
    border-left: 4px solid transparent;
    border-image: linear-gradient(180deg,
            var(--glass-glow-primary),
            var(--glass-glow-secondary),
            var(--glass-glow-accent)) 1;
    transition: all 0.3s ease;
}

.glass-accent:hover {
    border-left-color: var(--glass-glow-primary);
    padding-left: 16px;
    box-shadow: -8px 0 24px rgba(102, 126, 234, 0.2);
}

/* Enhanced responsive adjustments */
@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg-light: rgba(0, 0, 0, 0.15);
        --glass-bg-medium: rgba(0, 0, 0, 0.25);
        --glass-bg-heavy: rgba(0, 0, 0, 0.35);
        --glass-border: rgba(255, 255, 255, 0.15);
    }

    .glass-card {
        background: var(--glass-bg-medium);
        box-shadow:
            0 8px 32px 0 rgba(0, 0, 0, 0.4),
            inset 1px 1px 0 rgba(255, 255, 255, 0.08);
    }
}

/* Premium mobile optimizations */
@media (max-width: 768px) {
    .glass-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .glass-card::before {
        animation: gradientRotate 10s linear infinite;
    }

    .glass-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .glass-btn-primary {
        padding: 0.9rem 1.5rem;
        font-size: 1rem;
        border-radius: 10px;
    }

    .glass-card-premium {
        border-radius: 20px;
        padding: 1.25rem;
    }

    .neon-glow {
        box-shadow:
            0 0 8px rgba(59, 130, 246, 0.3),
            0 0 16px rgba(102, 126, 234, 0.2);
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {

    .glass-card,
    .glass-btn,
    .glass-btn-primary,
    .glass-card-premium,
    .rainbow-shimmer {
        animation: none !important;
        transition: none !important;
    }

    .glass-btn::before,
    .glass-btn-primary::before {
        transition: none !important;
    }
}