/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

/* Défilement fluide */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f5f6fa;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ---- HEADER + NAVIGATION ---- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #2c3e50;
    padding: 15px 30px;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

#contact{
    color:#fff;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    display: flex;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}

.logo h1 {
    color: white;
    font-size: 24px;
}

/* Navigation */
nav ul {
    display: flex;
    gap: 20px;
    list-style: none;
    user-select: none;
}

nav ul li a {
    font-weight: bold;
    text-decoration: none;
    color: white;
    font-size: 18px;
    padding: 10px 15px;
    transition: background 0.3s, color 0.3s;
    border-radius: 5px;
}

/* Effet au survol */
nav ul li a:hover {
    background: #ff9f1c;
    color: #333;
}

/* Bouton "Connexion" */
nav ul li .connexion, .deconnexion {
    background: #e76f51;
    border-radius: 5px;
}

nav ul li .connexion:hover {
    background: #ff9f1c;
}

/* Ajoute un espace sous le header pour éviter que le contenu soit caché */
.spacer {
    height: 80px;
}

/* ---- SECTIONS ---- */
main {
    padding: 20px;
    text-align: center;
}

h2, h3, h4 {
    margin: 10px 0;
    color: #2c3e50;
}

/* Section véhicules */
.vehicules {
    margin: 20px auto;
    padding: 20px;
    max-width: 900px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
}

/* Conteneur des images */
.vehicules .images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* Images des véhicules */
.vehicules img {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
}

.vehicules img:hover {
    transform: scale(1.1);
}

/* ---- FOOTER ---- */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 10px;
    text-align: center;
}

/* ---- FORMULAIRES ---- */
.form-container {
    width: 350px;
    margin: 20px auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.form-container label {
    display: block;
    font-weight: bold;
    margin-top: 10px;
}

.form-container input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* Lien "Mot de passe oublié" */
.forgot-password {
    text-align: right;
    margin: 10px 0;
}

.forgot-password a {
    color: #007bff;
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}



/* Centrer les boutons dans la section des véhicules */
.voiture-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-direction: column; /* Permet d'empiler les images et le bouton */
}

/* Aligner les boutons sous les voitures */
.voiture-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap; /* Évite les problèmes sur petits écrans */
}

/* Conteneur des voitures */
.voiture-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

/* Liste des voitures */
.voiture-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 0;
    list-style: none;
    min-width: 250px; /* Empêche les colonnes de se réduire trop */
}


/* Élément voiture */
.voiture-item {
    flex: 1 1 calc(33.333% - 20px);
    max-width: 250px;
    text-align: center;
    list-style: none;
}

/* Images des voitures BDD */
.voiture-item img {
    width: 100%;
    max-width: 350px; /* Taille maximale */
    min-width: 250px; /* Taille minimale pour éviter qu'elles rapetissent trop */
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
}


.voiture-item img:hover {
    transform: scale(1.1);
}

.images {
    list-style: none; /* Supprime les puces des listes */
    padding: 0;
}

/* Styles communs pour les boutons "Voir plus" et "Voir moins" */
.voir-plus-btn, .voir-moins-btn {
    width: 100%; /* Taille uniforme */
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
}

/* Couleurs spécifiques */
.voir-plus-btn {
    background: #007bff;
    color: white;
    border: none;
}

.voir-plus-btn:hover {
    background: #0056b3;
}

.voir-moins-btn {
    background: red;
    color: white;
    border: none;
}

.voir-moins-btn:hover {
    background: darkred;
}

.no-voitures {
    font-style: italic;
    color: #555;
    text-align: center;
    margin: 10px 0;
}

/* -------------- RESPONSIVE DESIGN -------------- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .vehicules .images {
        flex-direction: column;
        align-items: center;
    }

    /* Affichage des voitures en grille ajustée sur petits écrans */
    .voiture-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Grille pour petits écrans */
        gap: 20px;
        justify-items: center;
        padding: 0;
        list-style: none;
    }

    /* Réduire la taille des images pour les petits écrans */
    .voiture-item img {
        width: 100%;
        max-width: 250px; /* Ajuster la taille max des images */
        height: auto;
    }

    /* Pour la section contenant le bouton "Voir plus", assure-toi que les images s'affichent verticalement */
    .voiture-container {
        align-items: center; /* Centre les éléments */
    }

    .voiture-buttons {
        flex-direction: column; /* Empile les boutons en vertical */
        align-items: center;
    }

    #voir-plus-btn, #voir-moins-btn {
        width: 150px; /* Assurer la même taille */
    }

    /* Ajuster la taille du bouton "Voir plus" sur petits écrans */
    #voir-plus-btn {
        align-items: center;
        width: auto;
        padding: 10px 20px;
        font-size: 16px;
    }

    #voir-moins-btn {
        align-items: center;
        width: auto;
        padding: 10px 20px;
        font-size: 16px;
    }
}
