/* --- VARIABLES --- */
/* On définit quelques variables locales pour la cohérence */
.fc {
  --fc-page-bg-color: #ffffff;
  --fc-neutral-bg-color: #f9fafb; /* Gray 50 */
  --fc-border-color: #f3f4f6;     /* Gray 100 */
  
  --fc-button-text-color: #374151;
  --fc-button-bg-color: #ffffff;
  --fc-button-border-color: #e5e7eb;
  --fc-button-hover-bg-color: #f3f4f6;
  --fc-button-active-bg-color: #f3f4f6;
  --fc-button-active-border-color: #d1d5db;
  
  --fc-event-bg-color: #eef2ff;   /* Indigo 50 */
  --fc-event-border-color: #6366f1; /* Indigo 500 */
  --fc-event-text-color: #4338ca;   /* Indigo 700 */
  
  --fc-today-bg-color: #fafafa;
  --fc-now-indicator-color: #ef4444;
  
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  padding: 16px;
  border: 1px solid #e5e7eb;
}

/* --- HEADER & TOOLBAR --- */
.fc .fc-toolbar {
  margin-bottom: 1.5rem !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc .fc-toolbar-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827; /* Gray 900 */
  letter-spacing: -0.025em;
}

/* Boutons "Ghost" modernes */
.fc .fc-button {
  background-color: white;
  border: 1px solid #e5e7eb; /* Gray 200 */
  color: #374151; /* Gray 700 */
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px; /* Coins plus arrondis */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  text-transform: capitalize;
}

.fc .fc-button:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
  transform: translateY(-1px);
}

.fc .fc-button-primary:not(:disabled).fc-button-active, 
.fc .fc-button-primary:not(:disabled):active {
  background-color: #f3f4f6;
  border-color: #9ca3af;
  color: #111827;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.fc .fc-button:focus {
  box-shadow: 0 0 0 4px rgba(229, 231, 235, 0.5) !important; /* Ring focus gris doux */
}

/* --- GRILLE & JOURS --- */
.fc-theme-standard td, 
.fc-theme-standard th {
  border-color: var(--fc-border-color);
}

/* En-têtes de jours (Lun, Mar...) */
.fc .fc-col-header-cell-cushion {
  padding: 12px 0;
  color: #6b7280; /* Gray 500 */
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cellules */
.fc-daygrid-day-frame {
  padding: 4px;
}

/* Numéros de jours */
.fc .fc-daygrid-day-number {
  color: #4b5563;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin: 4px;
}

/* Aujourd'hui */
.fc .fc-day-today {
  background-color: transparent !important; /* On retire le fond jaune moche par défaut */
}

.fc .fc-day-today .fc-daygrid-day-number {
  background-color: #111827; /* Pastille noire élégante pour aujourd'hui */
  color: white;
  font-weight: 700;
}

/* Hover sur les jours */
.fc-daygrid-day:hover {
  background-color: #f9fafb;
  cursor: pointer;
}

/* --- ÉVÉNEMENTS (Le cœur du design) --- */
.fc-event {
  border: none !important;
  background-color: var(--fc-event-bg-color);
  border-left: 3px solid var(--fc-event-border-color) !important;
  color: var(--fc-event-text-color) !important;
  border-radius: 4px;
  padding: 3px 6px;
  margin-bottom: 4px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.fc-event:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  filter: brightness(0.97);
}

.fc-event-title {
  font-weight: 600;
}

.fc-event-time {
  font-weight: 500;
  opacity: 0.8;
  margin-right: 4px;
}

/* Dot pour la vue "Mois" si l'event est trop petit */
.fc-daygrid-event-dot {
  border-color: var(--fc-event-border-color);
}

/* --- VUE LISTE --- */
.fc-list {
  border: none !important;
}

.fc-list-day-cushion {
  background-color: #f9fafb !important;
}

.fc-list-event:hover td {
  background-color: #f3f4f6 !important;
}

.fc-list-day-text, .fc-list-day-side-text {
  font-weight: 600;
  color: #374151;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .fc {
    padding: 0;
    border: none;
    box-shadow: none;
  }

  .fc .fc-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .fc .fc-toolbar-title {
    font-size: 1.25rem;
    text-align: center;
  }
  
  .fc .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
    gap: 8px;
  }
}
