/* ===== BASE ===== */

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #1a1a1a;

  /* Logo en fond */
  background-image: url("img/logo-dawp.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 35%;
  background-attachment: fixed;

  background-color: #0b2c4d;
}

/* voile blanc pour lisibilité */
#app {
  min-height: 100vh;
  background-color: rgba(255,255,255,0.95);
  padding: 20px;
}


/* ===== TITRES ===== */

h1 {
  text-align: center;
  color: #0b2c4d;
  margin-bottom: 30px;
}

h2 {
  color: #0b2c4d;
}

h3 {
  color: #1f5fa3;
}


/* ===== LISTES EVENEMENTS ===== */

.evenement {
  list-style: none;
  background: white;
  margin: 8px 0;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: 0.2s;
}

.evenement:hover {
  transform: translateY(-2px);
  background-color: #f0f6ff;
}


/* ===== BOUTONS ===== */

button {
  background-color: #1f5fa3;
  color: white;
  border: none;
  padding: 8px 14px;
  margin: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  background-color: #174a80;
}


/* ===== INPUTS ===== */

input {
  padding: 6px;
  margin: 4px;
  border-radius: 6px;
  border: 1px solid #ccc;
}


/* ===== POSTES ===== */

.poste {
  background: #f8fbff;
  padding: 12px;
  margin: 12px 0;
  border-radius: 10px;
  border-left: 5px solid #1f5fa3;
}


/* ===== TABLEAUX ===== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
}

th {
  background-color: #1f5fa3;
  color: white;
  padding: 8px;
}

td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
}

tr:hover {
  background-color: #f2f7ff;
}

/* ===== PASTILLES VERTES / ROUGES ===== */
.pastille-verte {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: green;
  border-radius: 50%;
  margin-right: 6px;
}

.pastille-rouge {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-color: red;
  border-radius: 50%;
  margin-right: 6px;
}

.vide {
  color: #777;
  font-style: italic;
}

/* ===== CALENDRIER - PASTILLES ALIGNÉES ===== */
table td div {
  display: flex;
  align-items: center;
  margin-bottom: 4px; /* petit espace entre postes */
}

table td div span {
  flex-shrink: 0;         /* la pastille garde sa taille */
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;      /* espace entre pastille et texte */
}

.pastille-verte {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: green;
  border-radius: 50%;
  margin-right: 6px;
}

.pastille-rouge {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: red;
  border-radius: 50%;
  margin-right: 6px;
}

.badge {
  display: inline-block;
  background: #3498db;
  color: white;
  padding: 4px 8px;
  margin: 2px;
  border-radius: 12px;
  font-size: 12px;
}
.badge {
  background: #2ecc71; /* vert */
}

.badge.resp {
  background: #e74c3c; /* rouge */
}

.event-dates {
  display: flex;
  gap: 24px;
  margin: 12px 0;
  align-items: center;
}

.event-dates label {
  font-weight: bold;
  color: #0b2c4d;
  margin-right: 8px;
}

.event-dates input {
  padding: 6px 10px;
  border: 1px solid #1f5fa3;
  border-radius: 6px;
}

.event-title {
  font-size: 2em;           /* même taille que h2 */
  font-weight: bold;
  color: #0b2c4d;
  margin: 0.67em 0;         /* marge par défaut d'un h2 */
}

h2 input {
  font-size: 1.5em;         /* un peu plus gros que les autres inputs */
  font-weight: bold;
  width: 100%;
  max-width: 600px;
  padding: 4px 8px;
  border: 1px solid #1f5fa3;
  border-radius: 6px;
  background: #f8fbff;
}

.event-cell {
  white-space: normal;          /* permet le retour à la ligne */
  line-height: 1.4;
}

.event-name {
  font-weight: bold;
  margin-bottom: 2px;
}

.event-lieu {
  color: #555;
  font-size: 0.92em;
}

.calendrier-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.calendrier-table th {
  background: #1f5fa3;
  color: white;
  padding: 12px 14px;
  font-weight: 600;
  text-align: left;
}

.calendrier-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e8ecef;
  vertical-align: middle;
}

.event-row {
  transition: background-color 0.18s ease;
}

.event-row:hover {
  background-color: rgba(0,0,0,0.04) !important;
  /* Le !important est nécessaire car on a déjà un background inline par événement */
}

/* Amélioration lisibilité cellules fusionnées */
.event-date-cell,
.event-name-cell,
.event-lieu-cell {
  font-weight: 500;
  background: inherit; /* reprend la couleur de la ligne */
  border-right: 1px solid #ddd;
}

/* Légère séparation visuelle entre événements */
tbody tr:last-child td {
  border-bottom: none;
}

/* Pastilles plus visibles */
.pastille-verte {
  background: #28a745;
  width: 12px;
  height: 12px;
  margin-right: 8px;
}

.pastille-rouge {
  background: #dc3545;
  width: 12px;
  height: 12px;
  margin-right: 8px;
}

.badge {
  background: #e9ecef;
  color: #333;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  margin: 0 3px 3px 0;
  display: inline-block;
}

.section-accordeon {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #ddd;
}

.accordeon-header {
  cursor: pointer;
  padding: 12px 16px;
  background: #f8f9fa;
  margin: 0;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.accordeon-header:hover {
  background: #e9ecef;
}

.toggle {
  font-size: 1.1em;
  min-width: 20px;
}

.count {
  color: #666;
  font-size: 0.9em;
  margin-left: auto;
}

.accordeon-content {
  padding: 0 16px 16px;
  background: white;
}

.evenement.past {
  opacity: 0.75;
  color: #555;
}

/* MOBILE */
@media (max-width: 700px) {
  table td div {
    flex-wrap: wrap;      /* si texte trop long, passe à la ligne */
  }
}

.mes-affectations {
  background: #f0f9ff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.mes-affectations h2 {
  margin-top: 0;
}