/* ====================================
   ANIMATIONS & EFFECTS
   Efeitos modernos e interativos
   ==================================== */

/* Fade In Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Gradient Animation for Hero */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Floating Animation */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(99, 102, 241, 0);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

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

/* Elements hidden initially */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-left.animated {
    opacity: 1;
    transform: translateX(0);
}

.animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-right.animated {
    opacity: 1;
    transform: translateX(0);
}

.animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-scale.animated {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay for children */
.stagger-delay:nth-child(1) { transition-delay: 0.1s; }
.stagger-delay:nth-child(2) { transition-delay: 0.2s; }
.stagger-delay:nth-child(3) { transition-delay: 0.3s; }
.stagger-delay:nth-child(4) { transition-delay: 0.4s; }
.stagger-delay:nth-child(5) { transition-delay: 0.5s; }
.stagger-delay:nth-child(6) { transition-delay: 0.6s; }

/* ====================================
   HOVER EFFECTS
   ==================================== */

/* Card Hover Effect */
.card-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Button Glow Effect */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-glow:hover::before {
    width: 300px;
    height: 300px;
}

.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

/* Icon Bounce */
.icon-bounce:hover {
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Underline Effect */
.hover-underline {
    position: relative;
    display: inline-block;
}

.hover-underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: currentColor;
    transition: width 0.3s ease;
}

.hover-underline:hover::after {
    width: 100%;
}

/* ====================================
   HERO EFFECTS
   ==================================== */

/* Animated Background Gradient */
.hero-gradient-animated {
    background: linear-gradient(135deg, #dc2626, #f59e0b, #ef4444, #dc2626);
    background-size: 300% 300%;
    animation: gradientShift 10s ease infinite;
}

/* Floating Elements */
.floating {
    animation: float 6s ease-in-out infinite;
}

.floating-slow {
    animation: float 8s ease-in-out infinite;
}

/* Particles Background - Canvas based (controlled by JS) */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

/* Ensure content is above particles */
.hero-container {
    position: relative;
    z-index: 2;
}

/* Stats Number Animation */
.stat-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* Chart Line Animation */
@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

.chart-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawLine 2s ease-out forwards;
}

/* ====================================
   PREMIUM VISUAL ENHANCEMENTS
   ==================================== */

/* Animated Gradient Text */
.gradient-text {
    background: linear-gradient(90deg, #dc2626, #f59e0b, #ef4444, #dc2626);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 6s ease infinite;
}

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

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Neon Glow Effect */
.neon-glow {
    box-shadow:
        0 0 10px rgba(99, 102, 241, 0.5),
        0 0 20px rgba(99, 102, 241, 0.3),
        0 0 30px rgba(99, 102, 241, 0.2);
    animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
    0%, 100% {
        box-shadow:
            0 0 10px rgba(99, 102, 241, 0.5),
            0 0 20px rgba(99, 102, 241, 0.3),
            0 0 30px rgba(99, 102, 241, 0.2);
    }
    50% {
        box-shadow:
            0 0 20px rgba(99, 102, 241, 0.7),
            0 0 30px rgba(99, 102, 241, 0.5),
            0 0 40px rgba(99, 102, 241, 0.3);
    }
}

/* Enhanced Card Depth */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-3d:hover {
    transform: translateZ(20px);
}

/* Magnetic Button Effect */
.btn-magnetic {
    position: relative;
    overflow: hidden;
}

.btn-magnetic::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-magnetic:hover::before {
    width: 400px;
    height: 400px;
}

/* Spotlight Effect on Sections */
.section-spotlight {
    position: relative;
    overflow: hidden;
}

.section-spotlight::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.section-spotlight:hover::before {
    opacity: 1;
}

/* Typing Cursor Effect */
.typing-cursor::after {
    content: '|';
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Rainbow Border Animation */
.rainbow-border {
    position: relative;
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(90deg, #dc2626, #f59e0b, #ef4444, #dc2626) border-box;
    background-size: 300% 300%;
    animation: rainbowMove 3s ease infinite;
}

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

/* Elevated Cards on Scroll */
.card-elevated {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-elevated.animated {
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.2);
}

/* Background Mesh Gradient */
.mesh-gradient {
    background:
        radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 0.3) 0px, transparent 50%),
        radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 0.2) 0px, transparent 50%),
        radial-gradient(at 52% 99%, hsla(354, 98%, 61%, 0.2) 0px, transparent 50%),
        radial-gradient(at 10% 29%, hsla(256, 96%, 67%, 0.3) 0px, transparent 50%),
        radial-gradient(at 97% 96%, hsla(38, 60%, 74%, 0.2) 0px, transparent 50%),
        radial-gradient(at 33% 50%, hsla(222, 67%, 73%, 0.3) 0px, transparent 50%),
        radial-gradient(at 79% 53%, hsla(343, 68%, 79%, 0.2) 0px, transparent 50%);
    animation: meshMove 20s ease infinite;
}

@keyframes meshMove {
    0%, 100% { background-position: 0% 0%, 100% 0%, 50% 100%, 0% 50%, 100% 100%, 33% 50%, 79% 53%; }
    50% { background-position: 100% 100%, 0% 100%, 50% 0%, 100% 50%, 0% 0%, 67% 50%, 21% 47%; }
}

/* ====================================
   RESPONSIVE OPTIMIZATIONS
   ==================================== */

/* Reduce animations on mobile for performance */
@media (max-width: 768px) {
    .animate-on-scroll,
    .animate-left,
    .animate-right,
    .animate-scale {
        opacity: 1;
        transform: none;
    }

    .floating,
    .floating-slow {
        animation: none;
    }

    .particles {
        display: none;
    }
}

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