/* Browse page specific styles */

.browse-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dc2626;
}

.filters-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.filters-header h2 {
    font-size: 1.25rem;
    color: #dc2626;
    margin: 0;
}

.clear-filters-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-filters-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
}

.mobile-close-filters-btn {
    display: none;
    background: #dc2626;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-close-filters-btn:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.filter-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

/* Search */
.search-container {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #dc2626;
}

.search-btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
}

/* Location & Distance */
.location-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.3s ease;
}

.location-input:focus {
    outline: none;
    border-color: #dc2626;
}

.use-my-location-btn {
    background: transparent;
    border: 1px solid #dc2626;
    color: #dc2626;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.use-my-location-btn:hover {
    background: #dc2626;
    color: white;
}

.distance-slider {
    width: 100%;
    margin: 0.5rem 0;
}

.distance-value {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

/* Price Range */
.price-range {
    position: relative;
    margin: 1rem 0;
}

.price-slider {
    width: 100%;
    margin: 0.25rem 0;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #dc2626;
    border-radius: 50%;
    cursor: pointer;
}

.price-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #dc2626;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.price-display {
    text-align: center;
    font-weight: 600;
    color: #dc2626;
    margin: 1rem 0;
}

.price-presets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.price-preset {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.price-preset:hover,
.price-preset.active {
    border-color: #dc2626;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    padding: 0.25rem 0;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 0.5rem;
    accent-color: #dc2626;
}

/* Advanced Search Button */
.advanced-search-btn {
    width: 100%;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    color: white;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.advanced-search-btn:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #dc2626;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #dc2626;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.modal-body {
    padding: 2rem;
}

.modal-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.modal-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.btn-secondary {
    background: transparent;
    border: 2px solid #ddd;
    color: #666;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #dc2626;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Price Input Styles */
.price-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.price-input:focus {
    outline: none;
    border-color: #dc2626;
}

.price-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.distance-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.distance-select:focus {
    outline: none;
    border-color: #dc2626;
}

/* Sort Select */
.sort-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: #dc2626;
}

/* Main Content */
.cars-content {
    min-height: 100vh;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.display-amount-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.display-amount-control label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.display-amount-select {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.display-amount-select:hover {
    border-color: #dc2626;
}

.display-amount-select:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.results-info h2 {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.results-count {
    color: #666;
    font-size: 1rem;
}

.mobile-filters-btn {
    display: none;
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* Active Filters */
.active-filters {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-tag {
    background: #dc2626;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-tag-remove:hover {
    background: rgba(255,255,255,0.2);
}

/* Cars Grid */
.cars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.car-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-color: #dc2626;
}

.car-image {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.car-photo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.car-card:hover .car-photo {
    transform: scale(1.05);
}

.image-placeholder {
    font-size: 4rem;
    opacity: 0.6;
}

.car-badges {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.badge {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge.featured {
    background: #dc2626;
}

.badge.beginner-friendly {
    background: #10b981;
}

.badge.high-performance {
    background: #f59e0b;
}

.badge.exotic {
    background: #8b5cf6;
}

.badge.experts-only {
    background: #ef4444;
}

.badge.spec-series {
    background: #3b82f6;
}

.badge.awd {
    background: #059669;
}

.badge.american-muscle {
    background: #dc2626;
}

.badge.service-type {
    font-size: 0.65rem;
    padding: 0.2rem 0.6rem;
}

.badge.service-type.car-rental {
    background: #3b82f6;
}

.badge.service-type.arrive-drive {
    background: #10b981;
}

.badge.service-type.race-seat {
    background: #f59e0b;
}

.car-info {
    padding: 1.5rem;
}

.car-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
}

.car-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.car-specs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.spec {
    background: #f8f9fa;
    color: #666;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.car-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.car-details {
    margin-bottom: 1.5rem;
}

.car-details > div {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #dc2626;
}

.contact-owner-btn,
.view-details-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
}

.contact-owner-btn:hover,
.view-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Load More */
.load-more-container {
    text-align: center;
}

.load-more-btn {
    background: transparent;
    border: 2px solid #dc2626;
    color: #dc2626;
    padding: 1rem 3rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background: #dc2626;
    color: white;
    transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .browse-container {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .filters-sidebar {
        padding: 1rem;
    }
    
    .cars-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

/* Mobile overlay backdrop */
.mobile-filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filters-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .browse-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        z-index: 1000;
        overflow-y: auto;
        transition: left 0.3s ease;
        border-radius: 0;
        padding-top: 1rem;
    }
    
    .filters-sidebar.mobile-open {
        left: 0;
        box-shadow: 0 0 20px rgba(0,0,0,0.3);
    }
    
    .mobile-filters-btn {
        display: block;
    }
    
    .mobile-close-filters-btn {
        display: flex;
    }
    
    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .content-controls {
        justify-content: space-between;
    }
    
    .display-amount-control {
        order: -1;
    }
    
    .cars-grid {
        grid-template-columns: 1fr;
    }
    
    .car-card {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .filters-sidebar {
        width: 100%;
    }
    
    .car-specs {
        justify-content: center;
    }
    
    .car-tags {
        justify-content: center;
    }
    
    .price-presets {
        grid-template-columns: 1fr;
    }
}