/* ========================================
   HEATDRIVE BIO - ANIMATED BACKGROUND
   Inspired by fire + plasma energy aesthetic
   ======================================== */

/* Animated Background Container */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #0a0a0a 100%);
}

/* Fire Gradient (Left Side) */
.fire-gradient {
    position: absolute;
    left: -20%;
    top: 0;
    width: 70%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(255, 68, 0, 0.3) 0%,
        rgba(255, 136, 0, 0.2) 25%,
        rgba(255, 68, 0, 0.1) 50%,
        transparent 70%
    );
    animation: fireMove 20s ease-in-out infinite;
    filter: blur(80px);
}

/* Plasma Gradient (Right Side) */
.plasma-gradient {
    position: absolute;
    right: -20%;
    top: 0;
    width: 70%;
    height: 100%;
    background: radial-gradient(ellipse at center,
        rgba(0, 150, 255, 0.3) 0%,
        rgba(0, 200, 255, 0.2) 25%,
        rgba(100, 150, 255, 0.1) 50%,
        transparent 70%
    );
    animation: plasmaMove 18s ease-in-out infinite reverse;
    filter: blur(80px);
}

/* Animated Logo Container */
.logo-background {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    opacity: 0.08;
    animation: logoFloat 8s ease-in-out infinite, logoRotate 60s linear infinite;
    pointer-events: none;
}

.logo-background img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 40px rgba(255, 68, 0, 0.5)) drop-shadow(0 0 80px rgba(0, 150, 255, 0.5));
    animation: logoGlow 3s ease-in-out infinite;
}

/* Particle System */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
}

/* Fire particles (orange/red) */
.particle.fire {
    background: radial-gradient(circle, rgba(255, 136, 0, 0.8), transparent);
    box-shadow: 0 0 10px rgba(255, 68, 0, 0.5);
}

/* Plasma particles (blue) */
.particle.plasma {
    background: radial-gradient(circle, rgba(0, 200, 255, 0.8), transparent);
    box-shadow: 0 0 10px rgba(0, 150, 255, 0.5);
}

/* Energy Lines */
.energy-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 136, 0, 0.5), transparent);
    animation: energyFlow 8s linear infinite;
    opacity: 0.3;
}

.energy-line.plasma-line {
    background: linear-gradient(90deg, transparent, rgba(0, 150, 255, 0.5), transparent);
}

/* Lightning Strikes (Occasional) */
.lightning {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(0, 200, 255, 0.8) 10%, 
        rgba(0, 200, 255, 0) 90%,
        transparent 100%
    );
    animation: lightningStrike 4s ease-in-out infinite;
    opacity: 0;
}

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

@keyframes fireMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -50px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 30px) scale(0.9);
    }
    75% {
        transform: translate(40px, 20px) scale(1.05);
    }
}

@keyframes plasmaMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-40px, 40px) scale(1.1);
    }
    66% {
        transform: translate(20px, -30px) scale(0.95);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-20px) scale(1.05);
    }
}

@keyframes logoRotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 68, 0, 0.3)) 
                drop-shadow(0 0 40px rgba(0, 150, 255, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(255, 68, 0, 0.6)) 
                drop-shadow(0 0 80px rgba(0, 150, 255, 0.6));
    }
}

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

@keyframes energyFlow {
    0% {
        left: -100%;
        width: 0%;
    }
    50% {
        width: 100%;
    }
    100% {
        left: 100%;
        width: 0%;
    }
}

@keyframes lightningStrike {
    0%, 90%, 100% {
        opacity: 0;
    }
    91%, 93%, 95% {
        opacity: 1;
    }
    92%, 94% {
        opacity: 0.3;
    }
}

/* ========================================
   RESPONSIVE & PERFORMANCE
   ======================================== */

/* Reduce animations on mobile for performance */
@media (max-width: 768px) {
    .fire-gradient,
    .plasma-gradient {
        filter: blur(40px);
        animation-duration: 30s;
    }
    
    .logo-background {
        width: 400px;
        height: 400px;
        opacity: 0.05;
        animation: logoFloat 12s ease-in-out infinite;
    }
    
    /* Disable rotate on mobile */
    @keyframes logoRotate {
        from, to {
            transform: translate(-50%, -50%) rotate(0deg);
        }
    }
    
    /* Reduce particle count on mobile (handled in JS) */
    .particle {
        width: 2px;
        height: 2px;
    }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fire-gradient,
    .plasma-gradient,
    .logo-background,
    .particle,
    .energy-line,
    .lightning {
        animation: none;
    }
    
    .logo-background {
        opacity: 0.05;
    }
}

/* ========================================
   CONTENT OVERLAY (Ensure readability)
   ======================================== */

/* Add semi-transparent overlay for content sections */
.content-section {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
}

.content-section.dark {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
}

/* Header transparency */
header {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.hide-background {
    display: none;
}

.pause-animation {
    animation-play-state: paused !important;
}

.pause-animation * {
    animation-play-state: paused !important;
}
