/* 🌐 Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 🧩 Corps */
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #fdf7f0;
  color: #4a2e1e;
  padding: 1rem;
}

/* Empêcher DataTables d'affecter le body */
body .dataTables_wrapper {
    all: unset;
}

/* 🧠 En-tête */
header {
  background-color: #e67e22;
  color: white;
  border-bottom: 4px solid #a0522d;
  margin-bottom: 2rem;
}

/* 🔷 Barre d'en-tête */

/* Ligne 1 : Titre centré */
.header-title-row {
  text-align: center;
  background-color: #e67e22;
  color: white;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid #a0522d;
}
.header-title-row h1 {
  margin: 0;
  font-size: 1.8rem;
}

/* Ligne 2 : menu + logo + bouton */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #e67e22;
  padding: 0.5rem 1rem;
}

.header-left,
.header-center,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-left {
  justify-content: flex-start;
}

.header-center {
  justify-content: center;
}

.header-right {
  justify-content: flex-end;
}

.logo {
  max-width: 60px;
  height: auto;
}

/* ☰ Menu sandwich */
.menu-toggle {
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  user-select: none;
}

/* 👤 Menu utilisateur */
.user-menu {
  display: none;
  background-color: #fffaf3;
  color: #4a2e1e;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #d2b48c;
  text-align: left;
}

.user-menu a {
  color: #e67e22;
  text-decoration: none;
  font-weight: bold;
}

/* 📦 Formulaire */
.modal-content {
  background-color: #fffaf3;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 600px;
  margin: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.modal-content h2 {
  color: #4a2e1e; /* même couleur que le texte principal */
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}


/* 🧾 Champs */
input, select {
  padding: 0.8rem;
  font-size: 1rem;
  border: 1px solid #d2b48c;
  border-radius: 4px;
  width: 100%;
  background-color: #fff;
  color: #4a2e1e;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.admin-checkbox label {
  font-size: 1.1em;
}

.admin-checkbox input[type="checkbox"] {
  width: 24px;
  height: 24px;
  cursor: pointer;
}


/* 🖼️ Image */
#preview {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid #d2b48c;
  border-radius: 4px;
  margin-top: 1rem;
}

/* 📷 QR Code */
#reader {
  width: 100%;
  max-width: 300px;
  height: 300px;
  margin: 1rem auto;
}

/* ✅ Boutons */
button {
  padding: 0.8rem;
  font-size: 1rem;
  background-color: #e67e22;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #cf711f;
}

/* 🖼️ Galerie */
#gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.puzzle-card {
  background-color: #fffaf3;
  border: 1px solid #d2b48c;
  border-radius: 6px;
  padding: 1rem;
  box-shadow: 0 0 5px rgba(0,0,0,0.05);
  color: #4a2e1e;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  gap: 1rem;
}


.puzzle-card img {
  width: 260px;
  height: auto;
  border-radius: 4px;
  flex-shrink: 0;
}

.puzzle-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 1rem;
}

.puzzle-options {
  margin: 0.5rem 0;
  font-weight: bold;
  color: #2c3e50;
}

.availability-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.availability-label {
  font-weight: bold;
  font-size: 1rem;
  margin-right: 0.5rem;
}

.availability-row label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1rem;
  white-space: nowrap;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.price-row label {
  font-weight: bold;
  font-size: 1rem;
}

.price-row input[type="number"] {
  max-width: 120px;
}

.options-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-weight: bold;
  color: #2c3e50;
}

.options-label {
  white-space: nowrap;
}

.options-values {
  white-space: nowrap;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-row strong {
  flex: 1;
  font-size: 1.1em;
}

.deleteBtn, .editPuzzleBtn {
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: red;
  margin-left: 10px;
  padding : 0;
}

/* 📋 Liste emprunts */
.borrow-list {
  list-style: none;
  margin-top: 0.5rem;
  padding-left: 0;
  font-size: 0.95rem;
  color: #4a2e1e;
}

.borrow-list li {
  padding: 0.3rem 0;
  border-bottom: 1px solid #d2b48c;
}


.validateReturnBtn {
  background: none;       /* Pas de fond */
  border: none;           /* Pas de bordure */
  color: #4a2e1e;         /* Couleur du texte/icône */
  font-size: 1.2rem;      /* Taille icône */
  cursor: pointer;
  padding: 0;             /* Pas de padding */
}

.validateReturnBtn:hover {
  color: #e67e22;         /* Couleur au survol */
}


.reservation-to-validate {
  color: red; /* Texte rouge */
  font-weight: bold; /* Optionnel pour attirer l’attention */
}



/* 🪟 Popup */
.modal {
  display: none;
  position: fixed;
  z-index: 10;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  margin: 5% auto;
  width: 95%;
  max-width: 600px;
}

/* Fenêtres */
#popupForm.modal {
  z-index: 1000;
}

#barcodeModal.modal {
  z-index: 1100;
}

/* ➕ Bouton ajout dans l'en-tête */
#floatingAddBtn {
  background: none;
  border: none;
  padding: 0.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#floatingAddBtn svg {
  width: 28px;
  height: 28px;
  transition: transform 0.2s ease;
}

#floatingAddBtn:hover svg {
  transform: scale(1.1);
}

#addPuzzleForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-content form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-content .close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #4a2e1e;
  background: none;
  border: none;
}

.modal-content .closeReservation {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #4a2e1e;
  background: none;
  border: none;
}

.form-message {
  font-size: 0.95rem;
  padding: 0.5rem;
  border-radius: 4px;
}

.form-message.success {
  background-color: #dff0d8;
  color: #3c763d;
}

.form-message.error {
  background-color: #f2dede;
  color: #a94442;
}



.reserveBtn {
  display: inline-block !important;         /* 👈 évite le bloc complet */
  align-self: flex-start;
  width: auto !important;        /* 👈 force la largeur à s’adapter au contenu */
  max-width: fit-content !important;        /* 👈 limite à la taille du texte */
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  background-color: #e67e22;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  white-space: nowrap;          /* 👈 empêche le retour à la ligne */
}

.reserveBtn:hover {
  background-color: #cf711f;
}

.editReservationBtn,
.deleteReservationBtn {
  background: none;
  border: none;
  font-size: 1em;
  cursor: pointer;
  padding: 0;
}
.editReservationBtn { color: #007bff; }
.deleteReservationBtn { color: red; }

button.deleteReservationBtn.warning {
  color: red;
  font-weight: bold;
}

button.deleteReservationBtn.warning::before {
  content: "⚠️ ";
}


.puzzle-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* 👈 aligne le bouton à gauche sans l’étirer */
  gap: 0.5rem;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
}

.filter-group label {
  margin-bottom: 0.3rem;
  font-weight: bold;
  color: #4a2e1e;
}

.filter-group select,
.filter-group input[type="text"] {
  font-size: 1rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d2b48c;
  border-radius: 4px;
  background-color: #fff;
  color: #4a2e1e;
  width: auto;
  min-width: 120px;
}

.filter-group input[type="checkbox"] {
  transform: scale(1.2);
  margin-top: 0.3rem;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  white-space: nowrap;
}

/* Conteneur des boutons */
.filter-buttons {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  width: 100%;
  margin-top: 0.5rem;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-family: Arial, sans-serif;
  background-color: #fff;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.user-table th, .user-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.user-table thead {
  background-color: #f5f5f5;
  color: #333;
}

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

.user-table tr:hover {
  background-color: #eef;
}

.btn-edit, .btn-delete, .btn-email {
  padding: 0.4rem 0.6rem;
  margin-right: 0.3rem;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
}

.btn-edit {
  color: white;
}

.btn-delete, .btn-email {
  background: none !important;
  color: black;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.btn-action {
  display: inline-block;
  text-decoration: none;
  padding: 0.8rem;
  font-size: 1rem;
  background-color: #e67e22;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-right: 1rem; /* ➕ espace entre les boutons */
}

.btn-action:hover {
  background-color: #cf711f;
}


.action-buttons {
  display: flex;
  gap: 0.5rem; /* espace entre les boutons */
  align-items: center;
}

.historyBtn {
  background: none;       /* pas de fond */
  border: none;           /* pas de bordure */
  color: #4a2e1e;         /* couleur du texte/icône */
  font-size: 1.2rem;      /* taille icône */
  cursor: pointer;
  padding: 0;             /* pas de padding */
}

.historyBtn:hover {
  color: #e67e22;         /* couleur au survol */
}


#feedbackMessage {
  display: none;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
}


.btn-newsletter {
  background: none;       /* Pas de couleur de fond */
  border: none;           /* Pas de bordure */
  cursor: pointer;
  font-size: 1.2rem;      /* Taille de l’icône */
  padding: 5px;
}

.btn-newsletter:hover {
  color: #f0c040;         /* Couleur au survol (doré comme votre charte) */
  transform: scale(1.2);  /* Effet zoom léger */
}


.btn-retour {
  outline: none;
  box-shadow: none;
}

/* Neutraliser l'impact global */
.datatable-wrapper .dataTables_wrapper {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.datatable-wrapper table.dataTable {
    width: 100%;
    border-collapse: collapse;
}

.datatable-wrapper table.dataTable th,
.datatable-wrapper table.dataTable td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
}

.datatable-wrapper table.dataTable th {
    background-color: #f4f4f4;
}


/* 📱 Responsive */
@media screen and (max-width: 600px) {
  body {
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 1rem;
  }
	
  input, select, button {
    font-size: 1.1rem;
    padding: 1rem;
  }
  
  h1, h2 {
    font-size: 1.5rem;
  }
  
.header-bar {
  flex-direction: row;
  gap: 0;
  padding: 0.5rem 1rem;
}

.header-title-row h1 {
  font-size: 1.6rem;
  text-align: center;
}

  .logo {
    max-width: 70px;
  }

  .modal-content {
    padding: 1.5rem;
    font-size: 1.1rem;
  }

  button {
    font-size: 1rem;
    padding: 0.8rem 1rem;
  }

  #reader {
    height: 220px;
  }

  .puzzle-card {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    padding: 0.8rem;
  }

  .puzzle-card img {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 0.8rem;
  }

  .puzzle-info {
    align-items: flex-start;
    font-size: 1rem;
    gap: 0.5rem;
  }

  #borrowList li {
    font-size: 1rem;
  }
}
