@font-face {
  font-family: iliad-font;
  src: url('../fonts/Iliad-Regular.otf');
  font-weight: bold;
}

div {
  font-family: iliad-font;
}

.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  margin: 1em 0;
  color: #e60000;
  font-family: iliad-font;
}

.stock-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  margin: 2em 0;
}

.stock-item-title {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeInUp {
  from {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

body {
  font-family: "Roboto", "Open Sans", system-ui, sans-serif;
  background: #f8f8f8;
  color: #333;
  padding: 1em;
}

h1 {
  font-size: 2em;
  letter-spacing: 1px;
  font-weight: bold;
}

@media (max-width: 600px) {
  .hub-selector {
    flex-direction: column;
    align-items: center;
	display: flex;
	gap: 1em;
	margin: 2em 0;
}
  
.hub-selector {
  display: flex;
  /*justify-content: center;*/
  margin: 2em 0;
  gap: 1em;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
}

.hub-selector label {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 600;
  color: #333;
  background: #f4f4f4;
  padding: 0.5em 1em;
  border-radius: 20px;
  border: 1px solid #ccc;
  cursor: pointer;
  transition: background 0.3s;
}

.hub-selector input[type="radio"] {
  accent-color: #e60000;
}

.hub-selector label:hover {
  background: #e6000010;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  margin: 2em 0;
}


button {
  background-color: #e60000;
  color: white;
  border: 2px solid #e60000;
  padding: 0.6em 1.4em;
  border-radius: 30px;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

button:hover {
  background-color: white;
  color: #e60000;
}

.center-button {
  display: flex;
  justify-content: center;
  margin-top: 1.5em;
}

.center-action-title {
  display: flex;
  justify-content: center;
  margin-bottom: 1em;
}

.free-stock {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 1.5em;
  margin: 2em auto;
  max-width: 700px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.free-stock h3 {
  font-size: 1.3em;
  color: #e60000;
  margin-bottom: 1em;
  text-align: center;
  text-transform: uppercase;
}

.stock-item {
  background-color: #f8f8f8;
  border-left: 4px solid #b00;
  border-radius: 6px;
  padding: 10px 12px;
  margin: 10px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stock-item-title {
  font-weight: bold;
  font-size: 1.1em;
  color: #b00;
  margin-bottom: 5px;
}

.stock-item-quantite {
  font-size: 0.95em;
  margin-bottom: 6px;
  color: #333;
}

.stock-item-serials {
  padding-left: 20px;
  margin: 0;
}

.stock-item-serials li {
  font-size: 0.9em;
  line-height: 1.4em;
  color: #444;
}

.stock-item-title:hover {
  background-color: #ffe5e5;
}

.stock-item-title .type {
  font-weight: bold;
  font-size: 1.1em;
  color: #b00;
}

.serial-list {
  padding-left: 1em;
  margin-top: 0.5em;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  color: #555;
  list-style-type: disc;
}

.serial-list.open {
  max-height: 500px; /* suffisamment grand pour le contenu max */
  opacity: 1;
}

.serial-list li {
  list-style-type: disc;
}

#ajout-section-2 {
  background: white;
  padding: 2em; /*1em;*/
  border: 1px solid #ccc;
  border-radius: 16px; /*8px;*/
  box-shadow: 0 0 12px rgba(0,0,0,0.08);
  margin-top: 2em;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#ajout-section label {
  display: block;
  margin-top: 1em;
  font-weight: bold;
}

#ajout-section input, #ajout-section select {
  width: 100%;
  padding: 0.5em;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-top: 0.3em;
  font-size: 1em;
}

#retrait-section-2 {
  background: white;
  padding: 2em;
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(0,0,0,0.08);
  margin-top: 2em;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#retrait-section label {
  display: block;
  margin-top: 1em;
  font-weight: bold;
}

#retrait-section input {
  width: 100%;
  padding: 0.5em;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-top: 0.3em;
  font-size: 1em;
}

#check-section-2 {
  background: white;
  padding: 2em;
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(0,0,0,0.08);
  margin-top: 2em;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#check-section-2 label {
  display: block;
  margin-top: 1em;
  font-weight: bold;
}

#check-section-2 input, #check-section-2 select {
  width: 100%;
  padding: 0.5em;
  border-radius: 8px;
  border: 1px solid #ccc;
  margin-top: 0.3em;
  font-size: 1em;
}

#check-section p,
#ajout-section p,
#retrait-section p {
  background: #f8f9fa;
  padding: 1em;
  border-radius: 8px;
  margin-top: 1em;
  font-size: 1em;
  white-space: pre-line; /* pour respecter les \n */
  border-left: 4px solid #ccc;
}

#check-section p.success,
#ajout-section p.success,
#retrait-section p.success {
  border-color: #28a745;
  color: #155724;
  background-color: #d4edda;
}

#check-section p.error,
#ajout-section p.error,
#retrait-section p.error {
  border-color: #dc3545;
  color: #721c24;
  background-color: #f8d7da;
}


.feedback-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #2ecc71;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: opacity 0.3s;
  z-index: 999;
} 

.feedback-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* ← Centre parfaitement */
  /*ou
    top: 40%;
	transform: translate(-50%, -40%);
  */
  max-width: 95%;
  background-color: #2ecc71;
  color: white;
  padding: 1em 2em;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  z-index: 9999;
  font-size: 1rem;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 1em 1.5em;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  color: white;
  font-size: 1rem;
  max-width: 95vw;
  animation: fadeInUp 0.3s ease-out;
}

.toast.success {
  background-color: #28a745;
}

.toast.error {
  background-color: #dc3545;
}

.toast .icon {
  width: 1.3em;
  height: 1.3em;
  fill: white;
}

.toast .close-toast {
  margin-left: auto;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.2em;
  cursor: pointer;
}


#feedback-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.2em;
  cursor: pointer;
  line-height: 1;
}

#feedback {
  display: none !important;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  min-width: 200px;
  padding: 1em 1.5em;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  font-size: 1rem;
  display: none;
  align-items: center;
  gap: 0.75em;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  font-family: sans-serif;
  pointer-events: none;
}

#feedback.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Succès */
#feedback.success {
  background-color: #e9f9ec;
  border: 2px solid #27ae60;
  color: #2d6a4f;
}

/* Erreur */
#feedback.error {
  background-color: #fdecea;
  border: 2px solid #e74c3c;
  color: #c0392b;
}

/* Icône (✓ ou ⚠) */
#feedback .icon {
  font-size: 1.5em;
}

/* Croix de fermeture */
#feedback .close-btn {
  margin-left: auto;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.2em;
}


/* Scanner code barre*/
.scanner-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1em;
}

.scan-btn {
  font-size: 1.2em;
  padding: 0.3em 0.5em;
  cursor: pointer;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#scanner-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  background: white;
  border: 2px solid #ccc;
  padding: 1em;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
  width: 90vw;
  max-width: 420px;
  text-align: center;
}

#reader {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

#scanner-modal button {
  margin-top: 1em;
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 0.5em 1em;
  border-radius: 6px;
  cursor: pointer;
}

#scanner-modal button:hover {
  background-color: #c0392b;
}

.modal-section {
  display: none; /* caché par défaut */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /*background: white;*/
  /*padding: 2em;*/
  border-radius: 16px;
  /*box-shadow: 0 0 20px rgba(0,0,0,0.25);*/
  z-index: 9999;
  max-width: 90vw;
  width: 95%;
  max-width: 500px;
  animation: fadeInUp 0.3s ease-out;
}

#stock-display-section.modal-section {
  width: 85%;
  max-height: 85vh; /* hauteur maximale à 90% de la fenêtre */
  overflow-y: auto; /* scroll vertical si besoin */
  overflow-x: none; /* scroll vertical si besoin */
}

/*#stock-display-section.modal-section .close-btn {
  right: -2em;
  color: #000;
  font-size: 2.5em;
}*/

.modal-section .close-btn {
  position: absolute;
  top: 0.5em;
  right: -1em;
  background: none;
  border: none;
  font-size: 2.0em;
  font-weight: bold;
  color: #e60000;
  cursor: pointer;
}

.modal-overlay {
  display: none; /* caché par défaut */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
}
