/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #111;
    color: #fff;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header */
header {
    background-color: #222;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    width: auto;
}

h1 {
    color: #f60;
    font-size: 2rem;
    font-weight: bold;
}

/* Contenu principal */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Filtres */
.filters {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    color: #f60;
    font-weight: 600;
    font-size: 1rem;
}

.filter-group select {
    background-color: #333;
    color: #fff;
    border: 2px solid #555;
    border-radius: 5px;
    padding: 0.75rem;
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-group select:hover {
    border-color: #f60;
}

.filter-group select:focus {
    outline: none;
    border-color: #f60;
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
}

.filter-group select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Résultats */
.results-container {
    background-color: #222;
    border-radius: 10px;
    padding: 2rem;
    margin-top: 2rem;
}

.car-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #333;
}

.brand-logo {
    height: 60px;
    width: auto;
    border-radius: 5px;
}

.car-info h2 {
    color: #f60;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.car-info h3 {
    color: #ccc;
    font-size: 1.2rem;
    font-weight: normal;
}

/* Description */
.description {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #333;
    border-radius: 5px;
    border-left: 4px solid #f60;
}

.description p {
    margin-bottom: 0.5rem;
}

.description strong {
    color: #f60;
}

/* Galerie photos */
.photo-gallery {
    margin: 1.5rem 0;
}

.photo-gallery h4 {
    color: #f60;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.photos {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.photos img {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 2px solid #555;
}

.photos img:hover {
    transform: scale(1.05);
    border-color: #f60;
}

/* Lien vers la fiche complète */
.complete-link {
    margin: 1.5rem 0;
    text-align: center;
}

.complete-link a {
    color: #f60;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid #f60;
    border-radius: 5px;
    display: inline-block;
    transition: all 0.3s ease;
}

.complete-link a:hover {
    background-color: #f60;
    color: #111;
}

/* Moteurs */
.engines {
    margin-top: 2rem;
}

.engines h4 {
    color: #f60;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.engine-card {
    background-color: #333;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #f60;
}

.engine-name {
    color: #f60;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.specs-section {
    margin-bottom: 1rem;
}

.specs-section h5 {
    color: #f60;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.25rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.spec-label {
    color: #ccc;
    font-weight: 500;
}

.spec-value {
    color: #fff;
    font-weight: 600;
}

/* Messages d'état */
.loading, .error {
    text-align: center;
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 5px;
}

.loading {
    background-color: #333;
    color: #f60;
}

.error {
    background-color: #500;
    color: #fff;
    border: 1px solid #800;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .filters {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group select {
        min-width: 100%;
    }

    .car-header {
        flex-direction: column;
        text-align: center;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    .photos {
        justify-content: center;
    }

    .photos img {
        max-width: 150px;
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .results-container {
        padding: 1rem;
    }

    .photos img {
        max-width: 120px;
        max-height: 120px;
    }
}