/* Style global */
body, html {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
}

/* Style de l'en-tête */
.header {
  background-color: #333;
  color: #ffffff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header a {
  color: #ffffff;
  text-decoration: none;
  margin-right: 20px;
}

.header a:hover {
  text-decoration: underline;
}

.header button {
  background-color: #f44336;
  color: white;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
}

.header button:hover {
  background-color: #d32f2f;
}



#flightsTable td {
  max-width: 250px; /* Définit la largeur maximale des cellules */
  overflow: hidden; /* Cache le contenu qui dépasse la largeur de la cellule */
  text-overflow: ellipsis; /* Ajoute des points de suspension si le contenu est trop long */
  white-space: nowrap; /* Empêche le contenu de passer à la ligne */
}


#flightForm {
  margin-bottom: 20px;
}

#flightForm input, #flightForm button {
  margin: 5px 0;
}

.logo {
  display: block;
  margin: 0 auto 20px; /* Centrer le logo et ajouter de l'espace en dessous */
  max-width: 200px; /* Ajuste la taille comme nécessaire */
  height: auto; /* Garde les proportions */
}

.header .logo {
  height: 50px; /* Ajuste la hauteur selon la taille de ton en-tête */
  width: auto; /* Permet de maintenir le ratio de l'image */
  vertical-align: middle; /* Alignement vertical si nécessaire */
}

.header .logo-link {
  display: inline-block; /* Permet au lien de s'adapter à la taille du logo */
  margin-right: 20px; /* Ajuste l'espacement autour du logo */
}

.header {
  display: flex;
  justify-content: space-between; /* Sépare les éléments de navigation et le bouton de déconnexion */
  align-items: center;
  padding: 10px 20px; /* Ajuste selon tes besoins */
  /* Autres styles pour l'en-tête ici */
}

.nav-container {
  display: flex;
  /* Aucun besoin de justify-content ici puisque par défaut les éléments sont alignés à gauche */
  align-items: center;
}

.nav-container a {
  margin-right: 20px; /* Ajuste selon tes besoins pour l'espacement des liens */
  text-decoration: none;
  /* Autres styles pour tes liens ici */
}

#logoutButton {
  /* Styles pour ton bouton de déconnexion */
}

.main-title {
  text-align: center; /* Centre le titre H1 */
  margin-top: 20px; /* Ajoute un peu d'espace en haut si nécessaire */
  /* Autres styles pour ton H1 ici */
}

/* Tu peux ajouter des requêtes média ici pour ajuster le style sur des appareils plus petits si nécessaire */
@media (max-width: 600px) {
  .header {
      flex-direction: column; /* Empile les éléments sur les petits écrans */
  }
  .nav-container {
      justify-content: center; /* Centre les liens de navigation sur les petits écrans */
      margin-bottom: 10px; /* Ajoute de l'espace entre les liens de navigation et le bouton de déconnexion */
  }
  .main-title {
      margin-top: 10px; /* Réduit l'espacement sur les petits écrans */
  }
}




.table-responsive {
  width: 100%; /* Assure que le conteneur s'adapte à la largeur de l'écran */
  -webkit-overflow-scrolling: touch; /* Améliore le défilement sur les appareils tactiles iOS */
}

table {
  width: auto; /* Assure que le tableau peut s'étendre au-delà de la largeur du conteneur */
  min-width: 100%; /* S'assure que le tableau est au moins aussi large que son conteneur */
  border-collapse: collapse;
}


th, td {
  border: 1px solid #ddd;
  white-space: nowrap; /* Empêche le texte dans les cellules de passer à la ligne suivante */
  padding: 8px;
  text-align: left;
}

th {
  background-color: #f2f2f2;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

.small-input {
  width: 80px; /* ou toute autre largeur qui convient à ton design */
  max-width: 100%; /* pour s'assurer que le champ ne dépasse pas la largeur de son conteneur sur les petits écrans */
}


.login-container {
  max-width: 400px;
  margin: auto;
  margin-top: 100px; /* Ajuste ceci selon la hauteur désirée */
  padding: 20px;
  background-color: white;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Ombre douce pour le conteneur */
  border-radius: 8px; /* Bords arrondis */
}

.login-container h2 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}

#loginForm {
  display: flex;
  flex-direction: column;
}

#loginForm input[type="text"],
#loginForm input[type="password"] {
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px; /* Bords arrondis pour les champs de saisie */
}

#loginForm button {
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#loginForm button:hover {
  background-color: #0056b3;
}


ul#usersList {
    list-style-type: none;
    padding: 0;
}

ul#usersList li {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

#userForm {
  display: flex;
  flex-direction: column;
}

#userForm input[type="text"],
#userForm input[type="password"] {
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#userForm button {
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#userForm button:hover {
  background-color: #0056b3;
}

.form-container {
  max-width: 800px; /* Adjust this width as necessary */
  padding: 20px;
  margin: auto;
}

.form-group {
  display: grid;
  grid-template-columns: 1fr 2fr; /* Two-column layout */
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group label {
  text-align: right;
  margin-right: 10px;
}

/* Ensuring input fields and the button have the same width */
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select,
.form-group input[list] {
  width: 200px; /* This ensures the input takes the full width of the grid column */
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Styling for the submit button */
.form-group button {
  background-color: #007bff; /* Blue background */
  color: white; /* White text */
  border: none; /* No border */
  border-radius: 4px; /* Rounded corners */
  cursor: pointer; /* Cursor indicates clickable */
  font-size: 16px; /* Larger font size for readability */
  font-weight: bold; /* Make the text bold */
  text-transform: uppercase; /* Optional: uppercase text */
  letter-spacing: 1px; /* Optional: more spacing between letters */
  transition: background-color 0.3s ease; /* Smooth transition for hover effect */

  /* Aligning the button */
  grid-column: 2 / 3; /* This will align the button under the input fields */
  padding: 10px; /* Matching padding of the inputs */
  margin-top: -5px; /* Adjust if needed to align with the bottom of inputs */
  width: 200px; /* Adjust width to match inputs, accounting for padding */
}

.stats-summary {
  text-align: center;
  margin: 20px 0;
  padding: 10px;
  background-color: #e9ecef;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-summary h2 {
  margin-top: 0;
  color: #333;
}

.stats-summary p {
  font-size: 18px;
  color: #555;
  margin: 10px 0;
}

.stats-summary span {
  font-weight: bold;
}

/* Style général du modal */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0,0,0); /* Fallback color */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

/* Modal Content Box */
.modal-content {
  background-color: #fefefe;
  margin: 15% auto; /* 15% from the top and centered */
  padding: 20px;
  border: 1px solid #888;
  width: 80%; /* Could be more or less, depending on screen size */
  border-radius: 10px; /* Optional: Rounded corners for aesthetics */
}

/* The Close Button (x) */
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* Style spécifique pour le formulaire de réinitialisation */
#forgotPasswordModal {
  padding: 20px;
  border-radius: 5px; /* Bords arrondis */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Ombre légère */
}

#forgotPasswordModal input[type="email"] {
  width: 100%; /* Utilise toute la largeur disponible */
  padding: 10px; /* Espacement intérieur */
  margin-top: 8px; /* Espacement en dessus */
  margin-bottom: 16px; /* Espacement en dessous */
  border-radius: 4px; /* Bords arrondis */
  border: 1px solid #ccc; /* Bordure subtile */
}

#forgotPasswordModal button {
  background-color: #007bff; /* Bleu */
  color: white; /* Texte blanc */
  padding: 12px 20px; /* Padding généreux */
  border: none; /* Aucune bordure */
  cursor: pointer; /* Indique que c'est cliquable */
  width: 100%; /* Utilise toute la largeur */
  border-radius: 4px; /* Bords arrondis */
}

#forgotPasswordModal button:hover {
  opacity: 0.8; /* Légèrement transparent au survol */
}

/* Styles généraux pour le conteneur de formulaire */
.subscribe-container {
  max-width: 400px;
  margin: 50px auto;
  padding: 20px;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}

/* Styles pour le titre du formulaire */
.subscribe-container h2 {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
}

/* Styles pour la description générale du formulaire */
.subscribe-container p {
  text-align: center;
  margin-bottom: 30px;
  color: #666;
  font-size: 14px;
}

/* Styles pour les étiquettes des champs */
.subscribe-container label {
  display: block;
  margin-bottom: 5px;
  color: #333;
  font-size: 14px;
}

/* Styles pour les champs de saisie */
.subscribe-container input[type="text"],
.subscribe-container input[type="email"],
.subscribe-container input[type="password"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box; /* Inclut padding et border dans la largeur totale */
}

/* Styles pour le bouton de soumission */
.subscribe-container button {
  width: 100%;
  padding: 10px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.subscribe-container button:hover {
  background-color: #0056b3;
}

#exportCsvButton {
  background-color: #28a745; /* Vert */
}

#exportCsvButton:hover {
  background-color: #218838; /* Vert foncé */
}


.login-link {
  text-align: center;
  margin-top: 20px;
}

.login-link a {
  color: #007bff;
  text-decoration: none;
}

.login-link a:hover {
  text-decoration: underline;
}


/* Lien pour créer un compte sur la page de connexion */
.login-link-container {
  text-align: center; /* Centre le lien dans le conteneur */
  margin-top: 20px; /* Ajoute de l'espace au-dessus du lien */
}

.login-link-container a {
  color: #007bff; /* Couleur du lien */
  text-decoration: none; /* Aucun soulignement */
}

.login-link-container a:hover {
  text-decoration: underline; /* Souligne au survol */
}


.error-message {
  color: #f44336; /* Rouge pour les messages d'erreur */
  margin-top: 10px; /* Espace au-dessus du message */
  text-align: center; /* Centrer le texte */
}

/* Dans votre style.css */
.hidden {
  opacity: 0;
  max-height: 0;
  display:none;
  transition: opacity 0.3s ease, max-height 0.3s ease, visibility 0.3s;
}

.visible {
  opacity: 1;
  max-height: 100px; /* un peu plus que la hauteur réelle de votre input */
  visibility: visible;
}

.fas {
  color: #333; /* Couleur de l'icône */
  margin-right: 5px;
}

.fas:hover {
  color: #007bff; /* Couleur au survol */
}

.stats-container {
  background-color: #f0f2f5;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px; /* Espacement entre les sections de stats */
}

.stats-block {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px; /* Espacement entre les blocs dans une même section */
}

.stats-block h2 {
  color: #333;
  margin-bottom: 15px;
}

.stats-block p {
  font-size: 16px;
  line-height: 1.5;
  color: #666;
}

hr {
  border: none;
  height: 1px;
  background-color: #ccc;
  margin: 20px 0;
}

/* Ajouts/modifications pour la page d'importation */
.content {
  max-width: 800px;
  margin: auto;
  padding: 20px;
}

.form-container {
  background-color: #fff;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn {
  background-color: #007bff;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: inline-block;
  margin-top: 10px;
}

.btn:hover {
  background-color: #0056b3;
}

.table-responsive {
  margin-top: 20px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table, th, td {
  border: 1px solid #ccc;
}

th, td {
  text-align: left;
  padding: 8px;
}

th {
  background-color: #f2f2f2;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Style pour le lien actif dans le menu de navigation */
.nav-container a.active {
  background-color: #ddd;
  color: #333;
}

.import-section, .export-section {
  background-color: #ffffff; /* Arrière-plan blanc pour plus de clarté */
  padding: 20px; /* Espacement à l'intérieur des sections */
  margin-bottom: 30px; /* Espacement entre les sections */
  border-radius: 8px; /* Coins arrondis pour l'esthétique */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Ombre subtile pour la profondeur */
}

.import-section h2, .export-section h2 {
  color: #333; /* Couleur du texte pour les titres */
  margin-bottom: 15px; /* Espacement sous les titres */
}

.import-btn {
  background-color: #4CAF50; /* Vert pour l'importation */
}

.export-btn {
  background-color: #2196F3; /* Bleu pour l'exportation */
}

.import-btn:hover, .export-btn:hover {
  opacity: 0.8; /* Effet au survol pour les boutons */
}

.delete-flights-btn {
  background-color: #f44336; /* Rouge pour les actions de suppression */
  color: white;
  border: none;
  padding: 12px 24px; /* Plus de padding pour un meilleur rendu visuel */
  border-radius: 4px; /* Bords arrondis pour l'esthétique */
  cursor: pointer;
  margin-top: 20px; /* Espacement au-dessus du bouton */
  margin-bottom: 20px; /* Espacement en dessous du bouton */
  transition: background-color 0.3s ease; /* Transition en douceur lors du survol */
}

.delete-flights-btn:hover {
  background-color: #d32f2f; /* Un rouge légèrement plus foncé au survol */
}


/* Ajouts pour le responsive design */
@media (max-width: 768px) {
  .form-container, .table-responsive {
      padding: 10px;
  }
  
  .btn {
      width: 100%;
      padding: 12px 0; /* Plus d'espace vertical pour faciliter le clic sur mobile */
  }

  .header, .nav-container {
      flex-direction: column;
  }
  
  .nav-container a {
      margin-bottom: 10px; /* Espace entre les liens dans le menu mobile */
  }
  
  .content {
      padding: 10px;
  }
}


@media (max-width: 1024px) {
  /* Header styles */
  .header {
    flex-direction: column; /* Stack header items */
    padding: 10px; /* Adjust padding */
  }

  .nav-container a, .header button {
    font-size: 16px; /* Increase font size for easier touch */
    margin-bottom: 5px; /* Add space below each nav item */
  }

  #logoutButton {
    display: block; /* Show the logout button */
    width: auto; /* Auto width to fit content */
    margin-top: 10px; /* Space above the logout button */
  }

  /* Form container and login container styles */
  .form-container, .table-responsive, .login-container {
    width: calc(100% - 20px); /* Adjust the 20px to whatever your horizontal padding is */
    margin: auto; /* Keeps the form centered */
    padding: 10px; /* This is your left and right padding */
  }

  /* Form group styles */
  .form-group {
    grid-template-columns: 1fr; /* Stack label and field vertically */
  }

  .form-group button {
    grid-column: 1 / 2; /* Button takes full width under the stacked input field */
    width: 100%; /* Full width button for easier touch */
    padding: 12px;
    margin-top: 10px; /* Space above the button */
  }

  .form-group label {
    margin-bottom: 5px;
    text-align: left;
  }

  .form-group input[type="text"],
  .form-group input[type="date"],
  .form-group input[type="time"],
  .form-group input[type="number"],
  .form-group select,
  .form-group input[list] { /* Added styles for datalist inputs */
    box-sizing: border-box; /* Add this line to include padding and border in the element's total width and height */
    width: 100%; /* Full width fields */
    padding: 12px; /* Larger padding for easy touch */
  }

  .form-group button {
    width: 100%; /* Full width button for easy touch */
    padding: 12px;
    
  }

  /* Table styles */
  #flightsTable {
    display: block;
    overflow-x: auto; /* Allow horizontal scrolling */
  }

  th, td {
    padding: 8px; /* Adjust table cell padding */
    font-size: 14px; /* Increase font size for readability */
  }

  /* Additional responsive adjustments could be added here */
}

.import-json-section {
  margin: 20px auto;
  max-width: 800px;
  padding: 20px;
  background-color: #f5f5f5;
  border-radius: 8px;
}

.json-import-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#jsonInput {
  width: 100%;
  height: 200px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: monospace;
  resize: vertical;
}

.json-import-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.secondary-button {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.secondary-button:hover {
  background-color: #5a6268;
}

.export-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.export-btn {
  flex: 1;
  max-width: 200px;
}
