/* ============================================
   Atlas Detectives - Animations CSS
   Premium Investigation Agency
   ============================================ */

/* ========== BASE KEYFRAMES ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

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

@keyframes lineGrowVertical {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* Animation Classes */
.animate-fade-in {
    opacity: 0;
}

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

.animate-scale-in {
    opacity: 0;
}

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

.animate-slide-left {
    opacity: 0;
}

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

.animate-slide-right {
    opacity: 0;
}

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

/* Line Divider Animation */
.line-divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-primary);
    transform-origin: left center;
    transform: scaleX(0);
}

.line-divider.visible {
    animation: lineGrow 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* Hero Text Split Animation */
.hero-headline .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
}

.hero-headline.animate .word {
    animation: fadeInUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Border Grow Animation */
@keyframes borderGrow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

.accent-border-left {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--color-primary);
    transform-origin: top center;
    transform: scaleY(0);
}

.accent-border-left.visible {
    animation: borderGrow 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Card Hover Effects - Uniform -3px lift */
.card-hover {
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

/* Button Hover Animation */
.btn-hover-effect {
    position: relative;
    overflow: hidden;
}

.btn-hover-effect::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;
}

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

/* Nav Link Underline Animation */
.nav-link-animate {
    position: relative;
}

.nav-link-animate::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link-animate:hover::after {
    width: 100%;
}

/* Trust Item Stagger Animation */
.trust-item {
    opacity: 0;
    transform: translateY(20px);
}

.trust-item.visible {
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.trust-item.visible:nth-child(1) { animation-delay: 0s; }
.trust-item.visible:nth-child(2) { animation-delay: 0.15s; }
.trust-item.visible:nth-child(3) { animation-delay: 0.3s; }
.trust-item.visible:nth-child(4) { animation-delay: 0.45s; }

/* Stat Counter Animation - Moved to home.css */

/* Page Transition */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-transition.active {
    opacity: 1;
    pointer-events: all;
}

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

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(201, 168, 76, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Pulse Animation for CTA */
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(201, 168, 76, 0); }
}

.btn-pulse {
    animation: pulse 2s infinite;
}

/* Scroll Reveal Base Styles */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Aliases for backward compat - all use same reveal pattern */
.reveal-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-up.revealed,
.reveal-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed,
.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.revealed,
.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Parallax Container */
.parallax-container {
    overflow: hidden;
    position: relative;
}

.parallax-element {
    will-change: transform;
}

/* Clip Path Reveal Animation */
@keyframes clipReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0% 0 0);
    }
}

.clip-reveal {
    clip-path: inset(0 100% 0 0);
}

.clip-reveal.visible {
    animation: clipReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Hero Split Text */
[data-split-text] {
    opacity: 0;
}

.split-line {
    overflow: hidden;
    display: block;
}

.split-line-inner {
    display: block;
}

/* Image Zoom on Scroll */
.img-zoom-scroll {
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.img-zoom-scroll.visible {
    transform: scale(1.05);
}

/* Hero content must always be visible for LCP — never start at opacity:0 */
.hero .reveal-up,
.hero .reveal {
    opacity: 1;
    transform: none;
}

/* Mobile Animation Adjustments */
@media (max-width: 768px) {
    .animate-fade-in.visible,
    .animate-scale-in.visible,
    .animate-slide-left.visible,
    .animate-slide-right.visible {
        animation-duration: 0.5s;
    }
    
    .trust-item.visible:nth-child(1),
    .trust-item.visible:nth-child(2),
    .trust-item.visible:nth-child(3),
    .trust-item.visible:nth-child(4) {
        animation-delay: 0s;
    }
}
