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

/* Keyframe Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

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

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

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


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

/* Page Load Animations */
.hero-content {
    animation: fadeIn 1s ease-out;
}

.hero-badge {
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.hero-title .title-line:first-child {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-title .title-line:last-child {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero-cta {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.hero-stats {
    animation: fadeInUp 0.8s ease-out 1.2s both;
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease-out;
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s ease-out;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger Delays for Grid Items */
.tour-card:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.tour-card:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.tour-card:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.story-card:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.story-card:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.story-card:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.feature-card:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.feature-card:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.feature-card:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.feature-card:nth-child(4) {
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* Static Gradient Overlay for Images */
.tour-image::before,
.story-image::before,
.about-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    opacity: 0.8;
    z-index: 1;
    pointer-events: none;
}

/* Hover Effects */
.btn-primary,
.btn-secondary,
.btn-outline {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-card,
.story-card,
.feature-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth Transitions - applied to interactive elements only */
a, button, .btn-primary, .btn-secondary, .btn-outline,
.tour-card, .story-card, .feature-card {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navbar Scroll Animation */
.navbar {
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.98);
}

/* Counter Animation */
.stat-number {
    animation: countUp 0.8s ease-out both;
}

.stat-number[data-target] {
    opacity: 0;
}

.stat-number.counting {
    animation: countUp 0.8s ease-out both;
    opacity: 1;
}

/* Form Focus Animations */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 122, 79, 0.15);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Calculator Result Animation */
.impact-item {
    animation: scaleIn 0.4s ease-out both;
}

.impact-item:nth-child(1) {
    animation-delay: 0.1s;
}

.impact-item:nth-child(2) {
    animation-delay: 0.2s;
}

.impact-item:nth-child(3) {
    animation-delay: 0.3s;
}

.impact-item:nth-child(4) {
    animation-delay: 0.4s;
}

/* Testimonial Slide Animation */
.testimonial-card {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.testimonial-card.active {
    animation: fadeIn 0.5s ease;
}

/* 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;
    }
}

/* Loading State */
.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(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Intersection Observer Classes */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
    visibility: visible;
}
