body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f9fbfd;
}

/* Header */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #0d47a1, #42a5f5, #ffca28);
  color: #fff;
  padding: 15px;
  text-align: center;
}
header h1 {
  margin: 0;
  font-size: 1.8em;
}
header h1 .highlight { 
  color: #ffca28;
}

.nav-btns {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.nav-btns span { font-weight: bold; }
.nav-btns button {
  background: rgba(255,255,255,0.2);
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  color: white;
  font-size: 1.2em;
  cursor: pointer;
}
.nav-btns button:hover { background: rgba(255,255,255,0.4); }

/* Filtre */
.filter-bar {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 5px;
  font-size: 0.9em;
}
.filter-bar select {
  padding: 4px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Calendrier */
#calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 10px;
  margin-top: 170px;
}
.day {
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 5px;
  min-height: 90px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.day.today { border: 2px solid #1976d2; }

/* Badge jour */
.day-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 12px;
  background: #e0e0e0;
  color: #333;
  font-size: 0.85em;
  font-weight: bold;
}
.day.today .day-badge {
  background: #e53935;
  color: white;
}

/* Badges activités */
.event-badge {
  border-radius: 4px;
  padding: 2px 4px;
  margin-top: 3px;
  font-size: 0.8em;
  color: white;
  font-weight: bold;
}
.event-badge.vtt          { background: #ff5252; }
.event-badge.cyclisme     { background: #42a5f5; }
.event-badge.rando        { background: #66bb6a; }
.event-badge.trail        { background: #ff9800; }
.event-badge.cap          { background: #ffeb3b; color: black; }
.event-badge.competition  { background: #8e24aa; }
.event-badge.autre        { background: #9e9e9e; }
.event-badge.multi        { background: #bdbdbd; color: black; }

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 95%;
  max-width: 420px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.modal-content h2 {
  margin-top: 0;
  text-align: center;
  color: #0d47a1;
}
.modal-content label {
  font-weight: bold;
  display: block;
  margin-top: 10px;
}
.modal-content input,
.modal-content textarea,
.modal-content select {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 5px;
}
.modal-content textarea {
  resize: vertical;
  min-height: 60px;
}

/* Actions */
.modal-actions {
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-save {
  background: #1976d2;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-cancel {
  background: #ccc;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-delete {
  background: #e53935;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2em;
}
.btn-delete:hover { background: #c62828; }

/* Boutons sports */
.sport-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
  justify-content: center;
}
.sport-btn {
  flex: 1;
  min-width: 70px;
  height: 70px;
  border: none;
  border-radius: 50%;
  text-align: center;
  cursor: pointer;
  font-size: 0.9em;
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sport-btn.selected { border: 3px solid black; }

/* Couleurs boutons */
.sport-btn[data-sport="VTT"]          { background: #ff5252; }
.sport-btn[data-sport="Cyclisme"]     { background: #42a5f5; }
.sport-btn[data-sport="Rando"]        { background: #66bb6a; }
.sport-btn[data-sport="Trail"]        { background: #ff9800; }
.sport-btn[data-sport="Course à pied"]{ background: #ffeb3b; color: black; }
.sport-btn[data-sport="Compétition"]  { background: #8e24aa; }
.sport-btn[data-sport="Ski"]          { background: #0288d1; }
.sport-btn[data-sport="Autre"]        { background: #9e9e9e; }

/* Bouton aujourd'hui */
#todayBtn {
  position: fixed;
  bottom: 20px; right: 20px;
  background: #1976d2;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px; height: 60px;
  font-size: 1.2em;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 2000;
}
#todayBtn:hover { background: #0d47a1; }

/* Mobile */
@media (max-width: 768px) {
  #calendar {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .day { min-height: 110px; font-size: 0.85em; }
  .day-badge { font-size: 0.75em; padding: 2px 5px; }
  .event-badge { font-size: 0.7em; line-height: 1.2em; padding: 4px; }
  header h1 { font-size: 1.3em; }
  .nav-btns span { font-size: 1em; }
}
