/* ===================================
 * Advanced Animations & Effects
 * =================================== */

/* === Scroll Reveal Variants === */
.reveal-left {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left.active,
.reveal-right.active,
.reveal-up.active,
.reveal-scale.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* === Staggered children animation === */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.active > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.active > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.active > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.active > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.active > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.active > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.active > *:nth-child(7) { transition-delay: 0.35s; }

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

/* === Floating animation for icons === */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.service-icon {
    animation: float 4s ease-in-out infinite;
}

.service-card:nth-child(2) .service-icon { animation-delay: 0.5s; }
.service-card:nth-child(3) .service-icon { animation-delay: 1s; }
.service-card:nth-child(4) .service-icon { animation-delay: 1.5s; }
.service-card:nth-child(5) .service-icon { animation-delay: 2s; }
.service-card:nth-child(6) .service-icon { animation-delay: 2.5s; }

/* === Glow pulse for value icons === */
@keyframes glow-pulse {
    0%, 100% { 
        text-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
    }
    50% { 
        text-shadow: 0 0 20px rgba(212, 168, 67, 0.6), 0 0 40px rgba(212, 168, 67, 0.2);
    }
}

.value-icon {
    animation: glow-pulse 3s ease-in-out infinite;
}

.value-item:nth-child(2) .value-icon { animation-delay: 0.5s; }
.value-item:nth-child(3) .value-icon { animation-delay: 1s; }
.value-item:nth-child(4) .value-icon { animation-delay: 1.5s; }
.value-item:nth-child(5) .value-icon { animation-delay: 2s; }
.value-item:nth-child(6) .value-icon { animation-delay: 2.5s; }

/* === Process step counter pulse === */
@keyframes number-pop {
    0%, 100% { transform: translateX(50%) scale(1); }
    50% { transform: translateX(50%) scale(1.15); }
}

.process-number {
    animation: number-pop 3s ease-in-out infinite;
}

.process-step:nth-child(2) .process-number { animation-delay: 0.7s; }
.process-step:nth-child(3) .process-number { animation-delay: 1.4s; }
.process-step:nth-child(4) .process-number { animation-delay: 2.1s; }

/* === Card shimmer on hover === */
.service-card::before,
.vm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.05), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}

.service-card:hover::before,
.vm-card:hover::before {
    left: 100%;
}

.service-card,
.vm-card {
    position: relative;
    overflow: hidden;
}

/* === Hero title glow === */
.hero-title {
    animation: title-glow 4s ease-in-out infinite alternate;
}

@keyframes title-glow {
    0% { text-shadow: 0 0 10px rgba(255, 255, 255, 0.1); }
    100% { text-shadow: 0 0 30px rgba(212, 168, 67, 0.3), 0 0 60px rgba(212, 168, 67, 0.1); }
}

/* === Section divider animation === */
.section-title::after {
    animation: line-grow 1.5s ease-out forwards;
    transform-origin: center;
}

@keyframes line-grow {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

/* === Stats number bounce when visible === */
@keyframes count-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.stat-item:hover .stat-number {
    animation: count-bounce 0.4s ease;
}

.stat-item:hover .stat-icon {
    animation: float 1s ease-in-out;
}

/* === Portfolio hover zoom icon === */
.portfolio-item:hover i {
    animation: float 1s ease-in-out infinite;
}

/* === Smooth scroll indicator pulse === */
.scroll-down {
    animation: scroll-pulse 2.5s ease-in-out infinite;
}

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

/* === Contact icon hover spin === */
.contact-icon:hover {
    animation: icon-spin 0.6s ease;
}

@keyframes icon-spin {
    0% { transform: rotateY(0); }
    100% { transform: rotateY(360deg); }
}

/* === FAQ expand smooth === */
.faq-item {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.faq-item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.faq-item.active {
    box-shadow: 0 8px 30px rgba(212, 168, 67, 0.1);
    border-right: 3px solid var(--gold);
}

/* === Gradient border animation for about stats === */
.about-stats-card {
    position: relative;
    overflow: hidden;
}

.about-stats-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--gold), transparent, var(--gold), transparent);
    background-size: 400% 400%;
    animation: gradient-border 6s ease infinite;
    z-index: -1;
    border-radius: var(--radius-lg);
}

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

/* === Navbar glassmorphism on scroll === */
.navbar.scrolled {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* === 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;
    }
    
    .scroll-down,
    .service-icon,
    .value-icon,
    .process-number,
    .hero-title {
        animation: none !important;
    }
}
