/* ============================================
   HOME PAGE - MODERN STYLES
   ============================================ */

:root {
    --primary-color: #2061a8;
    --primary-hover: #1a4f8a;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --box-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --box-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --box-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.2);
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --grid-gap: 1.5rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-title {
    padding-bottom: 0.75rem;
    margin-bottom: var(--spacing-lg);
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.hero-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    transition: width var(--transition-speed) ease;
}

.hero-title:hover::after {
    width: 100%;
}

.h1link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.h1link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* ============================================
   VEHICLE CARDS GRID
   ============================================ */
.vehicles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--grid-gap);
    margin-top: var(--spacing-md);
}

@media (max-width: 768px) {
    .vehicles-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--spacing-sm);
    }
}

.vehicle-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: var(--spacing-sm);
    text-align: center;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--box-shadow-sm);
    text-decoration: none;
    color: #333;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--box-shadow-hover);
    text-decoration: none;
    color: var(--primary-color);
}

.vehicle-card picture {
    display: block;
    margin-bottom: var(--spacing-xs);
}

.vehicle-card .imga {
    width: 100%;
    height: auto;
    aspect-ratio: 2/1;
    object-fit: cover;
    border-radius: calc(var(--border-radius) - 2px);
    box-shadow: var(--box-shadow-sm);
    transition: transform var(--transition-speed) ease;
}

.vehicle-card:hover .imga {
    transform: scale(1.05);
}

.vehicle-title {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: var(--spacing-xs);
    line-height: 1.3;
}

/* ============================================
   SEARCH SIDEBAR
   ============================================ */
.search-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--box-shadow-sm);
    margin-bottom: var(--spacing-md);
}

.search-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-speed) ease;
}

.search-header:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-hover);
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform var(--transition-speed) ease;
}

.search-header:hover .search-icon {
    transform: scale(1.1);
}

.search-form {
    display: block;
    animation: slideDown var(--transition-speed) ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-form.hidden {
    display: none;
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.25rem;
}

.search-input {
    width: 100%;
    padding: 0.625rem;
    border: 2px solid #ddd;
    border-radius: calc(var(--border-radius) - 2px);
    font-size: 0.9375rem;
    transition: all var(--transition-speed) ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(32, 97, 168, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.btn-search {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: calc(var(--border-radius) - 2px);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    margin-top: var(--spacing-sm);
    box-shadow: var(--box-shadow-sm);
}

.btn-search:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

.btn-search:active {
    transform: translateY(0);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.home-layout {
    display: grid;
    grid-template-columns: 160px 1fr 300px;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

@media (max-width: 992px) {
    .home-layout {
        grid-template-columns: 1fr;
    }
    
    .home-layout .sidel,
    .home-layout .sider {
        display: none;
    }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .home-layout {
        grid-template-columns: 1fr 300px;
    }
    
    .home-layout .sidel {
        display: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.vehicle-card:focus,
.search-input:focus,
.btn-search:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */
.vehicle-card picture img {
    content-visibility: auto;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
