/* ===================================
   Animation Keyframes
   =================================== */

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

@keyframes fadeInUp {
    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 pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* ===================================
   Page Load Animations
   =================================== */

.hero-section {
    animation: fadeIn 1s ease-in-out;
}

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

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

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

.emergency-banner {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

/* ===================================
   Service Cards Animation
   =================================== */

.service-card {
    animation: fadeInUp 0.6s ease-out both;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }
.service-card:nth-child(7) { animation-delay: 0.7s; }
.service-card:nth-child(8) { animation-delay: 0.8s; }

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

.service-card:hover .service-icon {
    transform: rotateY(360deg);
}

/* ===================================
   Feature Items Animation
   =================================== */

.feature-item {
    animation: slideInLeft 0.6s ease-out both;
}

.feature-item:nth-child(odd) {
    animation-name: slideInLeft;
}

.feature-item:nth-child(even) {
    animation-name: slideInRight;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }
.feature-item:nth-child(4) { animation-delay: 0.4s; }
.feature-item:nth-child(5) { animation-delay: 0.5s; }
.feature-item:nth-child(6) { animation-delay: 0.6s; }

/* ===================================
   Testimonial Cards Animation
   =================================== */

.testimonial-card {
    animation: fadeInUp 0.6s ease-out both;
}

.testimonial-card:nth-child(1) { animation-delay: 0.2s; }
.testimonial-card:nth-child(2) { animation-delay: 0.4s; }
.testimonial-card:nth-child(3) { animation-delay: 0.6s; }

/* ===================================
   Button Hover Effects
   =================================== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ===================================
   Form Focus Animations
   =================================== */

.form-group input,
.form-group select,
.form-group textarea {
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    transform: scale(1.02);
}

/* ===================================
   Navigation Link Hover Effect
   =================================== */

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

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

.nav-phone::after {
    display: none;
}

/* ===================================
   Loading Spinner for Form Submit
   =================================== */

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

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ===================================
   Scroll Animations (Applied via JavaScript)
   =================================== */

.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===================================
   Emergency Banner Pulse Effect
   =================================== */

.emergency-banner i {
    animation: pulse 2s ease-in-out infinite;
}

/* ===================================
   Contact Info Icons Hover
   =================================== */

.contact-item i {
    transition: all 0.3s ease;
}

.contact-item:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* ===================================
   Footer Social Links Hover
   =================================== */

.social-links a {
    transition: all 0.3s ease;
}

.social-links a:hover {
    animation: bounce 0.5s ease;
}