/* =========================================================
   BASE / IFRAME
========================================================= */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
}

body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;

  min-height: 100vh;    /* assure que le body prend tout l’écran */
  padding-top: 20px;    /* espace au-dessus du menu */
}

.top-spacer {
  height: 40px; /* ajustez la hauteur selon vos besoins */
  flex-shrink: 0; /* ne pas rétrécir en responsive */
}

.select-search-type,
.select-search-logic {
  padding: 4px;
  font-family: Arial;
  font-weight: bold;
  font-size: 16px;
  border: 1px solid;
  margin-left: 10px;
}


/* Sécurité responsive (sans casser le layout desktop) */
input,
select,
textarea {
  max-width: 100%;
  box-sizing: border-box;
}

/* =========================================================
   RESULTATS
========================================================= */

.result-panel {
  display: flex;
  flex-direction: column;
  margin-left: 6px;
  margin-right: 6px;
  padding: 3px;
  border-color: rgb(204, 202, 202);
  margin-bottom: 3px;
}

.result-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  background-image: url('../images/DegHD.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.result-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
  padding: 10px;
  margin: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(11, 11, 11, 0.7);
  width: 85px;
  text-align: center;
  cursor: pointer;
}

.result-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-bottom: 5px;
}

.result-title {
  font-size: 25px;
  width: 100%;
  padding-bottom: 5px;
}

.res-label {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #023703;
}

.res-count {
  font-size: 16px;
  font-weight: bold;
  color: #007bff;
}

.no-results {
  font-size: 20px;
  color: darkred;
  margin: 10px;
}

/* =========================================================
   CONTENEURS PRINCIPAUX
========================================================= */

.simple-search {
  display: flex;
  flex-direction: column;
  font-family: Arial;
  font-size: 18px;
  font-weight: bold;
  background-color: rgb(189, 189, 240);
  width: 650px;        /* desktop conservé */
  max-width: 100%;     /* mobile */
  border: 3px solid rgb(228, 226, 226);
}

.simple-form {
  display: flex;
  flex-direction: column;
  font-family: Arial;
  font-size: 18px;
  font-weight: bold;
  background-color: rgb(189, 189, 240);
  width: 950px;        /* desktop conservé */
  max-width: 100%;     /* mobile */
  border: 3px solid rgb(228, 226, 226);
}

/* =========================================================
   TITRES & PANELS
========================================================= */

.title-search {
  display: flex;
  font-size: 30px;
  padding: 8px;
}

.note-register {
  padding: 10px;
  font-size: 16px;
}

.search-panel,
.search-panel-reserve,
.button-panel {
  margin-left: 6px;
  margin-right: 6px;
  padding: 6px;
  border: 2px solid rgb(204, 202, 202);
  border-radius: 8px;
  margin-bottom: 3px;
  background-image: url('../images/DegHD.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.search-panel-reserve {
  font-size: 14px;
}

.ARsearch-panel,
.ARbutton-panel {
  margin-left: 6px;
  margin-right: 6px;
  padding: 6px;
  border: 2px solid rgb(204, 202, 202);
  border-radius: 8px;
  margin-bottom: 3px;
  background-image: url('../images/DegHG.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

/* =========================================================
   FORMULAIRES
========================================================= */

/* LOGIQUE / TYPE DE RECHERCHE — INCHANGÉ */
.type-logic {
  display: flex;
  justify-items: center;
  align-items: center;
  flex-direction: row;
  justify-content: space-between;
  margin: 5px 8px 5px 5px;
}

.edit-field {
  padding: 5px;
}

/* ===== ALIGNEMENT LABEL + CHAMP (AUTHOR, TITLE, ETC.) ===== */
.title-field,
.author-field,
.simple-title-field,
.email-field,
.user-field,
.regnum-field,
.sndl-field,
.form-field,
.password-field {
  padding: 4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Largeurs desktop conservées */
.author-field { width: 500px; }
.simple-title-field { width: 540px; }
.email-field,
.sndl-field { width: 300px; }
.user-field,
.regnum-field,
.password-field { width: 250px; }
.form-field { width: 650px; }

/* =========================================================
   TAILLE POLICE INPUT / SELECT = LABEL
========================================================= */
.simple-search input,
.simple-search select,
.simple-form input,
.simple-form select {
  font-size: 16px;
  font-family: inherit;
  font-weight: normal;
}

/* =========================================================
   BOUTONS — STYLE ORIGINAL RESTAURÉ
========================================================= */

.button-panel,
.ARbutton-panel {
  display: flex;
  justify-content: space-between;
}

.search-button,
.login-button,
.register-button,
.exit-button,
.clearance-button {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 30px 10px;
  width: 220px;
  font-family: Arial;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  background-color: transparent;
  border: none;
  box-shadow: 0 4px 8px rgba(11, 11, 11, 0.7);
}

.search-button:hover,
.login-button:hover,
.clearance-button:hover,
.exit-button:hover,
.register-button:hover {
  background-image: url('../images/DegHG.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

/* =========================================================
   MESSAGES
========================================================= */

.msgBox {
  display: none;
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: Arial;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(11, 11, 11, 0.7);
  z-index: 1000;
}

.msg-success { background: #2f8532; }
.msg-error   { background: #dc1406; }
.msg-warning { background: #ff9800; }
.msg-info    { background: #224adb; }

/* =========================================================
   BOOK INFO
========================================================= */

.book-info {
  margin: 20px auto;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 12px;
  background-color: #f9f9f9;
  width: 80%;
  text-align: center;
}

.book-info h3 {
  margin-bottom: 5px;
  color: #333;
}

.book-info p {
  margin: 3px 0;
  color: #555;
}

/* =========================================================
   MOBILE — SANS CASSER LE DESKTOP
========================================================= */

@media (max-width: 768px) {

  .simple-search,
  .simple-form {
    width: 100%;
  }

  /* Les lignes label + champ peuvent passer en colonne */
  .title-field,
  .author-field,
  .simple-title-field {
    flex-direction: column;
    align-items: stretch;
  }

  .button-panel,
  .ARbutton-panel {
    flex-direction: column;
    gap: 10px;
  }

  .search-button,
  .login-button,
  .register-button,
  .exit-button,
  .clearance-button {
    width: 100%;
  }

  .title-search {
    font-size: 22px;
    justify-content: center;
    text-align: center;
  }
}
