/*==================================
=            Global               =
==================================*/

  * {
    margin: 0;
    padding: 0;
    text-decoration: none;
    list-style: none;
}

body {
    font-family: 'Jua', sans-serif;
    background: #ADD4A7;
    color: #2F3A36;
    line-height: 1.5;
}

/*==================================
=            Header               =
==================================*/

header {
    height: 150px;
    width: 100vw;
}

/*==================================
=            Navbar               =
==================================*/

.navbar {
    position: absolute;
    padding: 30px;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.navbar .nav-links {
    margin: 0 auto;
}

.navbar .nav-links ul li a {
    color: #615959;    
}

.navbar .logo-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-left: 100px;
}

.navbar .nav-links ul {
    display: flex;
}

.navbar .nav-links ul li {
    margin: 0 45px;
}

.navbar .nav-links ul li.active a {
    text-decoration: underline;
}

.navbar .menu-hamburger {
    display: none;
    position: absolute;
    top: 65px;
    right: 50px;
    width: 35px;
}

@media screen and (max-width: 1199px) {
    .navbar {
        padding: 0;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(255, 255, 255, 0.97);
        display: flex;
        justify-content: center;
        align-items: center;
        transform: translateX(-100%);
        transition: transform 0.5s ease;
        z-index: 9999;
    }

    .nav-links.mobile-menu {
        transform: translateX(0);
    }

    .nav-links ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }

    .nav-links ul li a {
        font-size: 1.3em;
        color: #615959;
        font-weight: bold;
    }

    .navbar .nav-links {
        margin: 0;
    }

    .navbar .menu-hamburger {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        width: 35px;
        cursor: pointer;
        z-index: 10000;
    }

    .navbar .nav-links ul li {
        margin: 25px 0;
        font-size: 1.2em;
    }

}

/*==================================
=         Section Recherche       =
==================================*/

.search-section {
    background: #ADD4A7;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 1rem;
    gap: 1rem;
}

.search-section h1 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #615959;
    align-self: center;
    margin-left: 25px;
}

.search-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 400px;
}

.form-group {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 1rem;
    border: none;
    border-radius: 1.5rem;
    font-size: 1rem;
}

.form-group .icon,
.form-group img {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    font-size: 1.2rem;
    width: 22px;
    height: auto;
    pointer-events: none;
}

.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 0.75rem 1rem;
    padding-right: 1rem;
    border: none;
    border-radius: 1.5rem;
    font-size: 1rem;
    /* garde la zone d’icône actif */
    appearance: none;
}

/* On rend l’indicateur natif invisible mais toujours cliquable */
.form-group input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    opacity: 0;
    cursor: pointer;
    position: absolute;
    right: 0; top: 0;
    width: 3rem;
    height: 100%;
}

/* Firefox : on laisse la zone d’icône visible, il s’affichera quand on cliquera sur le champ */
.form-group input[type="datetime-local"]::-moz-focus-inner {
    border: 0;
}

.btn {
    background: #077A13;
    color: white;
    padding: 0.75rem 2rem;
    margin-top: 2rem;
    border: none;
    border-radius: 1.5rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #065f10;
}

/*======== FILTRES ========*/

/* overlay full-page */
#filter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999; /* au-dessus du contenu */
}

/* panneau latéral */
#filter-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    height: 100%;
    background: #fff;
    transform: translateX(100%); /* caché à droite */
    box-shadow: -4px 0 16px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    z-index: 1000; /* devant l'overlay */
    display: flex;
    flex-direction: column;
}

#filter-panel header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

#filter-panel header h2 {
    margin: 0;
    font-size: 1.25rem;
}

#filter-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
}

/* contenu scrollable */
.filter-content {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

/* états “ouverts” */
#filter-panel.open {
    transform: translateX(0);
}

#filter-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    color: #2F3A36;
}

.filters img {
    width: 25px;
    height: 25px;
    margin-right: 5px;
}

/* déclencheur du panneau de filtres */
#filter-open {
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

#filter-open:hover {
    opacity: 0.8;
}

/*======== RÉSULTATS & CARTES ========*/

.results {
    display: flex;
    flex-direction: column;
    align-items: center;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 0 1rem 2rem;
}

/* carte de chaque covoiturage */
.ride-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFFFFF;
    border-radius: 1rem;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* côté gauche : avatar + infos */
.card-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    flex: 1;
    margin-left: 1rem;
}

/* avatar rond */
.avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}

/* texte à droite de l’avatar */
.details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.driver-name {
    margin: 0;
    font-size: 1.2rem;
    color: #2F3A36;
}

.rating {
    color: #77A13A;
    font-size: 1rem;
    line-height: 1;
}

.route,
.datetime {
    margin: 0;
    font-size: 0.9rem;
    color: #555555;
}

/* côté droit : infos prix, places, voiture, lien et bouton */
.card-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    margin-right: 1rem;
}

.price {
    font-size: 1rem;
    margin: 0;
    font-weight: bold;
    color: #077A13;
}

.seats,
.vehicle {
    margin: 0;
    font-size: 0.9rem;
    color: #555555;
}

.details-link {
    font-size: 0.9rem;
    color: #077A13;
    text-decoration: none;
    transition: color 0.2s;
    padding-left: 1rem;
}
.details-link:hover {
    color: #055e0e;
}

/* bouton Réserver */
.btn-reserve {
    margin-top: 0.25rem;
    padding: 0.5rem 1rem;
    background: #607744;
    color: #FFFFFF;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-reserve:hover {
    background: #055e0e;
}

/* ==================================
Adaptations mobile (<850px)
================================== */

@media (max-width: 850px) {
  /* Carte en colonne sur tout le width */
    .ride-card {
        flex-direction: column;
        padding: 1.5rem 1rem;
        box-sizing: border-box;
    }

  /* Bloc avatar+infos centré, espacement uniforme */
    .card-left {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 0;
        margin: 0;
        width: 100%;
    }

    .avatar img {
        margin-bottom: 0.5rem;
    }

  /* Détails (nom, étoiles, trajet) : colonne centrée + gap */
    .details {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .details > * {
        margin: 0;
        text-align: center;
    }

  /* Espace un peu les étoiles */
    .rating {
        display: inline-flex;
        gap: 0.25rem;
    }

  /* Bloc “prix / places / voiture” centré + gap identique */
    .card-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        margin: 1rem 0 0;
        padding: 0;
        width: 100%;
    }

    .card-right p {
        margin: 0;
        text-align: center;
    }

  /* Bouton + lien côte à côte, centrés */
    .action-row {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    .btn-reserve,
    .details-link {
        margin: 0;
    }

    .btn-reserve { order: 0; }
    .details-link { order: 1; }

}

/* ====== Style global du panneau ====== */

#filter-panel {
    width: 320px;
    background: #FFFFFF;
    border-radius: 0 0 0 8px;
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    font-size: 0.95rem;
    color: #2F3A36;
}

/* Header du volet */
#filter-panel header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #eee;
}

#filter-panel header h2 {
    font-size: 1.25rem;
    font-weight: bold;
}

#filter-close {
    font-size: 1.2rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

#filter-close:hover {
    color: #555;
}

/* Contenu défilable */
.filter-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
}

/* Bouton “écologique” */
.btn-eco {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: #E6F9E8;
    border: 2px solid #077A13;
    border-radius: 1.5rem;
    color: #077A13;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-eco:hover {
    background: #077A13;
    color: #FFF;
}

/* Chaque groupe de filtres (label + contrôle) */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Texte des labels */
.filter-group label {
    font-weight: 500;
    color: #555;
}

/* Slider générique */
.filter-group input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    outline: none;
    margin-top: 0.25rem;
}

.filter-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #077A13;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

.filter-group input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #077A13;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

/* Affichage de la valeur */
.filter-value {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.4rem;
    text-align: right;
}

/* Bouton réinitialiser */
#filter-reset {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 2px solid #077A13;
    border-radius: 1.5rem;
    background: #FFF;
    color: #077A13;
    font-weight: bold;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
    margin-top: 0.5rem;
}

#filter-reset:hover {
    background: #077A13;
    color: #FFF;
}

/* Scrollbar custom (Chrome / Edge) */
.filter-content::-webkit-scrollbar {
    width: 6px;
}

.filter-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/*==================================
=            Footer               =
==================================*/
.footer {
    background: #FFFFFF;
    padding: 2rem 1rem;
    text-align: center;
}

.footer-separator {
    width: 80%;
    height: 1px;
    background: #B7D6BF;
    border: none;
    margin: 0 auto 1.5rem;
}

.social-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.social-icons img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.footer-copy,
.footer-email {
    margin-bottom: 0.5rem;
    color: #2F3A36;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.footer-nav a {
    text-decoration: none;
    color: black;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: #065f10;
}