/* --- MODE NUIT --- */
body {
  font-family: Arial, sans-serif;
  margin:0; padding:0;
  background:#111; color:#fff;
}

.top-bar {
  text-align:center;
  margin:10px;
}

.top-bar button {
  padding:5px 10px;
  background:#333;
  color:#fff;
  border:none;
  border-radius:5px;
  cursor:pointer;
}

.month-nav {
  text-align:center;
  margin:10px 0;
}

.month-nav button {
  padding:5px 10px;
  margin:0 5px;
  background:#333;
  color:#fff;
  border:none;
  border-radius:5px;
  cursor:pointer;
}

#month-year { font-weight:bold; font-size:1.2em; margin:0 10px; }

#calendar {
  width:80%;
  margin:10px auto;
  display:grid;
  grid-template-rows:auto 1fr;
  border:2px solid #555;
  border-radius:10px;
  padding:10px;
  background:#1a1a1a;
}

.calendar-grid {
  display:grid;
  grid-template-columns:repeat(7,1fr);
  grid-auto-rows:80px;
  gap:5px;
}

.day {
  background:rgba(255,255,255,0.05);
  border-radius:8px;
  cursor:pointer;
  position:relative;
  overflow:hidden;
  transition:0.3s;
  max-height:80px;
}

.day:hover { box-shadow:0 0 10px #fff; }

.day-number { font-weight:bold; display:block; margin-bottom:3px; }

.event-bubble {
  display:block;
  padding:2px 4px;
  margin:1px 0;
  border-radius:4px;
  font-size:0.7em;
  font-weight:bold;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  background: rgba(255,255,255,0.2);
}

#modal {
  position:fixed;
  top:0; left:0;
  width:100%; height:100%;
  background:rgba(0,0,0,0.8);
  display:none;
  justify-content:center;
  align-items:center;
  z-index:10000;
}

.modal-content {
  background:#222;
  padding:20px;
  border-radius:10px;
  width:60%;
  max-width:500px;
  position:relative;
}

#close {
  position:absolute;
  top:10px;
  right:15px;
  cursor:pointer;
  font-size:25px;
}

#add-event-form { display:none; margin-top:15px; background:#333; padding:15px; border-radius:8px; }

.form-row {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}

.form-row input[type="text"], 
.form-row input[type="time"], 
.form-row input[type="date"], 
.form-row select { flex:1; padding:8px; border-radius:5px; border:none; font-size:1em; }

.form-row input[type="checkbox"] { transform:scale(1.2); margin-right:5px; }

#save-event, #show-add-event {
  width:100%;
  padding:10px;
  font-size:1em;
  font-weight:bold;
  border-radius:8px;
  border:none;
  background:#33b59d;
  color:#fff;
  cursor:pointer;
  transition:0.2s;
}

#save-event:hover, #show-add-event:hover { background:#2aa48a; }

/* Liste verticale des mois */
#exceptions-months {
  margin-top:10px;
  display:none;
  flex-direction:column;
}

#exceptions-months label:first-child {
  font-weight:bold;
  margin-bottom:5px;
}

.months-checkbox-list {
  display:flex;
  flex-direction:column;
  max-height:200px;
  overflow-y:auto;
}

.months-checkbox-list label {
  margin-bottom:3px;
}

/* --- MODE CLAIR --- */
body.light-mode {
  background:#f5f5f5;
  color:#111;
}

body.light-mode .top-bar button,
body.light-mode .month-nav button {
  background:#ddd;
  color:#111;
}

body.light-mode #calendar {
  background:#e0dfdf;
  border:2px solid #ccc;
}

/* Jours normaux en mode clair */
body.light-mode .day:not(.weekend) {
    background: #858484; /* gris clair */
    color: #949393;
}

/* Week-ends en mode clair */
body.light-mode .day.weekend {
    background: #e0e0e0; /* gris un peu plus foncé */
    color: #888686;
}

body.light-mode .event-bubble {
  background: rgba(95, 94, 94, 0.1);
  color:#2600ff;
}

body.light-mode .modal-content {
  background:#4b4949;
  color:#5c5c5c;
  
}

body.light-mode #exception-months {
  background:#f9f9f9;
  border:1px solid #ccc;
}
