/* ═══════════════════════════════════════════════════════════════════
   RH GESTÃO - UX EFFECTS v1.0
   Premium Visual Effects & Micro-interactions
   Inspired by overrrides.com
   ═══════════════════════════════════════════════════════════════════ */

/* ----------------------------------------------------------------
   0. VIDEO BACKGROUND (Cinematic Effect)
   Inspired by temporal.xyz / fusionai
   ---------------------------------------------------------------- */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.15;
    filter: saturate(0.8) contrast(1.1);
}

/* Dark overlay to ensure readability */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.6) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Optional particle/noise overlay for extra depth */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* ----------------------------------------------------------------
   1. SCROLL PROGRESS INDICATOR
   ---------------------------------------------------------------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg,
            var(--tech-green-digital, #00E05A) 0%,
            var(--tech-green-corporate, #5CFF9D) 50%,
            var(--accent-info, #5ac8fa) 100%);
    z-index: 99999;
    transition: width 50ms ease-out;
    box-shadow:
        0 0 10px var(--tech-green-digital, #00E05A),
        0 0 20px rgba(0, 224, 90, 0.3);
    pointer-events: none;
}

/* ----------------------------------------------------------------
   2. STYLED UNDERLINE (Wavy Green)
   ---------------------------------------------------------------- */
.styled-underline,
.wavy-underline {
    text-decoration: none;
    position: relative;
    display: inline;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%2300E05A' stroke-width='1.5' d='M0 3c2.5-1.5 5-3 7.5-1.5S12.5 4 15 2.5 20 0 20 0'/%3E%3C/svg%3E");
    background-position: 0 calc(100% - 2px);
    background-repeat: repeat-x;
    background-size: 20px 4px;
    padding-bottom: 4px;
    transition: background-position 0.3s ease;
}

.styled-underline:hover,
.wavy-underline:hover {
    background-position: 10px calc(100% - 2px);
}

/* Variação com animação contínua */
.wavy-underline-animated {
    text-decoration: none;
    position: relative;
    display: inline;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 4'%3E%3Cpath fill='none' stroke='%2300E05A' stroke-width='1.5' d='M0 3c2.5-1.5 5-3 7.5-1.5S12.5 4 15 2.5 20 0 20 0'/%3E%3C/svg%3E");
    background-position: 0 calc(100% - 2px);
    background-repeat: repeat-x;
    background-size: 20px 4px;
    padding-bottom: 4px;
    animation: wavyMove 2s linear infinite;
}

@keyframes wavyMove {
    0% {
        background-position: 0 calc(100% - 2px);
    }

    100% {
        background-position: 20px calc(100% - 2px);
    }
}

/* ----------------------------------------------------------------
   3. BIEN GLASS EFFECT (Premium Glassmorphism)
   ---------------------------------------------------------------- */
.bien-glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 16px);
    box-shadow:
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02),
        0 20px 60px -20px rgba(0, 0, 0, 0.4),
        0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* Light bleeding effect */
.bien-glass::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%,
            rgba(0, 224, 90, 0.08) 0%,
            transparent 50%);
    pointer-events: none;
    animation: glassShine 8s ease-in-out infinite;
}

@keyframes glassShine {

    0%,
    100% {
        opacity: 0.5;
        transform: rotate(0deg);
    }

    50% {
        opacity: 1;
        transform: rotate(3deg);
    }
}

/* Frost edge effect */
.bien-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 40%,
            transparent 60%,
            rgba(255, 255, 255, 0.03) 100%);
    pointer-events: none;
}

/* ----------------------------------------------------------------
   4. CURSOR HIGHLIGHTER / SPOTLIGHT
   ---------------------------------------------------------------- */
.cursor-spotlight {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle at center,
            rgba(0, 224, 90, 0.15) 0%,
            rgba(0, 224, 90, 0.05) 30%,
            transparent 70%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}

/* Smaller, more subtle version */
.cursor-spotlight.subtle {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at center,
            rgba(0, 224, 90, 0.08) 0%,
            transparent 60%);
}

/* ----------------------------------------------------------------
   5. SMOOTH SCROLL
   ---------------------------------------------------------------- */
html.smooth-scroll,
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Scroll snap for sections */
.scroll-snap-container {
    scroll-snap-type: y proximity;
    overflow-y: auto;
    height: 100vh;
}

.scroll-snap-section {
    scroll-snap-align: start;
}

/* ----------------------------------------------------------------
   6. SCROLL-TO-TOP BUTTON
   ---------------------------------------------------------------- */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card, rgba(28, 28, 30, 0.65));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    color: var(--tech-green-digital, #00E05A);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 9990;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--tech-green-digital, #00E05A);
    color: var(--bg-primary, #0c0c0e);
    transform: translateY(-4px);
    box-shadow:
        0 8px 30px rgba(0, 224, 90, 0.3),
        0 0 20px rgba(0, 224, 90, 0.2);
}

.scroll-to-top svg,
.scroll-to-top i {
    width: 24px;
    height: 24px;
}

/* ----------------------------------------------------------------
   7. TYPEWRITER CURSOR
   ---------------------------------------------------------------- */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--tech-green-digital, #00E05A);
    margin-left: 2px;
    animation: blink 0.8s steps(1) infinite;
    box-shadow: 0 0 10px var(--tech-green-digital, #00E05A);
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ----------------------------------------------------------------
   8. VARIABLE WAVE EFFECT
   ---------------------------------------------------------------- */
.wave-effect {
    animation: wave 3s ease-in-out infinite;
}

.wave-effect-fast {
    animation: wave 1.5s ease-in-out infinite;
}

.wave-effect-slow {
    animation: wave 5s ease-in-out infinite;
}

@keyframes wave {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Wave with rotation */
.wave-rotate {
    animation: waveRotate 4s ease-in-out infinite;
}

@keyframes waveRotate {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-5px) rotate(1deg);
    }

    50% {
        transform: translateY(-10px) rotate(0deg);
    }

    75% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

/* Float effect (more subtle) */
.float-effect {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ----------------------------------------------------------------
   9. GLOW PULSE EFFECT
   ---------------------------------------------------------------- */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(0, 224, 90, 0.3);
    }

    50% {
        box-shadow:
            0 0 20px rgba(0, 224, 90, 0.5),
            0 0 40px rgba(0, 224, 90, 0.2);
    }
}

/* ----------------------------------------------------------------
   10. REVEAL ON SCROLL
   ---------------------------------------------------------------- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children reveal */
.reveal-stagger>* {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

.reveal-stagger.revealed>*:nth-child(1) {
    transition-delay: 0ms;
}

.reveal-stagger.revealed>*:nth-child(2) {
    transition-delay: 100ms;
}

.reveal-stagger.revealed>*:nth-child(3) {
    transition-delay: 200ms;
}

.reveal-stagger.revealed>*:nth-child(4) {
    transition-delay: 300ms;
}

.reveal-stagger.revealed>*:nth-child(5) {
    transition-delay: 400ms;
}

.reveal-stagger.revealed>*:nth-child(6) {
    transition-delay: 500ms;
}

.reveal-stagger.revealed>* {
    opacity: 1;
    transform: translateY(0);
}

/* ----------------------------------------------------------------
   11. HOVER TILT 3D
   ---------------------------------------------------------------- */
.hover-tilt {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.hover-tilt:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg);
}

/* ----------------------------------------------------------------
   12. MAGNETIC BUTTON EFFECT (CSS part)
   ---------------------------------------------------------------- */
.magnetic-btn {
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

/* ----------------------------------------------------------------
   13. TEXT SHIMMER EFFECT
   ---------------------------------------------------------------- */
.text-shimmer {
    background: linear-gradient(90deg,
            var(--tech-green-digital, #00E05A) 0%,
            var(--tech-green-corporate, #5CFF9D) 25%,
            #ffffff 50%,
            var(--tech-green-corporate, #5CFF9D) 75%,
            var(--tech-green-digital, #00E05A) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

/* ----------------------------------------------------------------
   14. BORDER GRADIENT ANIMATION
   ---------------------------------------------------------------- */
.border-gradient {
    position: relative;
    background: var(--bg-card, rgba(28, 28, 30, 0.65));
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
}

.border-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: inherit;
    background: linear-gradient(135deg,
            var(--tech-green-digital, #00E05A),
            var(--accent-info, #5ac8fa),
            var(--accent-purple, #bf5af2),
            var(--tech-green-digital, #00E05A));
    background-size: 300% 300%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: borderRotate 5s linear infinite;
}

@keyframes borderRotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}