/* =============================================
   FlowBelgium - Advanced Animations
   Aesthetic: Tech-futuristic with fluid motion
   ============================================= */

/* =============================================
   Custom Cursor
   ============================================= */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference;
}

.custom-cursor.hover {
    transform: translate(-50%, -50%) scale(2);
    background: var(--color-primary);
    opacity: 0.5;
}

.custom-cursor.click {
    transform: translate(-50%, -50%) scale(0.8);
}

.cursor-trail {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* =============================================
   Particle Background
   ============================================= */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

/* =============================================
   Glitch Effect for Logo
   ============================================= */
.glitch-text {
    position: relative;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.glitch-text:hover::before {
    animation: glitch-1 0.3s infinite;
    color: var(--color-belgium-red);
    z-index: -1;
    opacity: 0.8;
}

.glitch-text:hover::after {
    animation: glitch-2 0.3s infinite;
    color: var(--color-primary);
    z-index: -2;
    opacity: 0.8;
}

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

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

/* =============================================
   Text Reveal Animation
   ============================================= */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    opacity: 0;
    animation: textReveal 0.8s ease forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Staggered text animation */
.stagger-text span:nth-child(1) { animation-delay: 0.05s; }
.stagger-text span:nth-child(2) { animation-delay: 0.1s; }
.stagger-text span:nth-child(3) { animation-delay: 0.15s; }
.stagger-text span:nth-child(4) { animation-delay: 0.2s; }
.stagger-text span:nth-child(5) { animation-delay: 0.25s; }
.stagger-text span:nth-child(6) { animation-delay: 0.3s; }
.stagger-text span:nth-child(7) { animation-delay: 0.35s; }
.stagger-text span:nth-child(8) { animation-delay: 0.4s; }
.stagger-text span:nth-child(9) { animation-delay: 0.45s; }
.stagger-text span:nth-child(10) { animation-delay: 0.5s; }

/* =============================================
   Magnetic Button Effect
   ============================================= */
.magnetic-btn {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.magnetic-btn .btn-content {
    position: relative;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.float-element:nth-child(odd) {
    animation-delay: -3s;
}

@keyframes floatUpDown {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) rotate(2deg);
    }
    50% {
        transform: translateY(-5px) rotate(0deg);
    }
    75% {
        transform: translateY(-20px) rotate(-2deg);
    }
}

/* =============================================
   Card 3D Tilt Effect
   ============================================= */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.tilt-card .tilt-content {
    transform: translateZ(30px);
}

.tilt-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(251, 191, 36, 0.1) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.tilt-card:hover::before {
    opacity: 1;
}

/* =============================================
   Glow Effects
   ============================================= */
.glow-on-hover {
    position: relative;
    overflow: hidden;
}

.glow-on-hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.4) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    border-radius: 50%;
    z-index: 0;
}

.glow-on-hover:hover::before {
    width: 300%;
    height: 300%;
}

/* =============================================
   Morphing Background Shapes
   ============================================= */
.morph-shape {
    position: absolute;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    background: linear-gradient(45deg, rgba(251, 191, 36, 0.1), rgba(249, 115, 22, 0.1));
    animation: morphShape 15s ease-in-out infinite;
    filter: blur(40px);
}

@keyframes morphShape {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
        transform: rotate(0deg) scale(1);
    }
    25% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
        transform: rotate(90deg) scale(1.1);
    }
    50% {
        border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
        transform: rotate(180deg) scale(1);
    }
    75% {
        border-radius: 60% 30% 60% 40% / 70% 30% 50% 60%;
        transform: rotate(270deg) scale(1.1);
    }
}

/* =============================================
   Typewriter Effect
   ============================================= */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--color-primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blinkCursor 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blinkCursor {
    from, to { border-color: transparent; }
    50% { border-color: var(--color-primary); }
}

/* =============================================
   Scroll Progress Indicator
   ============================================= */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    z-index: 10000;
    transition: width 0.1s ease;
}

/* =============================================
   Reveal Animations on Scroll
   ============================================= */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.17, 0.55, 0.55, 1);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.17, 0.55, 0.55, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.17, 0.55, 0.55, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.17, 0.55, 0.55, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

.reveal-rotate {
    opacity: 0;
    transform: perspective(500px) rotateX(30deg);
    transition: all 0.8s cubic-bezier(0.17, 0.55, 0.55, 1);
}

.reveal-rotate.revealed {
    opacity: 1;
    transform: perspective(500px) rotateX(0deg);
}

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

/* =============================================
   Ripple Effect
   ============================================= */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

.ripple-effect .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.4);
    transform: scale(0);
    animation: rippleAnimation 0.6s linear;
    pointer-events: none;
}

@keyframes rippleAnimation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* =============================================
   Gradient Border Animation
   ============================================= */
.gradient-border {
    position: relative;
    background: var(--color-darker);
    z-index: 1;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        var(--gradient-angle, 0deg),
        var(--color-primary),
        var(--color-accent),
        var(--color-belgium-red),
        var(--color-primary)
    );
    border-radius: inherit;
    z-index: -1;
    animation: rotateGradient 3s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gradient-border:hover::before {
    opacity: 1;
}

@keyframes rotateGradient {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

@property --gradient-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* =============================================
   Icon Bounce Animation
   ============================================= */
.bounce-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.bounce-icon:hover {
    animation: bounceIcon 0.6s ease;
}

@keyframes bounceIcon {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(-5px); }
    75% { transform: translateY(-8px); }
}

/* =============================================
   Loading Shimmer Effect
   ============================================= */
.shimmer {
    position: relative;
    overflow: hidden;
}

.shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shimmerMove 2s infinite;
}

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

/* =============================================
   Counter Animation
   ============================================= */
.counter {
    font-variant-numeric: tabular-nums;
}

/* =============================================
   Parallax Layers
   ============================================= */
.parallax-container {
    perspective: 1000px;
    overflow: hidden;
}

.parallax-layer {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* =============================================
   Noise Overlay
   ============================================= */
.noise-overlay::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* =============================================
   Split Text Animation
   ============================================= */
.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(50px) rotateX(-90deg);
    animation: splitReveal 0.6s ease forwards;
}

@keyframes splitReveal {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0deg);
    }
}

/* =============================================
   Elastic Button
   ============================================= */
.elastic-btn {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.elastic-btn:hover {
    transform: scale(1.05);
}

.elastic-btn:active {
    transform: scale(0.95);
}

/* =============================================
   Spotlight Effect
   ============================================= */
.spotlight {
    position: relative;
    overflow: hidden;
}

.spotlight::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform: translate(-50%, -50%);
}

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

/* =============================================
   Wave Animation for CTA
   ============================================= */
.wave-bg {
    position: relative;
    overflow: hidden;
}

.wave-bg::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23fbbf24' fill-opacity='0.1' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") repeat-x;
    animation: waveMove 10s linear infinite;
}

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

/* =============================================
   Number Counter Flip
   ============================================= */
.flip-counter {
    perspective: 300px;
}

.flip-counter .digit {
    display: inline-block;
    animation: flipIn 0.6s ease forwards;
    transform-origin: center bottom;
}

@keyframes flipIn {
    0% {
        opacity: 0;
        transform: rotateX(-90deg);
    }
    100% {
        opacity: 1;
        transform: rotateX(0);
    }
}

/* =============================================
   Hover Line Animation
   ============================================= */
.hover-line {
    position: relative;
    display: inline-block;
}

.hover-line::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* =============================================
   Card Stack Animation
   ============================================= */
.card-stack {
    position: relative;
}

.card-stack::before,
.card-stack::after {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    border: 1px solid var(--color-gray-800);
    z-index: -1;
    transition: all 0.3s ease;
}

.card-stack::before {
    transform: translateY(8px) scale(0.98);
    opacity: 0.5;
}

.card-stack::after {
    transform: translateY(16px) scale(0.96);
    opacity: 0.3;
}

.card-stack:hover::before {
    transform: translateY(12px) scale(0.98) rotate(-1deg);
}

.card-stack:hover::after {
    transform: translateY(24px) scale(0.96) rotate(1deg);
}

/* =============================================
   Liquid Button
   ============================================= */
.liquid-btn {
    position: relative;
    z-index: 1;
}

.liquid-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    border-radius: inherit;
    z-index: -1;
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    transform: scaleX(0);
    transform-origin: right;
}

.liquid-btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* =============================================
   Breathing Glow
   ============================================= */
.breathing-glow {
    animation: breatheGlow 4s ease-in-out infinite;
}

@keyframes breatheGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(251, 191, 36, 0.4), 0 0 60px rgba(251, 191, 36, 0.2);
    }
}

/* =============================================
   Entrance Animations
   ============================================= */
.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
    animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
}

.zoom-in {
    animation: zoomIn 0.6s ease forwards;
}

.rotate-in {
    animation: rotateIn 0.8s ease forwards;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0) scale(1);
    }
}

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