/* Page Transition Styles */
.page-transition-ready {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.page-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Page-specific styles */
.page-index .hero-section {
    animation: fadeInUp 0.8s ease-out;
}

.page-about .our-story,
.page-services .services-overview,
.page-how-it-works .process-overview,
.page-faq .faq-search,
.page-contact .contact-options {
    animation: fadeInUp 0.8s ease-out;
}

/* Page entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scrolling for all pages */
html {
    scroll-behavior: smooth;
}

/* Active link highlighting */
.main-menu a.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Section highlighting when scrolled to via hash */
section:target {
    animation: highlight 1.5s ease-out;
}

@keyframes highlight {
    0% {
        background-color: rgba(255, 119, 0, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

/* Service section animations */
.service-detail:nth-child(odd) {
    animation: fadeInLeft 0.8s ease-out;
}

.service-detail:nth-child(even) {
    animation: fadeInRight 0.8s ease-out;
}

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

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

/* FAQ animations */
.faq-item.active {
    animation: expandFaq 0.5s ease-out;
}

@keyframes expandFaq {
    from {
        background-color: rgba(0, 102, 204, 0.05);
    }
    to {
        background-color: transparent;
    }
}

/* Stats counter animation */
.stat-number.counting {
    animation: pulse 0.5s infinite alternate;
}

/* Enhanced mobile menu transitions */
.mobile-menu-container {
    transform: translateX(100%);
    transition: transform 0.4s ease-out;
}

.mobile-menu-container.active {
    transform: translateX(0);
}

/* Improved button hover effects */
.cta-button, 
.service-btn, 
.learn-more, 
.chat-button, 
.partner-link, 
.business-link,
.submit-btn {
    position: relative;
    overflow: hidden;
}

.cta-button:after, 
.service-btn:after, 
.chat-button:after, 
.partner-link:after, 
.business-link:after,
.submit-btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.cta-button:hover:after, 
.service-btn:hover:after, 
.chat-button:hover:after, 
.partner-link:hover:after, 
.business-link:hover:after,
.submit-btn:hover:after {
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Quote form step transitions */
.form-step {
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.form-step:not(.active) {
    transform: translateX(50px);
    opacity: 0;
}

.form-step.active {
    transform: translateX(0);
    opacity: 1;
}

/* Testimonial slider animation */
.testimonial-slide {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* Enhanced notification system */
.notification {
    animation-duration: 0.5s;
    animation-fill-mode: both;
}

.notification.active {
    animation-name: slideInRight;
}

.notification.hiding {
    animation-name: slideOutRight;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-transition-ready {
        transition: opacity 0.2s ease;
    }
    
    .service-detail:nth-child(odd),
    .service-detail:nth-child(even) {
        animation: fadeIn 0.8s ease-out;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}
