/* ========================= */
/* Variables globales        */
/* ========================= */
:root {
  --primary: #031b4e; /* Couleur principale */
  --blue-dark: #0a1b4c; /* Bleu foncé */
  --grey-light: #f5f5f5; /* Gris clair pour les cartes */
  --grey-mid: #e6e6e6; /* Gris moyen pour les séparateurs */
  --text-dark: #000; /* Texte sombre */
  --text-light: #4a4a4a; /* Texte clair */
  --card-shadow: rgba(0, 0, 0, 0.08); /* Ombre des cartes */
  --border-radius: 20px; /* Rayon de bordure par défaut */
}

/* ========================= */
/* Styles globaux            */
/* ========================= */
* {
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body, html {
  margin: 0;
  padding: 0;
  background-color: #fff;
  color: var(--text-dark);
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========================= */
/* Header                    */
/* ========================= */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: #fff;
  border-bottom: 1px solid var(--grey-mid);
}

.logo {
  height: 70px;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.info-text {
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-dark);
}

/* ========================= */
/* Navbar                    */
/* ========================= */
.navbar {
  display: flex;
  justify-content: center;
  gap: 30px;
  background-color: var(--grey-mid);
  padding: 16px 0;
}

.navbar {
  display: flex;
  justify-content: center;
  gap: 40px;
  background-color: var(--grey-mid);
  padding: 20px 0;
}

.navbar button {
  background-color: var(--blue-dark);
  color: white;
  padding: 16px 40px;
  border: none;
  border-radius: 16px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease-in-out;
  min-width: 180px;
  text-align: center;
}

.navbar button:hover {
  background-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.navbar button::after {
  content: '›';
  position: absolute;
  right: 18px;
  font-size: 20px;
}

/* ========================= */
/* Main Content              */
/* ========================= */
main {
  padding: 30px 60px;
  flex: 1;
}

/* ========================= */
/* Search Section            */
/* ========================= */
.search-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 40px;
}

.search-section label {
  background-color: var(--grey-mid);
  padding: 12px 25px;
  border-radius: 10px;
  font-weight: 600;
  margin-bottom: 15px;
}

.search-section input {
  padding: 12px 20px;
  border-radius: 30px;
  border: 1px solid #ccc;
  width: 280px;
  font-size: 14px;
}

.encadre-haut {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 40px 60px 30px;
  gap: 20px;
}

.encadre-gauche {
  background-color: var(--grey-mid);
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
  white-space: nowrap;
}

.search-wrapper {
  position: relative;
  width: 280px;
}

#search-input {
  width: 100%;
  padding: 10px 35px 10px 20px;
  border-radius: 30px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: #aaa;
  cursor: pointer;
  display: block; /* ✅ toujours visible */
  opacity: 0.4;
  pointer-events: auto;
}

/* ========================= */
/* Propositions Grid         */
/* ========================= */
.propositions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-width: 1200px;
  margin: 0 auto;
  gap: 40px;
  justify-items: center;
}

/* ========================= */
/* Proposition Cards         */
/* ========================= */
.proposition-card {
  background-color: var(--grey-light);
  border-radius: 25px;
  padding: 20px 24px;
  width: 230px;
  box-shadow: 0 4px 12px var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  transition: transform 0.2s;
  height: 400px; /* Hauteur fixe pour toutes les cartes */
  overflow: hidden; /* Cache le contenu qui dépasse */
}

.proposition-card:hover {
  transform: scale(1.02);
}

.proposition-card .icon {
  width: 38px;
  height: 38px;
  margin-bottom: 8px;
}

/* ========================= */
/* Card Header               */
/* ========================= */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
}

.prop-id {
  font-weight: bold;
  font-size: 16px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 2px;
}

/* ========================= */
/* Action Buttons            */
/* ========================= */
.btn-delete {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.btn-delete img {
  width: 18px;
  height: 18px;
}

.action-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: relative;
}

.btn-edit {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.btn-edit img {
  width: 18px;
  height: 18px;
}

.departement-text {
  font-size: 13px;
  margin-top: 4px;
  color: #333;
  text-align: right;
}

/* ========================= */
/* Dropdown Menu             */
/* ========================= */
.dropdown-menu {
  position: absolute;
  top: 25px;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 5px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  display: none;
  z-index: 10;
}

.dropdown-menu button {
  padding: 6px 12px;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: 14px;
}

.dropdown-menu button:hover {
  background-color: #f0f0f0;
}

/* ========================= */
/* Card Content              */
/* ========================= */
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto; /* Permet de défiler si le contenu est trop grand */
  flex: 1; /* Prend tout l'espace disponible */
  scrollbar-width: thin; /* Pour Firefox */
  scrollbar-color: #ccc transparent; /* Pour Firefox */
}

/* Style de la barre de défilement pour Chrome/Safari */
.card-content::-webkit-scrollbar {
  width: 6px;
}

.card-content::-webkit-scrollbar-track {
  background: transparent;
}

.card-content::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

.card-content h4 {
  margin: 5px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.card-content p {
  margin: 0; /* Suppression des marges par défaut */
  font-size: 13px;
  color: var(--text-light);
}

/* ========================= */
/* Form Controls             */
/* ========================= */
.btn-toggle-demi {
  background-color: #eee;
  border: 1px solid #ccc;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.75em;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-toggle-demi.active {
  background-color: #d9534f;
  color: white;
  border-color: #d43f3a;
}

/* ========================= */
/* Responses Section         */
/* ========================= */
.reponses-section {
  border-top: 1px solid #eee;
  margin-top: 8px;
  padding-top: 8px;
  margin-bottom: 0; /* S'assurer qu'il n'y a pas de marge en bas */
}

.reponses-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0; /* S'assurer qu'il n'y a pas de marge en bas */
}

.btn-toggle-reponses {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.arrow-icon {
  width: 12px;
  height: 12px;
  transition: transform 0.3s ease;
}

.reponses-header p {
  margin: 0; /* Suppression des marges pour le paragraphe dans le header */
}

.reponses-list {
  margin-top: 8px;
  border-top: 1px dashed #eee;
  padding-top: 8px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin; /* Pour Firefox */
  scrollbar-color: #ccc transparent; /* Pour Firefox */
}

/* Style de la barre de défilement pour Chrome/Safari */
.reponses-list::-webkit-scrollbar {
  width: 6px;
}

.reponses-list::-webkit-scrollbar-track {
  background: transparent;
}

.reponses-list::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

/* ========================= */
/* Trainer Response Items    */
/* ========================= */
.reponse-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;  /* Changé de center à flex-start */
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.formateur-info {
  flex: 1;
  padding-right: 15px;
}

.formateur-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.creneaux {
  font-size: 12px;
  color: #666;
  margin: 0;
  line-height: 1.4;
  white-space: pre-line; /* Pour permettre les retours à la ligne */
}

/* ========================= */
/* Action Buttons for Trainers */
/* ========================= */
.action-buttons {
  display: flex;
  gap: 8px;
  padding-top: 2px;  /* Pour aligner avec le nom */
}

.btn-valider, .btn-refuser {
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: transform 0.2s;
}

.btn-valider:hover, .btn-refuser:hover {
  transform: scale(1.1);
}

.btn-valider {
  background-color: #4CAF50;
  color: white;
}

.btn-refuser {
  background-color: #f44336;
  color: white;
}

/* ========================= */
/* Time Slots Section        */
/* ========================= */
.formateur-section {
  width: 100%;
}

.formateur-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 0;
}

.creneaux-section {
  margin-left: 15px;
  margin-top: 5px;
}

.btn-toggle-creneaux {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
}

.btn-toggle-creneaux .arrow-icon {
  width: 10px;
  height: 10px;
  transition: transform 0.3s ease;
}

.creneaux-list {
  margin-left: 20px;
  margin-top: 5px;
}

.creneau-date {
  font-size: 12px;
  color: #666;
  margin: 4px 0;
}

/* ========================= */
/* Footer                    */
/* ========================= */
footer {
  background-color: var(--blue-dark);
  height: 60px;
  margin-top: auto;
}

/* ========================= */
/* Responsive Design         */
/* ========================= */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .user-info {
    flex-direction: column;
    align-items: center;
  }

  .navbar {
    flex-direction: column;
    gap: 15px;
    padding: 20px 0;
  }

  .navbar button {
    width: 80%;
    text-align: center;
    padding: 10px 20px;
  }

  main {
    padding: 20px;
  }

  .proposition-card {
    width: 90%;
  }
}