/* =========================================
   RESET & PARAMÈTRES DE BASE
   ========================================= */
/* Permet au footer de rester en bas */
html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1;
  padding-top: 0;
}

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

/* À commenter pour le debug (voir les éléments qui débordent) */
/*
* {
  outline: 1px solid red;
}
*/

/* =========================================
   HEADER & FOOTER
   ========================================= */
header,
footer {
  width: 100%;
  margin: 0;
  padding: 0;
}

header {
  margin-bottom: 0 !important;
  padding: 0 !important;
  height: 100px;
  display: flex;
  align-items: center;
  background-color: #CADBBF !important;
}

/* =========================================
   CONTENEURS GLOBAUX
   ========================================= */
.container,
.content,
.main-wrapper,
.content-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

/* Surcharge pour .container si on la veut à 98% */
.container {
  width: 98%;
  margin-top: 1.5rem;
  padding-top: 0;
}

/* Wrapper pour le contenu principal */
/*.content-wrapper {
  padding-top: 1.5rem;
}*/

/* =========================================
   DROPDOWN MENU
   ========================================= */
.dropdown-menu .dropdown-item:hover {
  background-color: #8FBC8F !important;
  color: white;
}

/* =========================================
   BACKGROUND & LOGO
   ========================================= */
.custom-bg {
  background-color: #CADBBF !important;
}

header.custom-bg {
  background-color: #CADBBF !important;
}

.logo-large {
  height: 80px;
}

/* =========================================
   SIDEBAR LATÉRAL (mobile/tablette)
   ========================================= */
.sidebar {
  position: fixed;
  top: 0;
  right: -250px;
  width: 250px;
  height: 100%;
  background: #CADBBF;
  transition: right 0.3s ease-in-out;
  box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  padding-top: 60px;
}

.sidebar a {
  display: block;
  padding: 15px;
  font-size: 18px;
  text-decoration: none;
  color: black;
  text-align: center;
}

.sidebar a:hover {
  background: #b5c9a8;
}

.sidebar.show {
  right: 0;
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

/* =========================================
   RESPONSIVE NAVBAR
   ========================================= */
/* Mode mobile/tablette */
@media (max-width: 991px) {
  .navbar-toggler {
    display: block;
    margin-left: auto;
    background: none;
    border: none;
    font-size: 24px;
  }

  .navbar-nav {
    position: relative;
  }

  .navbar-nav .dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    width: 100%;
    display: none;
  }

  .navbar-nav .dropdown-menu.show {
    display: block;
  }
}

/* Mode desktop (lg et plus) */
@media (min-width: 992px) {
  .sidebar {
    display: none !important;
  }

  .navbar-toggler {
    display: none !important;
  }
}

/* =========================================
   RESPONSIVE LOGO
   ========================================= */
@media (max-width: 600px) {
  .logo-right {
    display: none;
  }
}

/* =========================================
   LISTE DES POSTS (page d'accueil)
   ========================================= */
.post-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f9f9f9;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out;
  flex-direction: row;
  width: 100%;
  margin-left: 5%;
}

.post-card:hover {
  transform: scale(1.02);
}

.post-image {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
}

.post-content {
  flex: 1;
  min-width: 0;
}

.post-title {
  font-size: clamp(14px, 3vw, 18px);
  font-weight: bold;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-text {
  font-size: clamp(12px, 2.5vw, 16px);
  color: #555;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-read-more {
  font-size: 14px;
  color: #007bff;
  text-decoration: none;
}

.btn-read-more:hover {
  text-decoration: underline;
}

.full-width {
  width: 100%;
}

/* Responsive pour les posts */
@media (max-width: 768px) {
  .post-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    margin: 0;
  }

  .post-image {
    width: 80px;
    height: 80px;
  }

  .post-title {
    font-size: 16px;
    white-space: normal;
  }

  .post-text {
    -webkit-line-clamp: 4;
  }
}

/* =========================================
   HERO & ALERT CAROUSEL
   ========================================= */
.hero-container {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 0;
}

.hero-image {
  opacity: 0.5;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

#alert-carousel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 1200px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  cursor: pointer;
}

.carousel-content {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.alert-slide {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.alert-slide.active {
  opacity: 1;
  visibility: visible;
}

.carousel-control {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: white;
  font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
  #alert-carousel {
    width: 95%;
    padding: 8px;
    min-height: auto;
  }

  .alert-slide {
    font-size: 14px;
    padding: 10px;
    white-space: normal;
    word-wrap: break-word;
  }

  .carousel-control {
    font-size: 18px;
  }
}

/* =========================================
   TABLE & FILTER BOX
   ========================================= */
.table-container {
  max-height: 70vh;
  overflow-y: auto;
  border: 1px solid #ddd;
  background: white;
  position: relative;
}

.table-container table {
  width: 100%;
}

.table-container thead {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
}

.filter-box {
  background-color: #88B04B; /* Vert intermédiaire */
  padding: 15px;
  border-radius: 8px;
}

.icon {
  width: 16px;
  height: 16px;
}

.big-icon {
  width: 30px;
  height: 30px;
  margin-right: 10px;
}

/* Sticky sidebar (ex : gestion des événements) */
.sticky-sidebar {
  position: sticky;
  top: 80px;
  height: calc(100vh - 100px);
  overflow-y: auto;
}

/* Responsive filtres */
@media (max-width: 768px) {
  .filter-box {
    display: none;
  }

  .filter-box.show {
    display: block;
  }

  .table-responsive {
    overflow-x: auto;
  }

  .table-container table {
    min-width: 600px;
  }
}

/* =========================================
   TITRE, RÔLES, BOUTONS, ETC.
   ========================================= */
.title {
  color: #008000;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
}

.role {
  font-size: 18px;
  margin-bottom: 20px;
}

.role-user {
  color: #008000;
  font-weight: bold;
}

.button-container {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 1%;
}

.btn {
  background-color: #6D8F69;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.btn:hover {
  background-color: #4C6F49;
}

.btn-secondary {
  background-color: #888;
}

.btn-secondary:hover {
  background-color: #666;
}

@media (max-width: 768px) {
  .button-container {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
  }
}

/* =========================================
   CHAMPS DYNAMIQUES (prix, date, etc.)
   ========================================= */
.hidden-field {
  display: none;
}

#prix-container,
#date_limite_container {
  width: 100%;
  margin-top: 10px;
}

#prix-container label,
#date_limite_container label {
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

#prix-container input,
#date_limite_container input {
  background-color: #6D8F69;
  color: white;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #6D8F69;
  font-size: 16px;
  width: 100%;
}

#prix-container input::placeholder,
#date_limite_container input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

#prix-container input:focus,
#date_limite_container input:focus {
  outline: none;
  border: 1px solid #4C6F49;
  background-color: #5A7E57;
}

/* =========================================
   BOUTON DE TÉLÉCHARGEMENT
   ========================================= */
.download-btn {
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 1000px; /* Ajuster la valeur si besoin */
  padding: 12px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
}

/* =========================================
   BOUTONS RADIO
   ========================================= */
.form-check-input {
  all: unset;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  accent-color: #00432F; /* Couleur de sélection */
}

.form-check-input:checked {
  background-color: #00432F;
  border: 4px solid white;
  box-shadow: 0 0 0 2px #00432F;
}

.radio-group {
  display: flex;
  gap: 20px; /* Espace entre les réponses */
}

.form-check {
  display: flex;
  align-items: center;
  gap: 5px;
}

@media (max-width: 768px) {
  .radio-group {
    flex-direction: row;
    justify-content: center;
  }
}

