/* Cosmic Harvest Theme - Advanced Animations */

/* Advanced Particle Effects */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.cosmic-particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--quantum-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--quantum-cyan);
    animation: particle-float 10s linear infinite;
}

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

/* Comet Trail Effects */
.comet-trail {
    position: absolute;
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--quantum-cyan), transparent);
    animation: comet-fly 8s linear infinite;
    opacity: 0.6;
}

@keyframes comet-fly {
    0% {
        transform: translateX(-100vw) translateY(0) rotate(-45deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateX(100vw) translateY(-50px) rotate(-45deg);
        opacity: 0;
    }
}

/* Constellation Drawing Animation */
.constellation-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-accent), transparent);
    transform-origin: left center;
    animation: draw-line 3s ease-in-out infinite alternate;
}

@keyframes draw-line {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0.3;
    }
}

/* Holographic Data Cards */
.holographic-card {
    position: relative;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(255, 215, 0, 0.1) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
}

.holographic-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: holographic-shimmer 3s infinite;
}

@keyframes holographic-shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Quantum State Transitions */
.quantum-transition {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quantum-transition:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 212, 255, 0.3),
        0 0 60px rgba(255, 215, 0, 0.2);
}

/* Loading Animations */
.cosmic-loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top: 3px solid var(--quantum-cyan);
    border-right: 3px solid var(--gold-accent);
    border-radius: 50%;
    animation: cosmic-spin 2s linear infinite;
    z-index: 9999;
}

@keyframes cosmic-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Pulsing Effects */
.cosmic-pulse {
    animation: cosmic-pulse 2s ease-in-out infinite;
}

@keyframes cosmic-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Glitch Effects */
.glitch {
    position: relative;
    animation: glitch-main 5s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--cosmic-deep);
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--quantum-cyan);
    animation: glitch-1 0.5s infinite;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--cosmic-red);
    animation: glitch-2 0.5s infinite;
}

@keyframes glitch-main {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-1 {
    0%, 100% { clip-path: inset(0 0 0 0); }
    25% { clip-path: inset(20% 0 30% 0); }
    50% { clip-path: inset(50% 0 20% 0); }
    75% { clip-path: inset(10% 0 60% 0); }
}

@keyframes glitch-2 {
    0%, 100% { clip-path: inset(0 0 0 0); }
    25% { clip-path: inset(60% 0 10% 0); }
    50% { clip-path: inset(20% 0 50% 0); }
    75% { clip-path: inset(30% 0 20% 0); }
}

/* Warp Speed Effect */
.warp-speed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 1s ease;
}

.warp-speed.active {
    opacity: 1;
}

.warp-line {
    position: absolute;
    width: 1px;
    height: 100px;
    background: linear-gradient(180deg, transparent, var(--star-white), transparent);
    animation: warp-travel 1s linear infinite;
}

@keyframes warp-travel {
    0% {
        transform: translateY(-100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) scale(2);
        opacity: 0;
    }
}

/* Energy Field Effects */
.energy-field {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--quantum-cyan);
    animation: energy-expand 3s ease-out infinite;
}

@keyframes energy-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
        transform: translate(-50%, -50%);
    }
}

/* Data Stream Animation */
.data-stream {
    position: absolute;
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, transparent, var(--gold-accent), transparent);
    animation: data-flow 2s linear infinite;
}

@keyframes data-flow {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
        opacity: 0;
    }
}

/* Responsive Animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Performance Optimizations */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.will-change-transform {
    will-change: transform;
}

/* Mobile Animation Adjustments */
@media (max-width: 768px) {
    .cosmic-particle,
    .comet-trail,
    .warp-line {
        display: none;
    }
    
    .holographic-card::before {
        animation-duration: 4s;
    }
    
    .quantum-transition:hover {
        transform: translateY(-5px) scale(1.01);
    }
}