html {
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background-color: #F2DEBF;
  overflow-x: hidden;
  max-width: 100%;
}

main {
  flex: 1;
  font-family: "Yeseva One", serif;
  font-weight: 400;
  font-style: normal;
}

main h1 {
  justify-content: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: 50vh;
  padding: 6rem 8% 2rem;
  font-size: 1.8rem;
}

main p {
  justify-content: center;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.presentation {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 80vh;
}

header {
  background-color: #613A00;
  color: white;
  padding: 10px;
  font-family: "Yeseva One", serif;
  font-weight: 400;
  font-style: normal;
}

header nav ul {
  display: flex;
  justify-content: center;
  margin: 0;
  max-width: 576px;
  gap: 30px;
  padding: 5px;
}

footer {
  height: 8vh;
  width: 100%;
  background-color: #613A00;
  margin: 0 auto;
}

footer div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: auto;
  max-width: 1080px;
}

footer div p {
  padding: 15px 8px;
  margin: 0;
  color: #ffffff;
}

.cards-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 20px;
}

.cards {
    flex: 1 1 300px;       /* Largeur minimale 300px, s'étend si possible */
  max-width: 320px;      /* Limite la largeur de chaque carte */
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: rgb(241, 241, 241);
  box-sizing: border-box;
}

.cards img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
}

/* TABLEAU */

#page-donnees {
  padding: 3rem 5%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: "Yeseva One", serif;
  font-weight: 400;
  font-style: normal;
  
}

#specialite {
  border-collapse: collapse;
  width: 90%;
  table-layout: fixed;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  font-family: "Yeseva One", serif;
  font-weight: 400;
  font-style: normal;
}

#specialite td:nth-child(5) {
  white-space: normal;
  overflow: visible;
}

#specialite thead {
  background-color: #613A00;
  color: white;
  position: sticky;
  top: 0;
  z-index: 2;
}

#specialite th,
#specialite td {
  padding: 12px 15px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#specialite th.description,
#specialite td.description {
  width: 40%; 
}
#specialite tbody tr {
  border-bottom: 1px solid #eee;
}

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

#specialite tbody tr:hover {
  background-color: #f0e6d8;
  transition: 0.2s ease;
}

/* RECHERCHE */

.result-count {
  text-align: center;
  margin-top: 2rem;
  font-size: 1.2rem;
}

.results-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  flex-direction: column;
  min-height: 60vh;
  gap: 20px;
  padding: 20px;
  flex-direction: row;

  
}

.no-result-box {
  background: #ffffff;
  padding: 40px;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  animation: fadeIn 0.4s ease-in-out;
}

.question-mark {
  font-size: 80px;
  font-weight: bold;
  color: rgba(133, 83, 40, 0.9);
  margin-bottom: 20px;
}

.no-result-box h2 {
  margin-bottom: 10px;
  font-size: 22px;
}

.no-result-box p {
  color: #000000;
  margin-bottom: 25px;
}

.btn-new-search {
  display: inline-block;
  padding: 12px 25px;
  background: rgba(133, 83, 40, 0.9);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: 0.3s ease;
}

.btn-new-search:hover {
  background: rgba(97, 58, 0, 1);
  transform: translateY(-2px);
}

.new-search-button {
    display: flex;             
    justify-content: center;    
    margin-bottom: 20px; 
}

/* Bouton lui-même */
.new-search-button .btn-new-search {
   display: flex;      
    padding: 10px 0px;
    background-color: rgba(97, 58, 0, 1); 
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}



/* NAV BAR */

.topnav {
  display: flex;
  align-items: center;
  width: 100%;
}

.topnav_link {
  color: white;
  padding: 12px;
  text-decoration: none;
}

.topnav_link:hover {
  color: #000000;
}

#topnav_hamburger_icon {
  display: none;
}

#home_link {
  flex-grow: 1;
}

#root {
  position: relative;
  overflow: hidden;
}

#topnav_responsive_menu {
  display: block;
  position: fixed;
  margin: 0;
  right: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99;
  transform-origin: 0% 0%;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
  pointer-events: none;
}

#topnav_responsive_menu ul {
  display: flex;
  flex-direction: column;
  justify-content: start;
  position: absolute;
  margin: 0;
  right: 0;
  top: 0;
  min-width: 50vw;
  height: 100vh;
  padding: 100px 0 0;
  text-align: center;
  background: #ededed;
  list-style-type: none;
  -webkit-font-smoothing: antialiased;
}

#topnav_responsive_menu li {
  padding: 12px 24px;
}

#topnav_responsive_menu a {
  white-space: nowrap;
  text-decoration: none;
}

#topnav_responsive_menu.open {
  transform: translateX(0);
  pointer-events: auto;
}

/* FORMULAIRE */

form {
  background: white;
  padding: 40px 35px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  margin: 30px auto;
  gap: 20px;
  width: 100%;
  max-width: 450px;
  box-sizing: border-box;

}

form label {
  font-size: 1.2rem;
  color: rgba(133, 83, 40, 0.9);
  text-align: center;
}

#search {
  padding: 12px 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
  transition: 0.3s ease;
  font-family: "Yeseva One", serif;
}

#search:focus {
  outline: none;
  border-color: rgba(133, 83, 40, 0.8);
  box-shadow: 0 0 0 3px rgba(133, 83, 40, 0.2);
}

/* Bouton submit (était non stylisé) */
#submit {
  padding: 12px 25px;
  background-color: rgba(133, 83, 40, 0.9);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Yeseva One", serif;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#submit:hover {
  background-color: rgba(97, 58, 0, 1);
  transform: translateY(-2px);
}

/* RESPONSIVE */

.cards {
  width: 100%;
  max-width: 420px;
}

main h1 {
  min-height: 15vh;
  padding: 2.5rem 5% 1rem;
  font-size: 1.8rem;
}

#page-donnees {
  padding: 3rem 4%;
  width: 100%;
  max-width: 100vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
}

#specialite thead tr {
  background-color: rgba(133, 83, 40, 0.85);
}

@media screen and (max-width: 576px) {
  #topnav_menu {
    display: none;
  }

  header nav ul {
    flex-direction: column;
    text-align: center;
  }

  header {
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  footer {
    height: auto;
    min-height: 8vh;
  }

  footer div {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }

 #page-donnees {
    overflow-x: auto; 
  }

  /* Catalogue : masquer colonnes secondaires sur mobile */
  #specialite th:nth-child(3),
  #specialite td:nth-child(3),
  #specialite th:nth-child(5),
  #specialite td:nth-child(5),
  #specialite th:nth-child(7),
  #specialite td:nth-child(7),
  #specialite th:nth-child(8),
  #specialite td:nth-child(8) {
    display: none;
  }

  #specialite th:nth-child(1),
  #specialite td:nth-child(1),
  #specialite th:nth-child(2),
  #specialite td:nth-child(2),
  #specialite th:nth-child(4),
  #specialite td:nth-child(4),
  #specialite th:nth-child(6),
  #specialite td:nth-child(6) {
    white-space: normal;    /* texte à la ligne */
    overflow: visible;      /* tout le texte visible */
    word-wrap: break-word;  /* coupe les mots longs */
  }

    #specialite td,
  #specialite th {
    text-overflow: clip;
  }


  

  .cards-container {
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 5%;
  }

  .cards {
    max-width: 90%;
    width: 100%;
  }

  .presentation {
    min-height: 80vh;
  }

  .presentation img {
    max-width: 100%;
    height: auto;
  }

  .question-mark {
    font-size: 50px;
  }

  .no-result-box {
    padding: 30px 20px;
    border-radius: 10px;
    max-width: 400px;
    width: 80%;
  }

  .no-result-box h2 {
    font-size: 16px;
  }

  form {
    padding: 25px 20px;
    margin: 15px auto;
    max-width: 100%;
    width: calc(100% - 2rem);
  }

  form label {
    font-size: 1rem;
  }

  #search {
    font-size: 0.95rem;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .results-container {
    min-height: 40vh;
    padding: 10px;
    flex-direction: column; /* empile verticalement */
    align-items: center;
    gap: 15px;
  }

  .result-count {
    font-size: 1rem;
    margin-top: 1rem;
  }

  /* HAMBURGER ICON */
  #topnav_hamburger_icon {
    display: block;
    position: relative;
    margin: 16px;
    width: 33px;
    height: 28px;
    z-index: 100;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
  }

  #topnav_hamburger_icon span {
    display: block;
    position: absolute;
    height: 4px;
    width: 100%;
    margin-bottom: 5px;
    background: #ededed;
    border-radius: 3px;
    z-index: 100;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: 0.25s ease-in-out;
  }

  #topnav_hamburger_icon span:nth-child(1) {
    top: 0px;
    transform-origin: left top;
  }

  #topnav_hamburger_icon span:nth-child(2) {
    top: 12px;
    transform-origin: left center;
  }

  #topnav_hamburger_icon span:nth-child(3) {
    top: 24px;
    transform-origin: left bottom;
  }

  #topnav_hamburger_icon.open span {
    background: #333;
  }

  #topnav_hamburger_icon.open span:nth-child(1) {
    width: 110%;
    transform: rotate(45deg);
  }

  #topnav_hamburger_icon.open span:nth-child(2) {
    width: 0%;
    opacity: 0;
  }

  #topnav_hamburger_icon.open span:nth-child(3) {
    width: 110%;
    transform: rotate(-45deg);
  }
}