/* Mobile Responsive Enhancements for Modern Home Page */

/* Extra Small Devices (Portrait Phones) */
@media (max-width: 575.98px) {
    /* Hero Section Mobile */
    .hero-section {
        padding: 40px 0;
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 25px;
    }
    
    .trust-indicators {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .hero-actions {
        margin-bottom: 30px;
    }
    
    .hero-actions .btn {
        display: block;
        width: 100%;
        margin: 0 0 15px 0;
        padding: 15px;
    }
    
    /* Hide floating stats on mobile for performance */
    .floating-stats {
        display: none;
    }
    
    /* Search Section Mobile */
    .search-section {
        padding: 40px 0;
    }
    
    .search-container {
        padding: 20px 15px;
        margin: 0 10px;
    }
    
    .search-title {
        font-size: 1.8rem;
    }
    
    .search-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-group {
        min-width: auto;
    }
    
    .search-btn {
        width: 100%;
        padding: 15px;
        margin-top: 10px;
    }
    
    .quick-filters {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .quick-filter-btn {
        width: 100%;
        text-align: center;
    }
    
    /* Features Section Mobile */
    .features-section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .feature-card {
        padding: 30px 15px;
        margin-bottom: 20px;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    /* Vehicle Cards Mobile */
    .featured-vehicles {
        padding: 40px 0;
    }
    
    .vehicle-card {
        margin-bottom: 20px;
    }
    
    .vehicle-image img {
        height: 200px;
    }
    
    .vehicle-content {
        padding: 20px 15px;
    }
    
    .vehicle-specs {
        flex-direction: column;
        gap: 8px;
    }
    
    .vehicle-footer {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .vehicle-actions .btn {
        width: 100%;
    }
    
    /* Testimonials Mobile */
    .testimonials-section {
        padding: 40px 0;
    }
    
    .testimonial-card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .testimonial-author {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    /* CTA Section Mobile */
    .cta-section {
        padding: 40px 0;
    }
    
    .cta-title {
        font-size: 1.8rem;
    }
    
    .cta-actions .btn {
        display: block;
        width: 100%;
        margin: 0 0 15px 0;
    }
    
    /* Navigation Mobile Improvements */
    .navbar-brand img {
        height: 35px;
    }
    
    .navbar-toggler {
        border: none;
        padding: 8px;
    }
    
    .navbar-collapse {
        margin-top: 15px;
        border-top: 1px solid #e9ecef;
        padding-top: 15px;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 0;
        font-size: 16px;
    }
}

/* Small Devices (Landscape Phones) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-title {
        font-size: 2.8rem;
    }
    
    .search-row {
        flex-wrap: wrap;
    }
    
    .search-group {
        flex: 1 1 calc(50% - 10px);
        min-width: calc(50% - 10px);
    }
    
    .vehicle-specs {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .spec-item {
        flex: 1 1 50%;
    }
}

/* Medium Devices (Tablets) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .floating-stats .stat-card {
        transform: scale(0.9);
    }
    
    .search-group {
        flex: 1 1 calc(33.333% - 15px);
        min-width: 200px;
    }
    
    .vehicle-image img {
        height: 220px;
    }
}

/* Large Devices (Desktops) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .hero-title {
        font-size: 3.2rem;
    }
    
    .container {
        max-width: 960px;
    }
}

/* Touch Device Optimizations */
@media (pointer: coarse) {
    .btn {
        min-height: 44px; /* Apple's recommended touch target size */
        min-width: 44px;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
    }
    
    .quick-filter-btn {
        min-height: 44px;
        padding: 10px 20px;
    }
    
    /* Larger touch targets for mobile */
    .vehicle-overlay .btn,
    .vehicle-actions .btn {
        min-height: 48px;
        padding: 12px 24px;
    }
}

/* Landscape Orientation Adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: auto;
        padding: 20px 0;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    
    .trust-indicators {
        flex-direction: row;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .hero-actions {
        margin-bottom: 20px;
    }
    
    .floating-stats {
        display: none;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image img,
    .vehicle-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    .floating-stats .stat-card,
    .vehicle-card,
    .feature-card,
    .btn {
        animation: none !important;
        transition: none !important;
    }
    
    .hero-image img {
        transform: none !important;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
@media (max-width: 768px) {
    /* Disable expensive effects on mobile */
    .vehicle-card:hover,
    .feature-card:hover {
        transform: none;
        box-shadow: var(--shadow-light);
    }
    
    /* Simplify animations */
    .animate-float,
    .animate-pulse {
        animation: none;
    }
    
    /* Optimize images */
    .hero-image img,
    .vehicle-image img {
        image-rendering: optimizeSpeed;
    }
}

/* Ultra-wide Screens */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Print Styles */
@media print {
    .hero-section,
    .search-section,
    .testimonials-section,
    .cta-section {
        page-break-inside: avoid;
    }
    
    .floating-stats,
    .search-container,
    .btn,
    .testimonial-card,
    .cta-actions {
        display: none !important;
    }
    
    .vehicle-card {
        break-inside: avoid;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
    
    .hero-title,
    .section-title {
        color: #000 !important;
    }
}

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .form-control,
    .form-select {
        border: 2px solid currentColor;
    }
    
    .vehicle-card,
    .feature-card,
    .testimonial-card {
        border: 2px solid currentColor;
    }
}

/* Focus Visible Support */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mobile Menu Enhancements */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1050;
        padding: 20px;
        overflow-y: auto;
    }
    
    .navbar-collapse.show {
        right: 0;
    }
    
    .mobile-menu-open {
        overflow: hidden;
    }
    
    .mobile-menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
}
