/* ============================================
   EFFECTS.CSS - Animations & Visual Effects
   AlgoForge Production Build - Emerald Green Theme
============================================ */

/* ============================================
   MARQUEE
============================================ */
.marquee-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: calc(var(--z-fixed) + 1);
    transition: transform var(--transition-base);
}

.marquee-wrapper.hidden {
    transform: translateY(-100%);
}

.marquee-container {
    background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 50%, var(--accent) 100%);
    background-size: 200% 100%;
    animation: gradientFlow 4s ease infinite;
    padding: 12px 0;
    overflow: hidden;
}

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

.marquee-content {
    display: flex;
    animation: marquee 25s linear infinite;
    white-space: nowrap;
}

.marquee-content:hover {
    animation-play-state: paused;
}

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

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.marquee-item svg {
    width: 18px;
    height: 18px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .marquee-content {
        animation: none;
    }
    
    .marquee-container {
        animation: none;
    }
}

/* ============================================
   PARALLAX BACKGROUND SYSTEM
============================================ */
.parallax-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    perspective: 1000px;
    transform-style: preserve-3d;
    pointer-events: none;
}

.parallax-layer {
    position: absolute;
    inset: -100px;
    will-change: transform;
}

.parallax-deep {
    transform: translateZ(-300px) scale(1.3);
}

.parallax-mid {
    transform: translateZ(-150px) scale(1.15);
}

.parallax-front {
    transform: translateZ(-50px) scale(1.05);
}

/* Disable parallax on mobile */
@media (max-width: 768px), (prefers-reduced-motion: reduce) {
    .parallax-container {
        perspective: none;
    }
    
    .parallax-layer {
        transform: none !important;
    }
}

/* ============================================
   FLOATING ORBS - Green Theme
============================================ */
.depth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbDrift 25s ease-in-out infinite;
    will-change: transform;
}

.depth-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    top: 5%;
    left: 5%;
}

.depth-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.12) 0%, transparent 70%);
    top: 40%;
    right: 10%;
    animation-delay: -8s;
}

.depth-orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    bottom: 10%;
    left: 20%;
    animation-delay: -16s;
}

.depth-orb-4 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    top: 60%;
    right: 30%;
    animation-delay: -12s;
}

@keyframes orbDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.05); }
    50% { transform: translate(-20px, 30px) scale(0.95); }
    75% { transform: translate(-30px, -15px) scale(1.02); }
}

/* Reduce orb effects on mobile */
@media (max-width: 768px) {
    .depth-orb {
        filter: blur(60px);
        opacity: 0.5;
    }
    
    .depth-orb-1 { width: 300px; height: 300px; }
    .depth-orb-2 { width: 250px; height: 250px; }
    .depth-orb-3 { width: 200px; height: 200px; }
    .depth-orb-4 { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .depth-orb {
        animation: none;
    }
}

/* ============================================
   ANIMATED GRID - Green Tint
============================================ */
.grid-bg {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(16, 185, 129, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
    background-size: 80px 80px;
    animation: gridScroll 30s linear infinite;
}

@keyframes gridScroll {
    0% { transform: translate(0, 0); }
    100% { transform: translate(80px, 80px); }
}

@media (prefers-reduced-motion: reduce) {
    .grid-bg {
        animation: none;
    }
}

/* ============================================
   CANDLESTICK RAIN
============================================ */
.candle-rain {
    position: absolute;
    inset: 0;
}

.falling-candle {
    position: absolute;
    width: 8px;
    opacity: 0.15;
    animation: candleFall linear infinite;
}

.falling-candle .wick {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: currentColor;
}

.falling-candle .body {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    top: 25%;
    background: currentColor;
    border-radius: 1px;
}

.falling-candle:nth-child(odd) { color: var(--green); }
.falling-candle:nth-child(even) { color: var(--red); }

.falling-candle:nth-child(1) { left: 5%; height: 40px; animation-duration: 15s; animation-delay: 0s; }
.falling-candle:nth-child(2) { left: 12%; height: 30px; animation-duration: 18s; animation-delay: -3s; }
.falling-candle:nth-child(3) { left: 20%; height: 50px; animation-duration: 20s; animation-delay: -6s; }
.falling-candle:nth-child(4) { left: 28%; height: 35px; animation-duration: 16s; animation-delay: -2s; }
.falling-candle:nth-child(5) { left: 35%; height: 45px; animation-duration: 22s; animation-delay: -8s; }
.falling-candle:nth-child(6) { left: 42%; height: 38px; animation-duration: 19s; animation-delay: -11s; }
.falling-candle:nth-child(7) { left: 50%; height: 42px; animation-duration: 17s; animation-delay: -4s; }
.falling-candle:nth-child(8) { left: 58%; height: 32px; animation-duration: 21s; animation-delay: -9s; }
.falling-candle:nth-child(9) { left: 65%; height: 48px; animation-duration: 14s; animation-delay: -5s; }
.falling-candle:nth-child(10) { left: 72%; height: 36px; animation-duration: 23s; animation-delay: -7s; }
.falling-candle:nth-child(11) { left: 80%; height: 44px; animation-duration: 16s; animation-delay: -1s; }
.falling-candle:nth-child(12) { left: 88%; height: 38px; animation-duration: 20s; animation-delay: -10s; }
.falling-candle:nth-child(13) { left: 95%; height: 52px; animation-duration: 18s; animation-delay: -13s; }

@keyframes candleFall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 0; }
    10% { opacity: 0.15; }
    90% { opacity: 0.15; }
    100% { transform: translateY(calc(100vh + 100px)) rotate(5deg); opacity: 0; }
}

/* Reduce candles on mobile */
@media (max-width: 768px) {
    .falling-candle:nth-child(n+7) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .falling-candle {
        animation: none;
        opacity: 0.1;
    }
}

/* ============================================
   PARTICLE FIELD - More Particles
============================================ */
.particle-field {
    position: absolute;
    inset: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

.particle.dot {
    width: 2px;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.particle.glow {
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
}

.particle.large {
    width: 3px;
    height: 3px;
    background: var(--teal);
    box-shadow: 0 0 8px var(--teal);
}

/* 18 particles for more density */
.particle:nth-child(1) { left: 3%; animation-duration: 18s; }
.particle:nth-child(2) { left: 9%; animation-duration: 22s; animation-delay: -4s; }
.particle:nth-child(3) { left: 15%; animation-duration: 16s; animation-delay: -8s; }
.particle:nth-child(4) { left: 21%; animation-duration: 24s; animation-delay: -2s; }
.particle:nth-child(5) { left: 27%; animation-duration: 20s; animation-delay: -12s; }
.particle:nth-child(6) { left: 33%; animation-duration: 19s; animation-delay: -6s; }
.particle:nth-child(7) { left: 40%; animation-duration: 23s; animation-delay: -15s; }
.particle:nth-child(8) { left: 47%; animation-duration: 17s; animation-delay: -3s; }
.particle:nth-child(9) { left: 53%; animation-duration: 21s; animation-delay: -9s; }
.particle:nth-child(10) { left: 60%; animation-duration: 18s; animation-delay: -1s; }
.particle:nth-child(11) { left: 67%; animation-duration: 25s; animation-delay: -11s; }
.particle:nth-child(12) { left: 73%; animation-duration: 16s; animation-delay: -7s; }
.particle:nth-child(13) { left: 79%; animation-duration: 22s; animation-delay: -14s; }
.particle:nth-child(14) { left: 85%; animation-duration: 19s; animation-delay: -5s; }
.particle:nth-child(15) { left: 91%; animation-duration: 24s; animation-delay: -10s; }
.particle:nth-child(16) { left: 97%; animation-duration: 17s; animation-delay: -13s; }
.particle:nth-child(17) { left: 6%; animation-duration: 26s; animation-delay: -16s; }
.particle:nth-child(18) { left: 94%; animation-duration: 20s; animation-delay: -18s; }

@keyframes particleFloat {
    0% { bottom: -20px; opacity: 0; transform: translateX(0); }
    10% { opacity: 0.7; }
    50% { transform: translateX(40px); }
    90% { opacity: 0.7; }
    100% { bottom: calc(100% + 20px); opacity: 0; transform: translateX(-40px); }
}

/* Reduce particles on mobile */
@media (max-width: 768px) {
    .particle:nth-child(n+10) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .particle {
        animation: none;
        opacity: 0.3;
        bottom: 50%;
    }
}

/* ============================================
   SCAN LINES - Green
============================================ */
.scan-lines {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
    animation: scanMove 8s ease-in-out infinite;
    opacity: 0.4;
}

.scan-line:nth-child(1) { animation-delay: 0s; }
.scan-line:nth-child(2) { animation-delay: -2.5s; }
.scan-line:nth-child(3) { animation-delay: -5s; }
.scan-line:nth-child(4) { animation-delay: -1.5s; }

@keyframes scanMove {
    0%, 100% { top: -1px; opacity: 0; }
    5% { opacity: 0.4; }
    95% { opacity: 0.4; }
    100% { top: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .scan-line {
        animation: none;
        display: none;
    }
}

/* ============================================
   HERO SECTION
============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 160px;
    padding-bottom: 80px;
}

.hero-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Hero Label with Shimmer Effect */
.hero-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-light);
    background: rgba(16, 185, 129, 0.1);
    padding: 10px 20px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(16, 185, 129, 0.25);
    margin-bottom: 28px;
    animation: fadeInUp 0.6s ease forwards;
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: all var(--transition-base);
}

/* Shimmer effect on hover */
.hero-label::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: none;
}

.hero-label:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 30px var(--accent-glow);
}

.hero-label:hover::before {
    animation: shimmer 0.8s ease forwards;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.hero-title {
    margin-bottom: 28px;
    animation: fadeInUp 0.6s ease 0.1s forwards;
    opacity: 0;
}

.hero-subtitle {
    font-size: clamp(1.0625rem, 2.5vw, 1.25rem);
    max-width: 600px;
    margin: 0 auto 44px;
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.3s forwards;
    opacity: 0;
}

.hero-note {
    margin-top: 28px;
    font-size: 0.875rem;
    color: var(--text-muted);
    animation: fadeInUp 0.6s ease 0.4s forwards;
    opacity: 0;
}

.hero-socials {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    animation: fadeInUp 0.6s ease 0.5s forwards;
    opacity: 0;
}

/* Social Icons */
.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-bounce);
}

.social-icon svg {
    width: 24px;
    height: 24px;
    transition: transform var(--transition-base);
}

.social-icon:hover,
.social-icon:focus {
    transform: translateY(-6px) scale(1.1);
    color: white;
}

.social-icon:hover svg,
.social-icon:focus svg {
    transform: scale(1.15);
}

.social-icon.whatsapp:hover,
.social-icon.whatsapp:focus {
    background: #25D366;
    border-color: #25D366;
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.4);
}

.social-icon.facebook:hover,
.social-icon.facebook:focus {
    background: #1877F2;
    border-color: #1877F2;
    box-shadow: 0 15px 40px rgba(24, 119, 242, 0.4);
}

.social-icon.instagram:hover,
.social-icon.instagram:focus {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-color: #dc2743;
    box-shadow: 0 15px 40px rgba(220, 39, 67, 0.4);
}

/* ============================================
   SCROLL ANIMATIONS
============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
.animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .hero-label:hover::before {
        animation: none;
    }
}

/* ============================================
   CTA SECTION
============================================ */
.cta {
    position: relative;
}

.cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.cta-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    margin-bottom: var(--space-md);
}

.cta-subtitle {
    font-size: 1.0625rem;
    margin-bottom: 36px;
}

/* ============================================
   SECTION DIVIDERS
============================================ */
.benefits::before,
.features::before,
.pricing::before,
.faq::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ============================================
   RESPONSIVE HERO
============================================ */
@media (max-width: 768px) {
    .hero {
        padding-top: 140px;
        padding-bottom: 60px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
}
