/* Special Effects and Particle Systems */

/* === ADVANCED BACKGROUND EFFECTS === */

/* Aurora Borealis Effect */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(ellipse at top, rgba(102, 126, 234, 0.3) 0%, transparent 70%),
        radial-gradient(ellipse at bottom, rgba(118, 75, 162, 0.3) 0%, transparent 70%);
    animation: auroraMove 20s ease-in-out infinite alternate;
}

@keyframes auroraMove {
    0% {
        transform: translateY(0%) scale(1);
        filter: hue-rotate(0deg);
    }
    100% {
        transform: translateY(-10%) scale(1.1);
        filter: hue-rotate(60deg);
    }
}

/* Constellation Effect */
.constellation-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 4s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.8;
    }
}

/* Meteor Shower Effect */
.meteor {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff;
    animation: meteor 3s linear infinite;
    z-index: 2;
}

.meteor::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, rgba(255,255,255,1), transparent);
    transform: translateY(-50px);
}

@keyframes meteor {
    0% {
        transform: translateX(-100px) translateY(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(100vw) translateY(100vh);
        opacity: 0;
    }
}

/* === INTERACTIVE PARTICLE SYSTEM === */

.particle-system {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: floatUp 3s linear infinite;
}

.particle:nth-child(odd) {
    background: rgba(102, 126, 234, 0.6);
    animation-duration: 4s;
}

.particle:nth-child(3n) {
    background: rgba(240, 147, 251, 0.6);
    animation-duration: 5s;
    width: 2px;
    height: 2px;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* === ADVANCED CARD EFFECTS === */

/* Holographic Card Effect */
.auth-card.holographic {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.auth-card.holographic::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        rgba(255, 255, 255, 0.1) 30deg,
        transparent 60deg,
        rgba(255, 255, 255, 0.1) 90deg,
        transparent 120deg
    );
    animation: holographicRotate 10s linear infinite;
    z-index: -1;
}

@keyframes holographicRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Glass Shatter Effect */
.glass-shatter {
    position: relative;
    overflow: hidden;
}

.glass-shatter::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 32%, rgba(255,255,255,0.1) 34%, transparent 36%),
        linear-gradient(-45deg, transparent 40%, rgba(255,255,255,0.05) 42%, rgba(255,255,255,0.05) 44%, transparent 46%);
    animation: glassEffect 8s ease-in-out infinite;
}

@keyframes glassEffect {
    0%, 100% {
        opacity: 0;
        transform: translateX(-100%);
    }
    50% {
        opacity: 1;
        transform: translateX(100%);
    }
}

/* === ADVANCED FORM EFFECTS === */

/* Neon Form Fields */
.form-control-modern.neon {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(102, 126, 234, 0.5);
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.form-control-modern.neon:focus {
    border-color: #667eea;
    box-shadow: 
        0 0 10px rgba(102, 126, 234, 0.5),
        0 0 20px rgba(102, 126, 234, 0.3),
        0 0 30px rgba(102, 126, 234, 0.1);
    animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    0% {
        box-shadow: 
            0 0 10px rgba(102, 126, 234, 0.5),
            0 0 20px rgba(102, 126, 234, 0.3),
            0 0 30px rgba(102, 126, 234, 0.1);
    }
    100% {
        box-shadow: 
            0 0 15px rgba(102, 126, 234, 0.7),
            0 0 25px rgba(102, 126, 234, 0.5),
            0 0 35px rgba(102, 126, 234, 0.3);
    }
}

/* Liquid Form Fields */
.form-control-modern.liquid {
    position: relative;
    overflow: hidden;
}

.form-control-modern.liquid::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 200% 100%;
    transform: translateX(-100%);
    animation: liquidFlow 3s ease-in-out infinite;
}

.form-control-modern.liquid:focus::before {
    transform: translateX(0);
    animation: liquidFlowFocus 2s ease-in-out infinite;
}

@keyframes liquidFlow {
    0%, 100% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(100%);
    }
}

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

/* === BUTTON SPECIAL EFFECTS === */

/* Plasma Button Effect */
.btn-modern.plasma {
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    background-size: 400% 400%;
    position: relative;
    overflow: hidden;
}

.btn-modern.plasma::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe);
    background-size: 400% 400%;
    border-radius: inherit;
    z-index: -1;
    animation: plasmaFlow 3s ease infinite;
}

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

.btn-modern.plasma:hover {
    animation: plasmaGlow 1s ease-in-out infinite alternate;
}

@keyframes plasmaGlow {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    100% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
}

/* === LOADING ANIMATIONS === */

/* DNA Loading Spinner */
.dna-spinner {
    position: relative;
    width: 40px;
    height: 40px;
}

.dna-spinner::before,
.dna-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: dnaRotate 1s linear infinite;
}

.dna-spinner::after {
    border-top-color: #f093fb;
    animation-direction: reverse;
    animation-duration: 0.8s;
}

@keyframes dnaRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* === NOTIFICATION EFFECTS === */

/* Success Ripple Effect */
.success-ripple {
    position: relative;
    overflow: hidden;
}

.success-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(46, 204, 113, 0.3);
    transform: translate(-50%, -50%);
    animation: successRipple 1s ease-out;
}

@keyframes successRipple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* Error Shake with Glow */
.error-shake {
    animation: errorShakeGlow 0.8s ease-in-out;
}

@keyframes errorShakeGlow {
    0%, 100% {
        transform: translateX(0);
        box-shadow: 0 0 0 rgba(231, 76, 60, 0);
    }
    10%, 90% {
        transform: translateX(-5px);
        box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    }
    20%, 80% {
        transform: translateX(5px);
        box-shadow: 0 0 20px rgba(231, 76, 60, 0.7);
    }
    30%, 50%, 70% {
        transform: translateX(-3px);
        box-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
    }
    40%, 60% {
        transform: translateX(3px);
        box-shadow: 0 0 25px rgba(231, 76, 60, 0.6);
    }
}

/* === MOBILE OPTIMIZATIONS === */

@media (max-width: 768px) {
    .aurora-bg,
    .constellation-bg::before,
    .meteor,
    .particle-system {
        display: none;
    }
    
    .auth-card.holographic::before {
        animation: none;
    }
    
    .form-control-modern.liquid::before {
        height: 2px;
    }
}

/* === ACCESSIBILITY === */

@media (prefers-reduced-motion: reduce) {
    .aurora-bg,
    .constellation-bg::before,
    .meteor,
    .particle,
    .auth-card.holographic::before,
    .glass-shatter::after,
    .form-control-modern.liquid::before,
    .btn-modern.plasma::before,
    .dna-spinner::before,
    .dna-spinner::after {
        animation: none !important;
    }
}

/* === PERFORMANCE OPTIMIZATIONS === */

.aurora-bg,
.constellation-bg::before,
.particle-system,
.auth-card.holographic,
.glass-shatter,
.form-control-modern.neon,
.form-control-modern.liquid,
.btn-modern.plasma {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* === THEME VARIATIONS === */

/* Dark Mode Special Effects */
@media (prefers-color-scheme: dark) {
    .aurora-bg {
        background: 
            radial-gradient(ellipse at top, rgba(79, 172, 254, 0.2) 0%, transparent 70%),
            radial-gradient(ellipse at bottom, rgba(168, 85, 247, 0.2) 0%, transparent 70%);
    }
    
    .particle {
        background: rgba(255, 255, 255, 0.4);
    }
    
    .particle:nth-child(odd) {
        background: rgba(79, 172, 254, 0.4);
    }
    
    .particle:nth-child(3n) {
        background: rgba(168, 85, 247, 0.4);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .aurora-bg,
    .constellation-bg::before,
    .particle-system,
    .auth-card.holographic::before,
    .glass-shatter::after {
        display: none;
    }
    
    .form-control-modern.neon,
    .form-control-modern.liquid,
    .btn-modern.plasma {
        background: #ffffff;
        border: 2px solid #000000;
        color: #000000;
    }
}