/**
 * Bungee Pro - Animation Styles
 * Additional CSS for scroll animations, transitions, and effects
 */

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

/* Fade in animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Slide up animation */
.slide-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation for children */
.animate-stagger {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.animate-stagger.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   HEADER SCROLL EFFECTS
   ======================================== */

.site-header {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.site-header.scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.site-header.hidden {
    transform: translateY(-100%);
}

/* ========================================
   BACK TO TOP BUTTON
   ======================================== */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-black);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-gray-dark);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top:active {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* ========================================
   PROJECT CARD ANIMATIONS
   ======================================== */

.project-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out,
                transform 0.6s ease-out,
                box-shadow 0.3s ease-out;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.project-image {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

/* ========================================
   SERVICE CARD ANIMATIONS
   ======================================== */

.service-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease-out,
                transform 0.7s ease-out;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover .service-arrow {
    transform: translateX(8px);
}

.service-arrow {
    transition: transform 0.3s ease-out;
}

/* ========================================
   STAT ANIMATIONS
   ======================================== */

.stat-item {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease-out,
                transform 0.6s ease-out;
}

.stat-item.visible {
    opacity: 1;
    transform: scale(1);
}

.stat-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   TESTIMONIAL ANIMATIONS
   ======================================== */

.testimonial-card {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.7s ease-out,
                transform 0.7s ease-out;
}

.testimonial-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.testimonial-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* ========================================
   FAQ ANIMATIONS
   ======================================== */

.faq-item {
    transition: all 0.3s ease-out;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 0;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 20px 0;
}

.faq-icon {
    transition: transform 0.3s ease-out;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* ========================================
   FORM ANIMATIONS
   ======================================== */

input[type="email"].error,
input[type="text"].error {
    border-color: #e74c3c !important;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

input[type="email"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-black);
    box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.1);
}

/* ========================================
   LAZY LOADING IMAGES
   ======================================== */

img[data-src],
img[data-srcset] {
    opacity: 0;
    transition: opacity 0.4s ease-out;
}

img.loaded {
    opacity: 1;
}

/* ========================================
   MOBILE MENU ANIMATIONS
   ======================================== */

.primary-menu {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease-out;
}

@media (max-width: 768px) {
    .primary-menu {
        transform: translateX(100%);
        opacity: 0;
    }
    
    .primary-menu.active {
        transform: translateX(0);
        opacity: 1;
    }
    
    .menu-toggle {
        transition: transform 0.2s ease-out;
    }
    
    .menu-toggle:active {
        transform: scale(0.95);
    }
    
    body.menu-open {
        overflow: hidden;
    }
}

/* ========================================
   PARALLAX EFFECTS
   ======================================== */

[data-parallax] {
    will-change: transform;
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--color-gray-light);
    border-top-color: var(--color-black);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========================================
   SMOOTH TRANSITIONS
   ======================================== */

* {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

a,
button {
    transition: all 0.3s ease-out;
}

/* ========================================
   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;
        scroll-behavior: auto !important;
    }
    
    .fade-in,
    .slide-up,
    .animate-stagger,
    .project-card,
    .service-card,
    .stat-item,
    .testimonial-card {
        opacity: 1;
        transform: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .back-to-top,
    .menu-toggle,
    .site-header,
    .site-footer {
        display: none;
    }
    
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}
