/* ========================================
   ANIMATIONS - Jamavisa Technologies
   ======================================== */

/* Keyframe Animations */

/* Fade In */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade In Up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Down */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fade In Left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade In Right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scale In */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Up */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Slide Down */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Bounce */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Pulse */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Float */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* Rotate */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Gradient Animation */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Text Reveal */
@keyframes textReveal {
    0% {
        clip-path: inset(0 100% 0 0);
    }
    100% {
        clip-path: inset(0 0 0 0);
    }
}

/* Counter Animation */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wave Animation */
@keyframes wave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(20deg);
    }
    75% {
        transform: rotate(-20deg);
    }
}

/* Ripple Effect */
@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Glow */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(10, 26, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(10, 26, 255, 0.6);
    }
}

/* ========================================
   Animation Classes (Apply with JS)
   ======================================== */

/* Base Animation Setup */
[data-animate] {
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].animated {
    opacity: 1;
}

/* Fade In Up */
[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-up"].animated {
    transform: translateY(0);
}

/* Fade In Down */
[data-animate="fade-down"] {
    transform: translateY(-40px);
}

[data-animate="fade-down"].animated {
    transform: translateY(0);
}

/* Fade In Left */
[data-animate="fade-left"] {
    transform: translateX(-40px);
}

[data-animate="fade-left"].animated {
    transform: translateX(0);
}

/* Fade In Right */
[data-animate="fade-right"] {
    transform: translateX(40px);
}

[data-animate="fade-right"].animated {
    transform: translateX(0);
}

/* Scale In */
[data-animate="scale"] {
    transform: scale(0.9);
}

[data-animate="scale"].animated {
    transform: scale(1);
}

/* Zoom In */
[data-animate="zoom"] {
    transform: scale(0.5);
}

[data-animate="zoom"].animated {
    transform: scale(1);
}

/* Flip */
[data-animate="flip"] {
    transform: perspective(1000px) rotateY(90deg);
}

[data-animate="flip"].animated {
    transform: perspective(1000px) rotateY(0);
}

/* Animation Delays */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }
[data-delay="700"] { transition-delay: 0.7s; }
[data-delay="800"] { transition-delay: 0.8s; }
[data-delay="900"] { transition-delay: 0.9s; }
[data-delay="1000"] { transition-delay: 1s; }

/* ========================================
   Hover Animations
   ======================================== */

/* Button Hover Scale */
.btn-hover-scale {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.btn-hover-scale:hover {
    transform: scale(1.05);
}

/* Card Hover Lift */
.card-hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card-hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

/* Image Hover Zoom */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform var(--transition-slow);
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* Link Hover Underline */
.link-hover-underline {
    position: relative;
}

.link-hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition-normal);
}

.link-hover-underline:hover::after {
    width: 100%;
}

/* Icon Hover Rotate */
.icon-hover-rotate {
    transition: transform var(--transition-normal);
}

.icon-hover-rotate:hover {
    transform: rotate(360deg);
}

/* Icon Hover Bounce */
.icon-hover-bounce:hover {
    animation: bounce 0.6s ease;
}

/* Hover Glow Effect */
.hover-glow {
    transition: box-shadow var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(10, 26, 255, 0.4);
}

/* ========================================
   Loading & Progress Animations
   ======================================== */

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(10, 26, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

/* Progress Bar Animation */
.progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 1s ease-in-out;
}

/* ========================================
   Text Animations
   ======================================== */

/* Animated Gradient Text */
.text-gradient-animated {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--primary));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 3s ease infinite;
}

/* Typing Effect Container */
.typing-text {
    overflow: hidden;
    border-right: 3px solid var(--primary);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

/* ========================================
   Special Effects
   ======================================== */

/* Parallax Background */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Floating Element */
.floating {
    animation: float 3s ease-in-out infinite;
}

/* Pulsing Element */
.pulsing {
    animation: pulse 2s ease-in-out infinite;
}

/* Glowing Element */
.glowing {
    animation: glow 2s ease-in-out infinite;
}

/* Rotating Element */
.rotating {
    animation: rotate 10s linear infinite;
}

/* Bouncing Element */
.bouncing {
    animation: bounce 2s ease infinite;
}

/* Wave Element */
.waving {
    animation: wave 2s ease-in-out infinite;
    transform-origin: 70% 70%;
}

/* ========================================
   Page Transitions
   ======================================== */

/* Page Enter Animation */
.page-enter {
    animation: fadeInUp 0.6s ease forwards;
}

/* Page Exit Animation */
.page-exit {
    animation: fadeIn 0.3s ease reverse forwards;
}

/* Stagger Children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0.1s; }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.2s; }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.3s; }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.4s; }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.5s; }
.stagger-children.animated > *:nth-child(6) { transition-delay: 0.6s; }
.stagger-children.animated > *:nth-child(7) { transition-delay: 0.7s; }
.stagger-children.animated > *:nth-child(8) { transition-delay: 0.8s; }

.stagger-children.animated > * {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Counter Animation Styles
   ======================================== */

.counter-number {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.counter-item {
    text-align: center;
    padding: var(--spacing-md);
}

.counter-item.animated .counter-number {
    animation: countUp 0.6s ease forwards;
}

/* ========================================
   Reduced Motion Support
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }
}
