/* =========================
   BASE
========================= */

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #bfc3c9;
  color: #1c1c1e;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

header {
  background: linear-gradient(135deg, #4a90e2, #6aa0e8);
  padding: 15px 10px;
  text-align: center;
  font-size: 1.8rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.container {
  max-width: 1000px;
  width: 100%;
  margin: auto;
  padding: 15px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* =========================
   CALENDRIER
========================= */

.calendar-title-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-header {
  display: inline-flex;        /* prend seulement la largeur du contenu */
  align-items: center;
  padding: 4px 6px;
  background: #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.calendar-header h3 {
  flex: 1;
  text-align: center;
  margin: 0 10px 0 0;          /* espace à droite avant les boutons */
  font-size: 1rem;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  color: #444;
  font-size: 0.85rem;
  padding: 8px 0;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* =========================
   CASES FIXE
========================= */
.day {
  background: #e5e7eb;
  padding: 5px;
  border-radius: 16px;
  min-height: 100px;
  height: 100px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: 0.2s;
  box-sizing: border-box;
  overflow: hidden;
}
.day strong {
  font-size: 0.55rem;
  margin-bottom: 4px;
  color: #000;
  font-weight: 700;
}

/* =========================
   RENDEZ-VOUS DANS LE CALENDRIER
========================= */

.event-info {
  margin-top: 4px;
  background: #ffffff;
  padding: 4px 6px;
  border-radius: 10px;
  font-size: 0.55rem;
  line-height: 1.15;
  color: #000;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  border: 1px solid #999;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  flex-shrink: 0;
  max-height: 32px;
}

/* =========================
   LISTE DES EVENEMENTS
========================= */

.events {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.event {
  background: #e5e7eb;
  border-radius: 14px;
  padding: 15px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  text-align: center;
}

/* =========================
   FORMULAIRES & BOUTONS
========================= */

button {
  background: #4a90e2;
  border: none;
  padding: 6px 10px;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.2s;
}

button:hover {
  background: #357ab7;
}

/* =========================
   BOUTONS CHANGEMENT DE MOIS
========================= */

.nav-btn {
  background: #d1d5db;
  border: 1px solid #999;
  border-radius: 8px;
  padding: 2px 6px;          /* réduit la taille verticale */
  font-size: 0.75rem;
  cursor: pointer;
  width: auto;               /* largeur adaptée au contenu */
  min-width: 0;
  display: inline-flex;       /* centrer texte / flèches */
  align-items: center;
  justify-content: center;
  margin-left: 6px;           /* espace entre les boutons */
}

/* =========================
   FORMULAIRES STANDARD
========================= */

input,
select {
  background: #f3f4f6;
  border: 1px solid #999;
  color: #000;
  border-radius: 6px;
  padding: 4px;
  font-size: 0.85rem;
}

input::placeholder {
  color: #666;
}

.delete-name-btn {
  background: none;
  border: none;
  color: #c00;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.75rem;
}

/* =========================
   TABLEAU DES VOTES
========================= */

.event-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.8rem;
  table-layout: fixed;
}

.event-table th,
.event-table td {
  border: 1px solid #ccc;
  padding: 4px;
  text-align: center;
}

.event-table th {
  background: #d1d5db;
  font-weight: 700;
}

/* =========================
   VOTES
========================= */

.vote-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.vote-inputs,
.vote-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* =========================
   COULEURS DES VOTES
========================= */

.vote-cell-oui {
    background-color: #7CFC00 !important;
    color: #000 !important;
}
.vote-cell-non {
    background-color: #FF7F7F !important;
    color: #000 !important;
}
.vote-cell-ne-sais-pas {
    background-color: #FFA500 !important;
    color: #000 !important;
}

/* =========================
   PETIT ECRAN
========================= */

@media (max-width: 600px) {

  body { font-size: 0.8rem; }

  header {
    font-size: 1.4rem;
    padding: 10px 6px;
  }

  .container {
    width: 100%;
    padding: 6px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

@media (max-width: 600px) {
  .weekday-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.6rem;
    text-align: center;
    margin-bottom: 4px;
  }
}
  .calendar { gap: 4px; }
  .day {
    min-height: 50px;
    height: 50px;
    padding: 2px;
    font-size: 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
  }

.day strong {
  font-size: 1rem;
  margin-bottom: 4px;
  color: #000;
  font-weight: 700;
  flex-shrink: 0;
}
.day .event-info:nth-of-type(n+3) {
  display: none;
}
  .day .event-info {
    display: block;
    position: absolute;
    width: 10px;
    height: 10px;
    background: #7CFC00 !important;
    border-radius: 50%;
	  font-size: 0.65rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
    margin: 0;
    text-indent: -9999px;
  }

  .calendar-header {
    padding: 2px 4px;
    min-height: 0;
  }

  .calendar-header h3 {
    font-size: 0.65rem;
    margin-right: 4px;
  }

  .nav-btn {
    font-size: 0.5rem;
    padding: 1px 2px;
    margin-left: 4px;
  }

  input, select {
    font-size: 0.7rem;
    padding: 3px;
  }
  button { font-size: 0.65rem; padding: 2px 4px; }

  .vote-options {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .event-table { font-size: 0.7rem; }
  .delete-name-btn { font-size: 0.6rem; }
}

/* =========================
   MODAL
========================= */

#event-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #e5e7eb;
  padding: 15px;
  border-radius: 14px;
  z-index: 1001;
  box-shadow: 0 6px 20px rgba(0,0,0,0.7);
}

#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
}
/* =========================
   CASES HORS MOIS (grises)
========================= */

.day.inactive {
  background: #ccc;        /* gris */
  color: #666;             /* texte plus discret */
  pointer-events: none;    /* pas cliquable */
}

.day.inactive strong {
  display: none;           /* masque le numéro */
}

/* Petit écran */
@media (max-width: 600px) {
  .day.inactive {
    min-height: 50px;
    height: 50px;
    padding: 2px;
    background: #ccc;
    color: #666;
  }

  .day.inactive strong {
    display: none;
  }
}

/* ===== AJOUT IMAGE EVENT ===== */
.event-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.event-image {
    max-width: 120px;
}

.event-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* Modal image */
#image-modal {
    display:none;
    position: fixed;
    top:50%;
    left:50%;
    transform: translate(-50%,-50%);
    background:#fff;
    padding:20px;
    z-index:1002;
    border-radius:10px;
    box-shadow:0 0 15px rgba(0,0,0,0.5);
}