/* Fix Vehicle Positioning and Layout Issues */

/* 1. Fix Hero Section Layout */
.hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 120px 0 0;
}

/* 2. Fix Road Animation Container */
.road-animation {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    overflow: hidden;
    z-index: 1;
    background: linear-gradient(to bottom, transparent 0%, #e2e8f0 100%);
}

/* 3. Fix Road Lines - Make them visible and properly positioned */
.road-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(
        to right,
        #94a3b8 0px,
        #94a3b8 30px,
        transparent 30px,
        transparent 60px
    );
    animation: roadMove 3s linear infinite;
}

.road-line-1 { 
    bottom: 120px; 
    background-color: #cbd5e0;
    height: 1px;
}
.road-line-2 { 
    bottom: 80px; 
    background-color: #94a3b8;
    height: 2px;
}
.road-line-3 { 
    bottom: 40px; 
    background-color: #64748b;
    height: 2px;
}

@keyframes roadMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(-60px); }
}

/* 4. Fix Vehicle Container and Positioning */
.vehicle-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    pointer-events: none;
    z-index: 2;
}

/* 5. Fix Vehicle Positioning - Keep them ON the road */
.vehicle {
    position: absolute;
    width: auto;
    animation: vehicleMove 15s linear infinite;
    opacity: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Specific vehicle positioning - FIXED to stay on road */
.sedan { 
    animation-delay: 0s; 
    bottom: 75px;  /* Positioned ON road line 2 */
    height: 40px;
}

.suv { 
    animation-delay: 5s; 
    bottom: 115px; /* Positioned ON road line 1 */
    height: 45px;
}

.sports { 
    animation-delay: 10s; 
    bottom: 35px;  /* Positioned ON road line 3 */
    height: 35px;
}

.motorcycle { 
    animation-delay: 2.5s; 
    bottom: 75px;  /* Positioned ON road line 2 */
    height: 30px;
}

.truck { 
    animation-delay: 7.5s; 
    bottom: 110px; /* Positioned ON road line 1 */
    height: 50px;
}

/* 6. Enhanced Vehicle Animation */
@keyframes vehicleMove {
    0% { 
        transform: translateX(-200px); 
        opacity: 0;
    }
    10% { 
        opacity: 0.8;
    }
    90% { 
        opacity: 0.8;
    }
    100% { 
        transform: translateX(calc(100vw + 200px)); 
        opacity: 0;
    }
}

/* 7. Fix Hero Content Positioning */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-stats {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 4rem auto 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 1000px;
}

/* 8. Fix Footer Spacing */
.footer {
    margin-top: 0;
    background: #2d3748;
    color: white;
    padding: 60px 0 30px;
    width: 100%;
}

/* Remove any extra spacing after footer */
body {
    margin: 0;
    padding: 0;
}

html {
    margin: 0;
    padding: 0;
}

/* 9. Fix Section Spacing */
section {
    margin: 0;
    padding: 80px 0;
    width: 100%;
}

section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 80px;
}

/* 10. Mobile Responsive Fixes */
@media (max-width: 768px) {
    .hero {
        padding: 100px 0 0;
        min-height: 80vh;
    }
    
    .road-animation {
        height: 120px;
    }
    
    .vehicle-container {
        height: 120px;
    }
    
    /* Mobile vehicle positioning */
    .sedan { 
        bottom: 55px;
        height: 30px;
    }
    
    .suv { 
        bottom: 85px;
        height: 35px;
    }
    
    .sports { 
        bottom: 25px;
        height: 25px;
    }
    
    .motorcycle { 
        bottom: 55px;
        height: 22px;
    }
    
    .truck { 
        bottom: 80px;
        height: 38px;
    }
    
    .road-line-1 { bottom: 90px; }
    .road-line-2 { bottom: 60px; }
    .road-line-3 { bottom: 30px; }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        padding: 1.5rem;
        margin: 2rem auto 1rem;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .road-animation {
        height: 100px;
    }
    
    .vehicle-container {
        height: 100px;
    }
    
    .road-line-1 { bottom: 75px; }
    .road-line-2 { bottom: 50px; }
    .road-line-3 { bottom: 25px; }
}

/* 11. Add Road Surface Effect */
.road-animation::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: linear-gradient(to right, 
        #64748b 0%, 
        #475569 50%, 
        #64748b 100%);
    opacity: 0.3;
}

/* 12. Vehicle Engine Sound Effect (Visual) */
.vehicle:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* 13. Performance Optimization */
.road-animation,
.vehicle-container,
.vehicle {
    will-change: transform;
    transform: translateZ(0);
}