/* Global Styles */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Card Styles */
.car-card {
    transition: transform 0.2s;
    height: 100%;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.car-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.car-card .card-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    min-height: 2.8rem;
}

.car-card .price {
    font-size: 1.05rem !important;
    font-weight: bold;
    color: var(--primary-color);
}

/* Search Form */
.search-form {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-form .form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Listing Details */
.listing-gallery img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 10px;
}

.listing-thumbnails img {
    width: 100px;
    height: 75px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
    transition: opacity 0.2s;
}

.listing-thumbnails img:hover {
    opacity: 0.8;
}

/* User Dashboard */
.dashboard-stat {
    padding: 1.5rem;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-stat .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Loading States */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8) url('/assets/img/loading.gif') center no-repeat;
    z-index: 1000;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .car-card .card-img-top {
        height: 150px;
    }

    .listing-gallery img {
        height: 300px;
    }

    .listing-thumbnails img {
        width: 80px;
        height: 60px;
    }

    .dashboard-stat {
        margin-bottom: 1rem;
    }
}

/* Grid/List View Toggle */
.view-toggle .btn {
    padding: 0.5rem 1rem;
}

.view-toggle .btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* List View Styles */
.list-view .car-card {
    flex-direction: row;
    align-items: center;
}

.list-view .car-card .card-img-top {
    width: 200px;
    height: 150px;
}

.list-view .car-card .card-body {
    padding: 1rem 1.5rem;
}

/* Price Range Slider */
.price-slider {
    padding: 1rem 0;
}

.price-slider .slider-value {
    font-weight: bold;
    color: var(--primary-color);
}

/* Custom Checkboxes and Radios */
.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

/* Favorites Button */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.favorite-btn:hover {
    transform: scale(1.1);
}

.favorite-btn.active {
    color: var(--danger-color);
}

/* Image Upload Preview */
.image-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed #ccc;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px;
    position: relative;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.image-preview .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    padding: 5px;
    cursor: pointer;
}

/* Custom Select Styles */
.custom-select {
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.custom-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .listing-details {
        break-inside: avoid;
    }
} 