/* =================================================================
   NEMABO ANIMATION SYSTEM
   Modern, Stripe-inspired animations and effects
   ================================================================= */

/* ===== KEYFRAME ANIMATIONS ===== */

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

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

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

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

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

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

@keyframes glow {
    0%, 100% {
        filter: blur(80px);
        opacity: 0.6;
    }
    50% {
        filter: blur(100px);
        opacity: 0.8;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

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

@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(16, 185, 129, 0.3);
        box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
    }
    50% {
        border-color: rgba(16, 185, 129, 0.6);
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.2);
    }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes dash {
    to { stroke-dashoffset: 0; }
}

/* ===== ANIMATION UTILITY CLASSES ===== */

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.animate-scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

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

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

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 4s ease-in-out infinite;
}

/* Animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-1000 { animation-delay: 1s; }
.delay-1200 { animation-delay: 1.2s; }

/* ===== SCROLL-TRIGGERED ANIMATIONS ===== */
/* Elements are visible by default - CSS-only animations on load */

[data-animate] {
    opacity: 1;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-animate="fade-up"] {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-animate="fade-down"] {
    animation: fadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-animate="fade-left"] {
    animation: fadeInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-animate="fade-right"] {
    animation: fadeInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-animate="scale"] {
    animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-animate="zoom"] {
    animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Animation delays for sequential appearance */
[data-animate]:nth-child(1) { animation-delay: 0.1s; }
[data-animate]:nth-child(2) { animation-delay: 0.2s; }
[data-animate]:nth-child(3) { animation-delay: 0.3s; }
[data-animate]:nth-child(4) { animation-delay: 0.4s; }
[data-animate]:nth-child(5) { animation-delay: 0.5s; }
[data-animate]:nth-child(6) { animation-delay: 0.6s; }

/* Staggered children - visible by default with CSS animations */
[data-stagger] > * {
    opacity: 1;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

[data-stagger] > *:nth-child(1) { animation-delay: 0.1s; }
[data-stagger] > *:nth-child(2) { animation-delay: 0.2s; }
[data-stagger] > *:nth-child(3) { animation-delay: 0.3s; }
[data-stagger] > *:nth-child(4) { animation-delay: 0.4s; }
[data-stagger] > *:nth-child(5) { animation-delay: 0.5s; }
[data-stagger] > *:nth-child(6) { animation-delay: 0.6s; }

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

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(10, 37, 64, 0.15);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}

.hover-border-glow {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hover-border-glow:hover {
    border-color: var(--nf-violet);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* ===== GRADIENT BACKGROUNDS ===== */

.gradient-animated {
    background: linear-gradient(
        135deg,
        var(--nf-navy) 0%,
        var(--nf-navy-light) 25%,
        var(--nf-navy) 50%,
        var(--nf-navy-light) 75%,
        var(--nf-navy) 100%
    );
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.gradient-mesh {
    background:
        radial-gradient(at 40% 20%, rgba(16, 185, 129, 0.3) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(0, 212, 170, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(16, 185, 129, 0.2) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(0, 212, 170, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(16, 185, 129, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 100%, rgba(0, 212, 170, 0.1) 0px, transparent 50%),
        var(--nf-gradient-hero);
}

/* ===== GLASSMORPHISM ===== */

.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-light {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-dark {
    background: rgba(10, 37, 64, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== GLOWING ORBS ===== */

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: glow 4s ease-in-out infinite;
}

.orb-violet {
    background: var(--nf-gradient-glow-violet);
}

.orb-teal {
    background: var(--nf-gradient-glow-teal);
}

.orb-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    bottom: -150px;
    left: -100px;
    animation-delay: -2s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -1s;
}

/* ===== SHIMMER EFFECT (for loading/skeleton) ===== */

.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ===== GRADIENT TEXT ===== */

.gradient-text {
    background: linear-gradient(135deg, #10B981 0%, var(--nf-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-animated {
    background: linear-gradient(
        135deg,
        #10B981 0%,
        var(--nf-teal) 33%,
        #10B981 66%,
        var(--nf-teal) 100%
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 12s linear infinite;
}

/* ===== BUTTON EFFECTS ===== */

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.btn-glow:hover::before {
    left: 100%;
}

/* ===== CARD EFFECTS ===== */

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateZ(10px);
}

/* ===== BORDER GRADIENT ===== */

.border-gradient {
    position: relative;
    background: var(--nf-surface);
    border-radius: var(--nf-radius-xl);
}

.border-gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--nf-violet), var(--nf-teal));
    -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;
}

/* ===== ANIMATED UNDERLINE ===== */

.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--nf-violet), var(--nf-teal));
    transition: width 0.3s ease;
}

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

/* ===== RESPONSIVE - Reduce motion for accessibility ===== */

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

/* ===== MOBILE - Simpler animations ===== */

@media (max-width: 768px) {
    .orb {
        display: none;
    }

    .animate-float,
    .animate-float-slow {
        animation: none;
    }

    [data-animate] {
        transform: none !important;
        opacity: 1 !important;
    }
}
