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

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

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: 'Jua', sans-serif;
    background: #ADD4A7;
    color: #2F3A36;
    line-height: 1.5;
}


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

header {
    position: relative;
    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;
    justify-content: center;
}

.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;
    }

}

/* ============================
Layout: Main / Sidebar
============================ */

main.profile-page {
  display: flex;
  flex: 1;
  max-width: 1000px;
  margin: 2rem auto 3rem;
  padding: 0 2rem;
  padding-bottom: 5rem;
}

/* — Sidebar */
.sidebar {
  flex: 1;
  max-width: 260px;
  padding-right: 3rem;
}

.user-widget {
  text-align: center;
  margin-bottom: 2rem;
}

.user-icon {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
  border-radius: 50%;
}

.greeting p {
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

.greeting h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.greeting strong,
.greeting em {
  color: #2F3A36;
}

/* Sidebar buttons */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-aside {
  background: #607744;
  color: #FFFFFF;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-aside:hover {
  background: #5a6629;
}

.btn-aside.active {
  color: #000000;
}

/* ============================
Profile informations
============================ */

.tab-content {
  flex: 2;
  background: #93C798;
  border-radius: 1.5rem;
  padding: 3rem 2rem 4rem;
  padding-bottom: 4rem;
}

.tab-content {
  display: none;
}

#tab-info {
  padding-bottom: 4rem;
}

.tab-content.active {
  display: block;
}

.tab-content h1 {
  font-size: 2.5rem;
  color: #615959;
  text-align: center;
  margin-bottom: 3rem;
}

/* Form rows */
.profile-form .form-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.profile-form .form-group {
  flex: 1;
}

.profile-form .form-group label {
  display: block;
  text-decoration: underline;
  text-align: center;
  margin-bottom: 0.75rem;
  color: #2F3A36;
}


.profile-form .form-group input[type="email"],
.profile-form .form-group input[type="text"],
.profile-form .form-group input[type="file"] {
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 2rem;
  background: #FFFFFF;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #615959;
}

.profile-form .form-group input[type="tel"],
.profile-form .form-group input[type="date"] {
  width: 100%;
  border-radius: 2rem;
  background: #FFFFFF;
  color: #615959;
  font-size: 1rem;
  border: none;
  outline: none;
  padding: 0.6rem 1rem;
}

.profile-form .form-group small {
  display: block;
  font-size: 0.8rem;
  color: #615959;
  text-align: center;
  margin-top: 0.25rem;
}

.profile-form .form-group input {
  padding: 0.6rem 1rem;
  height: 2.4rem;
}



/* Password-reset button */
.btn-reset-password {
  display: block;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  border: 1px solid #607744;
  border-radius: 2rem;
  background: transparent;
  color: #2F3A36;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-reset-password:hover {
  background: #607744;
  color: #FFFFFF;
}

/* Personal Info fieldset */
.personal-info {
  border: none;
  margin-bottom: 3rem;
}

.personal-info legend {
  font-size: 1.8rem;
  text-decoration: underline;
  display: block;
  margin: 0 auto 2.5rem;
  color: #615959;
  text-align: center;
}

.personal-info .form-row {
  margin-bottom: 1.5rem;
}

.personal-info .form-row:last-child {
  flex-direction: row;
  justify-content: space-between;
  gap: 3rem;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

/* ============================
Form Actions
============================ */

.form-actions {
  text-align: center;
  margin-top: 2rem;
}

.btn-save {
  background: #607744;
  color: #FFFFFF;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 1rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-save:hover {
  background: #5a6629;
}

/* ============================
Profil chauffeur
============================ */

/* Conteneur général de l’onglet Chauffeur */
#tab-driver.tab-content {
  background: #93C798;
  border-radius: 1.5rem;
  padding: 3rem 2rem 5.4rem;
  box-sizing: border-box;
  display: none; /* caché par défaut */
}

/* Lorsque la classe active est ajoutée */
#tab-driver.tab-content.active {
  display: block;
}

/* Titre principal « Chauffeur » */
#tab-driver h1 {
  font-family: 'Jua', sans-serif;
  font-size: 2.5rem;
  color: #615959;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Chaque bloc (Véhicules, Préférences, Statut) */
#tab-driver .tab-block {
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Sous-titres de bloc */
#tab-driver .tab-block h2 {
  font-family: 'Jua', sans-serif;
  font-size: 1.3rem;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: #2F3A36;
  margin-bottom: 2rem;
  margin-top: 1.5rem;
}

/* Boutons « Ajouter… » */
#tab-driver .btn-secondary {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: #2F3A36;
  background: transparent;
  border: 1px solid #607744;
  border-radius: 2rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#tab-driver .btn-secondary:hover {
  background: #607744;
  color: #FFF;
}

/* Texte de statut */
#tab-driver .status-text {
  font-size: 0.85rem;
  color: #615959;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

#tab-driver .status-text strong {
  color: #2F3A36;
}

/* Container switch + label */
#tab-driver .preferences {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

#tab-driver .preferences span {
  color: #615959;
}

/*  wrapper empile en colonne */
#tab-driver .tab-preferences {
  display: flex;
  flex-direction: column;
  align-items: center;  
  gap: 1rem;          
  margin-bottom: 1.5rem;
}

#tab-driver .tab-preferences h2 {
  margin-bottom: 0.5rem;
}

/* Chaque paire slider+label en row */
#tab-driver .tab-preferences .preferences {
  display: flex;
  flex-direction: row;  
  align-items: center;
  gap: 0.75rem;               
}

/* bouton “Ajouter…” sur sa propre ligne */
#tab-driver .tab-preferences .btn-secondary {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

/* Le toggle (switch) */
.toggle {
  position: relative;
  width: 40px;
  height: 20px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  border-radius: 1rem;
  transition: background-color 0.3s;
}

.toggle .slider:before {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  left: 2px; bottom: 2px;
  background: #FFF;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle input:checked + .slider {
  background-color: #607744;
}

.toggle input:checked + .slider:before {
  transform: translateX(20px);
}

/* Bouton Enregistrer */
#tab-driver .btn-save {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  color: #FFF;
  background: #607744;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  transition: background 0.2s;
}

#tab-driver .btn-save:hover {
  background: #5A6629;
}


/* ============================
Onglet “Publiez un trajet”
============================ */

/* Conteneur de l’onglet */
#tab-publish.tab-content {
  flex: 2;
  background: #93C798;
  border-radius: 1.5rem;
  padding: 3rem 2rem 4rem;
  box-sizing: border-box;
  display: none; /* caché par défaut */
}

#tab-publish.tab-content.active {
  display: block;
}

/* Titre principal */
#tab-publish h1 {
  font-family: 'Jua', sans-serif;
  font-size: 2.5rem;
  color: #615959;
  text-align: center;
  margin-bottom: 3rem;
}

/* Layout des lignes de formulaire */
#tab-publish .form-row {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 4em;
}

/* Chaque champ */
#tab-publish .form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Label centré et souligné */
#tab-publish .form-group label {
  text-decoration: underline;
  text-align: center;
  color: #2F3A36;
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

/* Inputs & selects */
#tab-publish .form-group input[type="text"],
#tab-publish .form-group input[type="datetime-local"],
#tab-publish .form-group input[type="number"],
#tab-publish .form-group select {
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 2rem;
  background: #FFFFFF;
  font-size: 1rem;
  color: #615959;
  box-sizing: border-box;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23615959' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.75rem;
}

/* Pour que datetime-local garde le même style */
#tab-publish input[type="datetime-local"] {
  padding-right: 1rem;
}

/* Texte d’information sur les crédits */
#tab-publish .info-text {
  text-align: center;
  font-size: 0.85rem;
  color: #000000;
  margin: 1rem 0 2rem;
}

/* Bouton de soumission */
#tab-publish .form-actions {
  text-align: center;
  margin-top: 1.5rem;
}

#tab-publish .form-actions .btn-secondary {
  padding: 0.75rem 2rem;
  margin-bottom: 0;
  background: #607744;
  color: #FFF;
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

#tab-publish .form-actions .btn-secondary:hover {
  background: #5a6629;
}

/* ============================
Onglet “Historique des trajets”
============================ */

#tab-history.tab-content {
  background: #93C798;
  border-radius: 1.5rem;
  padding: 3rem 2rem 4rem;
  box-sizing: border-box;
}

/* Titre principal */
#tab-history h1 {
  font-family: 'Jua', sans-serif;
  font-size: 2.5rem;
  color: #615959;
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Texte quand aucun trajet */
#tab-history .empty-history {
  text-align: center;
  color: #615959;
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Tableau de l’historique */
#tab-history .history-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
}

#tab-history .history-table thead th {
  border-bottom: 2px solid #607744;
  padding: 0.75rem 1rem;
  text-align: left;
  color: #2F3A36;
  font-size: 1rem;
}

#tab-history .history-table tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.3);
}

#tab-history .history-table tbody td {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding: 0.75rem 1rem;
  color: #2F3A36;
  font-size: 0.95rem;
}

/* Boutons d’action (Voir, Annuler) */
#tab-history .btn-secondary.btn-secondary {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 1.5rem;
  margin-right: 0.5rem;
}

#tab-history .btn-secondary.btn-secondary.cancel {
  border-color: #D64545;
  color: #D64545;
}

#tab-history .btn-secondary.btn-secondary.cancel:hover {
  background: #D64545;
  color: #FFF;
}

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

footer .footer {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

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

.social-icons img {
    width: 24px;
    height: 24px;
}

.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: #077A13;
    font-weight: bold;
    transition: color 0.3s;
}

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

  /* ----------------------------
Fenêtre modale
----------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0; 
  background: rgba(0,0,0,0.4);
  display: none; /* cachée par défaut */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #93C798;
  border-radius: 1.5rem;
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  box-sizing: border-box;
  position: relative;
}

/* Croix de fermeture */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #615959;
}

/* Titres */
.modal-content h2 {
  font-family: 'Jua', sans-serif;
  font-size: 1.8rem;
  color: #615959;
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Disposition des champs */
.modal-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-row input[type="text"] {
  flex: 1;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 2rem;
  background: #FFFFFF;
  color: #615959;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Le petit bouton + */
.modal-row .btn-secondary {
  width: 3rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-row select {
  flex: 1;
  padding: 0.6rem 2rem 0.6rem 1rem;
  border: none;
  border-radius: 2rem;
  background: #FFFFFF;
  color: #615959;
  font-size: 1rem;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath fill='%23615959' d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 0.75rem;
}

/* Bouton Enregistrer */
.modal-actions {
  text-align: center;
  margin-top: 1.5rem;
}

.modal-actions .btn-save {
  width: 50%;
  max-width: 200px;
  margin: 0 auto;
}

/* =========== Style commun aux champs de la modale “Ajouter un véhicule” =========== */
#vehicle-modal .modal-content select,
#vehicle-modal .modal-content input[type="text"],
#vehicle-modal .modal-content input[type="date"] {
  width: 50%;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 2rem;
  background: #FFFFFF;
  font-size: 1rem;
  color: #615959;
  box-sizing: border-box;
  margin-bottom: 0;
}

/* petit espace entre les deux champs de chaque .modal-row */
#vehicle-modal .modal-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* la date et l’immatriculation à la même hauteur */
#vehicle-modal .modal-content input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

#vehicle-modal .modal-content select:focus,
#vehicle-modal .modal-content input:focus {
  outline: 2px solid #607744;
}

@media (max-width: 810px) {

    /*  La sidebar passe au-dessus du contenu et s’étire */
  .sidebar {
    max-width: none;
    padding: 1.5rem 0;
    order: 1;
  }

  .sidebar-nav {
    gap: 0.75rem;
  }

  .btn-aside {
    width: 50%;
    margin: 0 auto;
  }

  /* passe tout en display:block */
  #tab-history .history-table,
  #tab-history .history-table thead,
  #tab-history .history-table tbody,
  #tab-history .history-table th,
  #tab-history .history-table td,
  #tab-history .history-table tr {
    display: block;
  }

  /* On masque l’en‐tête */
  #tab-history .history-table thead {
    display: none;
  }

  /* Chaque ligne devient une “carte” */
  #tab-history .history-table tr {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 0.5rem;
  }

  /* Chaque cellule s’affiche en flex pour label+valeur */
  #tab-history .history-table td {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }

  /* On injecte le label avant la valeur, depuis l’attribut data-label */
  #tab-history .history-table td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #2F3A36;
    width: 40%;
    flex-shrink: 0;
  }

  /* Actions (boutons) passent en ligne séparée */
  #tab-history .history-table td.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  #tab-history .history-table td.actions .btn-secondary {
    margin: 0;
  }

  /* Centrage du message “empty-history” */
  #tab-history .empty-history {
    margin: 2rem 1rem;
  }

  main.profile-page {
    flex-direction: column;
    padding: 0 1rem;
  }

  /*  Le contenu de profil prend tout l’espace */
  .tab-content.active {
    order: 2;
    margin-top: 1.5rem;
    padding: 2rem 1rem;
  }

  /*  Tous les form-rows deviennent verticaux */
  .profile-form .form-row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  /*  Chaque champ occupe 100 % de la largeur de son groupe */
  .profile-form .form-group {
    width: 50%;
    margin: 0 auto 1.5rem;
  }
  
  .profile-form .form-group input,
  .profile-form .form-group button {
    width: 50%;
    box-sizing: border-box;
  }

  .profile-form .form-group input[type="date"] {
    width: 50%;
  }

    .profile-form .form-group input[type="tel"] {
    width: 100%;
  }

  /*  Le fieldset “Informations personnelles” aussi */
  .personal-info .form-row {
    flex-direction: column;
    gap: 1.5rem;
  }

  /*  Recentrage du titre et légende */
  .profile-content h1,
  .profile-form label,
  .personal-info legend {
    text-align: center;
  }

  /*  Recentrage du bouton “Réinitialisation” */
  .btn-reset-password {
    display: block;
    margin: 0 auto;
  }

  /*  Recentrage de la zone d’actions */
  .form-actions {
    margin-top: 2rem;
  }

    /* cible la ligne qui ne contient que le datepicker */
  .profile-form .form-row:last-child {
    /* garde le comportement vertical */
    display: flex;
    flex-direction: column;
    align-items: center;   
    gap: 1rem;
  }

  /* fixe la largeur du container et on l’aligne */
  .profile-form .form-row:last-child .form-group {
    width: 50%;
    margin: 0;             
  }

  /* force le datepicker à remplir tout son parent .form-group */
  .profile-form .form-row:last-child input[type="date"] {
    width: 100%;
    box-sizing: border-box;
    border-radius: 2rem;
    padding: 0.6rem 1rem;
    margin: 0;             
  }

  /* colonnes empilées */
  #tab-publish .form-row {
    flex-direction: column;
    gap: 1.5rem;
  }

  #tab-publish .form-group {
    width: 60%;
    margin: 0 auto;
  }

  /* boutton centré et largeur réduite */
  #tab-publish .form-actions .btn-secondary {
    width: 70%;
    max-width: 250px;
  }
}