/* === BASE === */
body {
  background-color: #f0f4f8;
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  padding: 0;
  padding-top: 30px;
}

h2, h3 {
  color: #2c3e50;
}

/* === BOUTONS === */
button, .btn {
  font-weight: bold;
  border-radius: 6px;
}

.new-patient {
  background-color: #cce5ff !important; /* bleu clair */
}

.btn-primary {
  background-color: #007bff;
  color: white;
  border: none;
}

.btn-success {
  background-color: #28a745;
  color: white;
  border: none;
}

/* === LOGIN PAGE === */
.login-container {
  text-align: center;
  width: 300px;
  margin: 100px auto;
  padding: 20px;
  background: white;
  border-radius: 8px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.login-logo {
  width: 150px;
  margin-bottom: 15px;
  border-radius: 8px; 
}

.login-container h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.login-container .form-control {
  margin-bottom: 15px;
}

#login_btn {
  width: 100%;
  margin-top: 10px;
}

.login-container .spinner-border {
  margin-top: 10px;
}

/* === SPINNER (chargement session + bouton login) === */
.spinner-border {
  display: inline-block;
  vertical-align: middle;
  border: 0.25em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner-border 0.75s linear infinite;
  width: 1.5rem;
  height: 1.5rem;
}


@keyframes spinner-border {
  100% {
    transform: rotate(360deg);
  }
}

/* ---------- PRESENCE PAGE ---------- */

.badge {
  font-size: 0.85rem;
  padding: 0.4em 0.6em;
  border-radius: 0.5rem;
  color: white;
}

.bg-primary { background-color: #007bff; }
.bg-danger  { background-color: #dc3545; }
.bg-success { background-color: #28a745; }
.bg-secondary { background-color: #6c757d; }


.fixed-top {
  height: 60px !important;
  padding: 0.3rem 1rem !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
}

/* ---------- STRUCTURE DE BASE ---------- */


/* Ligne d'en-tête : toujours au-dessus */
#presence-table thead th {
  position: sticky;
  top: 0;
  z-index: 1; /* faible = passe derrière */
  background-color: #f8f9fa;
}

/* Séances normales */
#presence-table th,
#presence-table td {
  z-index: 1;
}

#presence-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

#presence-table th, #presence-table td {
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
  padding: 4px 8px;
}

/* Colonne "Participant" fixe à 120px */
#presence-table th:first-child,
#presence-table td:first-child {
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  position: sticky;
  left: 0;
  z-index: 3;
  background-color: white;
  text-align: left;
  white-space: normal;
}

/* Colonne "Doc. admin" fixe à 80px */
#presence-table th:nth-child(2),
#presence-table td:nth-child(2) {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

/* Colonnes Séances fixes à 160px */
#presence-table tbody td:nth-child(n+3) {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
}

#presence-table thead th:nth-child(n+3) {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
}

/* Figer les deux premières colonnes horizontalement */
.table-scroll {
  overflow-x: auto;
  position: relative;
}

/* Première colonne ("Patient") fixe */
#presence-table th:first-child,
#presence-table td:first-child {
  position: sticky;
  left: 0;
  background-color: white;
  z-index: 2; /* juste au-dessus du reste */
}

/* Deuxième colonne ("Doc. admin") fixe */
#presence-table th:nth-child(2),
#presence-table td:nth-child(2) {
  position: sticky;
  left: 100px;
  background-color: white;
  z-index: 2;
}


.table-scroll thead th {
  top: 0;
  position: sticky;
  z-index: 10;
  background-color: #f8f9fa;
}

/* Scroll horizontal toujours actif */
.table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  position: relative;
  z-index: 1;
}

.select-wrapper {
  position: relative;
  z-index: 11;
}

/* Ne pas forcer le scroll horizontal sur mobile */
@media (max-width: 768px) {
  .table-scroll {
    overflow-x: auto;
  }
}
