/* Global */
.calendar-wrapper {
  max-width: 1100px;
  margin: 30px auto;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  direction: rtl; /* IMPORTANT pour l’arabe */
}

/* Toolbar */
.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  background: #f8f9fa;
  padding: 12px 16px;
  border-radius: 8px;
}

.calendar-toolbar button {
  background: rgb(1, 107, 104);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.calendar-toolbar button.secondary {
  background: #6c757d;
}

.calendar-toolbar button:hover {
  opacity: 0.9;
}

.calendar-title {
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

/* Calendar grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.day-cell {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px;
  min-height: 140px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.day-number {
  font-weight: bold;
  margin-bottom: 6px;
  color: rgb(1, 107, 104);
  font-size: 14px;
}

/* Event card */
.event {
  background: #e7f1ff;
  color: rgb(1, 107, 104);
  padding: 6px 8px;
  margin-top: 6px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  border-right: 4px solid rgb(1, 107, 104);
}

.event:hover {
  background: #d0e3ff;
}

/* Popup */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.popup {
  background: #fff;
  width: 360px;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}

.popup h3 {
  margin-top: 0;
  color: rgb(1, 107, 104);
}

.popup p {
  margin: 8px 0;
  font-size: 14px;
}

.popup button {
  margin-top: 10px;
  background: #dc3545;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.calendar-grid.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.day-cell {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 4px; /* Espace entre les événements */
}
.event {
  background: rgb(1, 107, 104);
  color: white;
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 0.8em;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
