/**
 * KOTA-Inspired Animations
 * A+ Enterprise - Modern Agency Animations
 */

/* ============================================
   TYPING ANIMATION - Cursor Blink
   ============================================ */

@keyframes blink-cursor {
    0%, 100% { border-color: var(--primary, #3b82f6); }
    50% { border-color: transparent; }
}

.typing-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
}

/* ============================================
   SPLIT WORD REVEAL
   ============================================ */

.split-word {
    display: inline-block;
    will-change: transform, opacity;
}

.split-reveal {
    overflow: hidden;
}

/* ============================================
   SMOOTH REVEAL ON SCROLL
   Only hide elements when JS is ready
   ============================================ */

.js-ready section:not(.hero-video) {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.js-ready section:not(.hero-video).revealed,
section:not(.hero-video).revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.js-ready .reveal-child,
.js-ready .card,
.js-ready .service-card,
.js-ready .stat-item,
.js-ready .creative-card,
.js-ready .glow-card {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.child-revealed,
.revealed .card,
.revealed .service-card,
.revealed .stat-item,
.revealed .creative-card,
.revealed .glow-card {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   FADE IN UP ANIMATION
   ============================================ */

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

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

/* ============================================
   SCALE IN ANIMATION
   ============================================ */

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

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

/* ============================================
   SLIDE IN ANIMATIONS
   ============================================ */

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

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

.slide-in-left {
    animation: slideInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.slide-in-right {
    animation: slideInRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================================
   STAGGER CHILDREN ANIMATION
   ============================================ */

.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.5s; }

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

/* ============================================
   HERO ANIMATIONS
   ============================================ */

.hero-title {
    animation: heroTitleReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

@keyframes heroTitleReveal {
    from {
        opacity: 0;
        transform: translateY(40px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.hero-subtitle {
    animation: heroSubtitleReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

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

.cta-group {
    animation: ctaReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.9s;
    opacity: 0;
}

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

.trust-badges {
    animation: badgesReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.2s;
    opacity: 0;
}

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

/* ============================================
   HOVER EFFECTS - KOTA STYLE
   ============================================ */

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

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

.hover-glow {
    transition: all 0.4s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

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

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

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.cta-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cta-btn::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 ease;
}

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

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.3);
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

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

.gradient-text-animated {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #3b82f6);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 5s ease infinite;
}

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

/* ============================================
   COUNTER ANIMATION
   ============================================ */

.stat-number {
    font-variant-numeric: tabular-nums;
    transition: all 0.3s ease;
}

.stat-item.counting .stat-number {
    transform: scale(1.1);
}

/* ============================================
   MARQUEE / SCROLLING TEXT
   ============================================ */

.marquee-container {
    overflow: hidden;
    white-space: nowrap;
}

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

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

/* ============================================
   PARALLAX LAYERS
   ============================================ */

.parallax-container {
    perspective: 1000px;
    overflow: hidden;
}

.parallax-layer {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary, #ffffff);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color, #e2e8f0);
    border-top-color: var(--primary, #3b82f6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   IMAGE REVEAL
   ============================================ */

.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary, #3b82f6);
    transform: translateX(-101%);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-reveal.revealed::after {
    transform: translateX(101%);
}

.image-reveal img {
    transform: scale(1.2);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-reveal.revealed img {
    transform: scale(1);
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */

.section-divider {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary, #3b82f6), var(--secondary, #8b5cf6));
    border-radius: 2px;
    margin: 0 auto 2rem;
    animation: dividerExpand 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: scaleX(0);
}

.revealed .section-divider {
    transform: scaleX(1);
}

@keyframes dividerExpand {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* ============================================
   FLOATING ANIMATION
   ============================================ */

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

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

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

/* ============================================
   PULSE ANIMATION
   ============================================ */

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

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

/* ============================================
   SCROLL INDICATOR
   ============================================ */

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

@keyframes scroll {
    0% { top: 10px; opacity: 1; }
    100% { top: 30px; opacity: 0; }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

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

@media (max-width: 768px) {
    section:not(.hero-video) {
        transform: translateY(30px);
    }
    
    .reveal-child,
    .card,
    .service-card {
        transform: translateY(20px);
    }
}
