/**
 * =====================================================
 * Zentos Code - Animations v3.0
 * =====================================================
 */

/* =====================================================
   Entrance 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 zoomIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

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

/* =====================================================
   Continuous Animations
   ===================================================== */

/* Floating (up-down oscillation) */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-16px); }
}

/* Subtle pulse scale */
@keyframes pulsate {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.05); }
}

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

/* Glow pulse (opacity) */
@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}

/* Shimmer / shine sweep */
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Marquee RTL (for tech-stack bar) */
@keyframes marqueeRTL {
    0%   { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

/* Marquee LTR */
@keyframes marqueeLTR {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Ripple */
@keyframes ripple {
    0%   { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Border glow orbit */
@keyframes borderGlow {
    0%   { box-shadow: 0 0 5px var(--z-primary-glow), inset 0 0 5px rgba(108,59,255,0.05); }
    50%  { box-shadow: 0 0 25px var(--z-primary-glow), inset 0 0 15px rgba(108,59,255,0.1); }
    100% { box-shadow: 0 0 5px var(--z-primary-glow), inset 0 0 5px rgba(108,59,255,0.05); }
}

/* Typing cursor blink */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* Number count up (JS handles the value, this handles opacity entry) */
@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* Mesh orb drift */
@keyframes orbDrift {
    0%   { transform: translate(0px, 0px) scale(1); }
    33%  { transform: translate(30px, -50px) scale(1.05); }
    66%  { transform: translate(-20px, 20px) scale(0.97); }
    100% { transform: translate(0px, 0px) scale(1); }
}

/* Stagger children appear */
@keyframes staggerFade {
    from { opacity: 0; transform: translateY(25px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* =====================================================
   Animation Utility Classes
   ===================================================== */

/* Apply float */
.z-anim-float { animation: float 4s ease-in-out infinite; }
.z-anim-float-slow { animation: float 6s ease-in-out infinite; }

/* Apply pulsate */
.z-anim-pulse { animation: pulsate 2.5s ease-in-out infinite; }

/* Apply glow */
.z-anim-glow { animation: glowPulse 2s ease-in-out infinite; }

/* Apply rotation */
.z-anim-rotate { animation: rotate 8s linear infinite; }
.z-anim-rotate-slow { animation: rotate 20s linear infinite; }

/* Apply shimmer to gradient text/backgrounds */
.z-shimmer {
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

/* AOS-style scroll reveal - these are applied by IntersectionObserver */
[data-z-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-z-reveal="left"]  { transform: translateX(-30px); }
[data-z-reveal="right"] { transform: translateX(30px); }
[data-z-reveal="zoom"]  { transform: scale(0.9); }

[data-z-reveal].z-revealed {
    opacity: 1;
    transform: none;
}

[data-z-delay="100"] { transition-delay: 0.1s; }
[data-z-delay="200"] { transition-delay: 0.2s; }
[data-z-delay="300"] { transition-delay: 0.3s; }
[data-z-delay="400"] { transition-delay: 0.4s; }
[data-z-delay="500"] { transition-delay: 0.5s; }
[data-z-delay="600"] { transition-delay: 0.6s; }

/* =====================================================
   Navbar Scroll Transition
   ===================================================== */
.z-navbar {
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}

.z-navbar.scrolled {
    background: rgba(8, 11, 24, 0.95) !important;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 10px 40px rgba(0,0,0,0.5);
    padding-top: 14px !important;
    padding-bottom: 14px !important;
}

/* =====================================================
   Typewriter Effect
   ===================================================== */
.z-typewriter {
    display: inline;
    border-right: 3px solid var(--z-primary);
    animation: blink 0.8s step-end infinite;
    padding-right: 4px;
}

/* =====================================================
   Card Hover Lift + Glow
   ===================================================== */
.z-hover-lift {
    transition: var(--z-transition);
}
.z-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--z-shadow-primary);
}

/* =====================================================
   Gradient Animated Button Shine
   ===================================================== */
.z-btn-shine {
    position: relative;
    overflow: hidden;
}

.z-btn-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: skewX(-20deg);
    transition: none;
}

.z-btn-shine:hover::before {
    animation: btnShine 0.6s ease;
}

@keyframes btnShine {
    0%   { left: -100%; }
    100% { left: 150%; }
}

/* =====================================================
   Page Transition
   ===================================================== */
.z-page-enter {
    animation: fadeInUp 0.5s ease both;
}

/* =====================================================
   Orb drift animation (hero background)
   ===================================================== */
.z-hero-orb-1 {
    animation: orbDrift 12s ease-in-out infinite;
}
.z-hero-orb-2 {
    animation: orbDrift 16s ease-in-out infinite reverse;
    animation-delay: -5s;
}
.z-hero-orb-3 {
    animation: orbDrift 20s ease-in-out infinite;
    animation-delay: -10s;
}

/* =====================================================
   Success / Error pulse for payment
   ===================================================== */
@keyframes successPulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
    70%  { box-shadow: 0 0 0 15px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-6px); }
    80%       { transform: translateX(6px); }
}

.z-anim-success { animation: successPulse 1s ease-out; }
.z-anim-error   { animation: errorShake 0.5s ease-out; }

/* =====================================================
   Stagger Grid Animation (JS-triggered)
   ===================================================== */
.z-stagger-item {
    opacity: 0;
    animation: staggerFade 0.6s ease forwards;
}

.z-stagger-item:nth-child(1) { animation-delay: 0.05s; }
.z-stagger-item:nth-child(2) { animation-delay: 0.15s; }
.z-stagger-item:nth-child(3) { animation-delay: 0.25s; }
.z-stagger-item:nth-child(4) { animation-delay: 0.35s; }
.z-stagger-item:nth-child(5) { animation-delay: 0.45s; }
.z-stagger-item:nth-child(6) { animation-delay: 0.55s; }
