/* ============================================
   STOXTRENDS - Effects & Animations
   Scroll animations, Particles, Glows, etc.
   ============================================ */

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

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

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

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

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.6s; }
.stagger-children.active > *:nth-child(7) { transition-delay: 0.7s; }
.stagger-children.active > *:nth-child(8) { transition-delay: 0.8s; }
.stagger-children.active > *:nth-child(9) { transition-delay: 0.9s; }
.stagger-children.active > *:nth-child(10) { transition-delay: 1s; }

.stagger-children.active > * {
    opacity: 1;
    transform: translateY(0);
}

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

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;
}

/* Animated Grid Background */
.grid-background {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(245, 179, 1, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 179, 1, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

/* Gradient Orbs */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 15s ease-in-out infinite;
}

.hero-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-primary);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.hero-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-secondary);
    bottom: -150px;
    left: -100px;
    animation-delay: -5s;
}

.hero-orb-3 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.5);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

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

/* Noise Texture Overlay */
.noise-overlay {
    position: absolute;
    inset: 0;
    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");
    opacity: 0.03;
    pointer-events: none;
}

/* Vignette Effect */
.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 100%);
    pointer-events: none;
}

/* Hero Content Animations */
.hero-content {
    position: relative;
    z-index: 1;
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-primary);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.8s ease forwards;
}

.hero-label .pulse {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
}

.hero-title {
    animation: fadeInUp 0.8s ease 0.1s forwards;
    opacity: 0;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

.hero-actions {
    animation: fadeInUp 0.8s ease 0.3s forwards;
    opacity: 0;
}

.hero-stats {
    animation: fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
}

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

/* ============================================
   TYPING EFFECT
   ============================================ */
.typing-effect {
    display: inline;
    border-right: 3px solid var(--accent-primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.counter {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   GLOW EFFECTS
   ============================================ */
.glow-text {
    text-shadow: 0 0 20px var(--accent-primary-glow);
}

.glow-box {
    box-shadow: 0 0 40px var(--accent-primary-glow);
}

.glow-border {
    position: relative;
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    filter: blur(10px);
    transition: opacity var(--transition-base);
}

.glow-border:hover::before {
    opacity: 0.5;
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */
.float {
    animation: float 6s ease-in-out infinite;
}

.float-delayed {
    animation: float 6s ease-in-out 2s infinite;
}

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

/* ============================================
   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: shimmer 2s infinite;
}

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

/* ============================================
   GRADIENT BORDER
   ============================================ */
.gradient-border {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* ============================================
   ROTATING BORDER
   ============================================ */
.rotating-border {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.rotating-border::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: conic-gradient(
        from 0deg,
        transparent,
        var(--accent-primary),
        transparent 30%
    );
    animation: rotateBorder 4s linear infinite;
}

.rotating-border::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--bg-card);
    border-radius: calc(var(--radius-lg) - 2px);
}

.rotating-border > * {
    position: relative;
    z-index: 1;
}

@keyframes rotateBorder {
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   PARTICLE CANVAS
   ============================================ */
#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--gradient-primary);
    z-index: var(--z-max);
    transition: width 0.1s linear;
}

/* ============================================
   MAGNETIC HOVER EFFECT
   ============================================ */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   PARALLAX
   ============================================ */
.parallax {
    transition: transform 0.1s linear;
    will-change: transform;
}

/* ============================================
   TILT EFFECT
   ============================================ */
.tilt {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tilt-inner {
    transition: transform 0.5s ease;
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-card) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */
.ripple {
    position: relative;
    overflow: hidden;
}

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

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

/* ============================================
   SPOTLIGHT HOVER
   ============================================ */
.spotlight {
    position: relative;
    overflow: hidden;
}

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

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

/* ============================================
   MORPHING BLOB
   ============================================ */
.blob {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

/* ============================================
   MARQUEE
   ============================================ */
.marquee {
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    animation: marquee 20s linear infinite;
}

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

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

/* ============================================
   SPLIT TEXT ANIMATION
   ============================================ */
.split-text span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.split-text.active span {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   3D CARD FLIP
   ============================================ */
.flip-card {
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ============================================
   SCROLL DOWN INDICATOR
   ============================================ */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: fadeIn 1s ease 1s forwards;
    opacity: 0;
}

.scroll-indicator .mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    position: relative;
}

.scroll-indicator .wheel {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-50%) translateY(12px);
        opacity: 0;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ============================================
   PAGE TRANSITIONS
   ============================================ */
.page-transition {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: var(--z-max);
    transform: translateY(-100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 768px) {
    .hero-orb-1 {
        width: 300px;
        height: 300px;
    }
    
    .hero-orb-2 {
        width: 250px;
        height: 250px;
    }
    
    .hero-orb-3 {
        width: 200px;
        height: 200px;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }
}
