/* === BASE === */
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: #f8f9fa;
  color: #222;
}

/* === SIDEBAR SCROLLABLE === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 260px;
  background-color: #047a99;
  color: white;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 1rem;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 2001;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.1);
}

/* Scrollbar Chrome / Edge / Safari */
.sidebar::-webkit-scrollbar {
  width: 8px;
}
.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

/* === LOGO ET LIENS DE LA SIDEBAR === */
.sidebar .logo {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  padding: 1rem;
  text-align: center;
  background: rgba(255,255,255,0.1);
}

.sidebar nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar nav ul li a {
  display: block;
  color: white;
  padding: 0.8rem 1rem;
  text-decoration: none;
  transition: background 0.3s;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
  background-color: rgba(255,255,255,0.2);
}

.sidebar nav ul li a i,
.chapter-toggle span i {
  margin-right: 8px;
  width: 18px;
  text-align: center;
  color: white;
}
/*.sidebar-footer {
  border-top: 1px solid #ddd;
  padding: 1rem;
  text-align: center;
}

.sidebar-footer .footer-link {
  display: inline-block;
  color: #047a99;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.sidebar-footer .footer-link:hover {
  color: #035d73;
}
/* === CHAPITRES ET CRITÈRES === */
.chapter-item {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.chapter-toggle {
  width: 100%;
  background: none;
  border: none;
  color: white;
  text-align: left;
  font-size: 1rem;
  padding: 0.8rem 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

.chapter-toggle:hover {
  background: rgba(255,255,255,0.15);
}

.arrow {
  transition: transform 0.3s ease;
}
.chapter-toggle[aria-expanded="true"] .arrow {
  transform: rotate(90deg);
}

/* Liste des critères */
.criteres-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  border-left: 1px solid rgba(255,255,255,0.2);
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

/* Animation d'apparition douce */
.criteres-list.show {
  max-height: 500px;
  opacity: 1;
  animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.criteres-list li a {
  display: block;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  transition: background 0.3s ease;
}
.criteres-list li a:hover {
  color: #fff;
  background-color: rgba(255,255,255,0.15);
  text-decoration: underline;
}

/* === MAIN CONTENT === */
.main-content {
  margin-left: 260px;
  padding: 2rem;
  transition: margin-left 0.3s;
  padding-bottom: 250px; /* pour laisser la place au PDCA */
}

/* === BURGER MENU === */
.burger {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  margin: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.burger:hover {
  background-color: #036c88;
  transform: scale(1.05);
}

/* === VERSION MOBILE === */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80%;
    max-width: 320px;
    background-color: #047a99;
    transform: translateX(-100%);
    z-index: 1000;
    padding-top: 100px;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .burger {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2001;
    background-color: #047a99;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  }

  .burger:hover {
    background-color: #036c88;
  }

  .main-content {
    margin-left: 0;
    padding: 4rem 1.5rem 6rem;
  }
}

/* Version desktop : burger masqué */
@media (min-width: 769px) {
  .burger {
    display: none;
  }
}


/* === PDCA FIXÉ EN BAS === */
.pdca-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0.6rem 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 1200;
}

.pdca-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #d0e6eb;
  color: #047a99;
  font-weight: bold;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}
.pdca-circle.active {
  background-color: #047a99;
  color: white;
  transform: scale(1.1);
}

/* === SECTIONS PDCA === */
.pdca-section {
  margin: 3rem 0;
  padding: 2rem;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.pdca-section h2 {
  color: #047a99;
}

/* === PAGE CHAPITRE === */
.criteres-listing {
  margin-top: 2rem;
}
.criteres-listing h2 {
  color: #047a99;
  margin-bottom: 1.5rem;
}
.criteres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.critere-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* ✅ espace entre le contenu et le bouton */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 250px; /* facultatif : garde une hauteur homogène */
}
.critere-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.critere-card h3 {
  color: #047a99;
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.critere-card p {
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 1rem;
}


/* === LIEN RETOUR AU CHAPITRE === */
.retour-chapitre {
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}
.retour-chapitre a {
  color: #047a99;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}
.retour-chapitre a:hover {
  color: #035f78;
  text-decoration: underline;
}

/* === PAGE INDEX === */
.chapitres-listing h2 {
  color: #047a99;
  margin-bottom: 1.5rem;
}
.chapitres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.chapitre-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 1.5rem;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.chapitre-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.chapitre-card h3 {
  color: #047a99;
  margin-top: 0;
}
.chapitre-card p {
  flex-grow: 1;
  color: #333;
  font-size: 0.95rem;
  margin: 0.8rem 0 1.2rem;
}
/* Empêche l’overlay de bloquer la sidebar */
.overlay {
  pointer-events: none; /* empêche toute interaction */
}

.overlay.show {
  pointer-events: auto; /* réactive quand visible */
}
.progress-container {
  background-color: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  height: 10px;
  margin: 10px 0;
}

.progress-bar {
  background-color: #047a99;
  height: 10px;
  width: 0;
  transition: width 0.8s ease-in-out;
}

.progress-text {
  font-size: 0.85rem;
  color: #047a99;
  margin-bottom: 0.5rem;
  text-align: right;
}
.pdca-details {
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  margin-bottom: 0.8rem;
  margin-top: auto;
}

.pdca-details span {
  color: #047a99;
  font-weight: 500;
}
/* === Pastilles d’état d’avancement === */
.pastille {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.pastille-rouge {
  background-color: #dc2626; /* rouge */
}

.pastille-orange {
  background-color: #f59e0b; /* orange */
}

.pastille-vert {
  background-color: #16a34a; /* vert */
}
.btn-voir {
  display: inline-block;
  background: #047a99;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  transition: background 0.3s ease;
  margin-top: 1rem;
}

.btn-voir:hover {
  background: #036c88;
}
/* --- Section spéciale "Éléments transversaux" --- */
.special-section {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.special-section > .chapter-toggle {
  background: rgba(255,255,255,0.05);
  font-weight: 600;
  color: #ffd633; /* ton jaune Engagé RSE */
}

.special-section ul li a {
  color: #f1f1f1;
}

.section-separator {
  list-style: none;
  height: 1px;
  margin: 0.5rem 0;
  background: rgba(255,255,255,0.2);
}
.chapter-toggle .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}

.chapter-toggle .arrow.rotated {
  transform: rotate(90deg);
}
/* Conteneur global des boutons de navigation */
#next {
  display: flex;
  justify-content: space-between; /* ✅ un à gauche, un à droite */
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
  gap: 1rem;
}

/* Style commun aux deux boutons */
.btn-prev,
.btn-next {
  background-color: #047a99; /* Bleu CFA Interpro */
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

/* Effets de survol */
.btn-prev:hover,
.btn-next:hover {
  background-color: #035d73;
  transform: translateY(-2px);
}

/* Spécifique au bouton précédent */
.btn-prev {
  background-color: #999; /* gris doux pour contraste visuel */
}

.btn-prev:hover {
  background-color: #777;
}

/* Responsive : boutons centrés en colonne sur mobile */
@media (max-width: 768px) {
  #next {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-prev,
  .btn-next {
    width: 100%;
    text-align: center;
  }
}
/* === FOOTER DE LA SIDEBAR === */
.sidebar {
  display: flex;
  flex-direction: column;
}

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 32px;
}

/* ✅ Fixe le footer visible en bas */
.sidebar-footer {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
  padding: 1rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-footer .footer-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease, transform 0.2s ease;
}

.sidebar-footer .footer-link:hover {
  color: #FFD633;
  transform: translateY(-2px);
}

.sidebar-footer i {
  color: #FFD633;
}
.sidebar-footer {
  position: sticky;
  bottom: 20px;
}
/* === FILTRES – STYLE PROFESSIONNEL RSE === */

.filters {
    background: #ffffff;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.filters select,
.filters input[type="text"] {
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid #cfd9df;
    background: #f9fbfc;
    font-size: 0.95rem;
    color: #1f2a44;
    outline: none;
    min-width: 180px;
    transition: 0.2s ease-in-out;
    font-family: 'Inter', sans-serif;
}

.filters select:focus,
.filters input[type="text"]:focus {
    border-color: #047a99;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(4, 122, 153, 0.20);
}

.filters .filter-btn {
    background: #047a99;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.filters .filter-btn:hover {
    background: #036c88;
}

@media (max-width: 768px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filters select,
    .filters input[type="text"],
    .filters .filter-btn {
        width: 100%;
    }
}
