/* #cr-calendar-container-medecin, #cr-calendar-container-coord{

  justify-content: center;
    display: flex
;
    flex-direction: column;

}

.elementor-shortcode{

    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

}  */

/* Conteneur principal du calendrier */
#cr-calendar-container-medecin {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* En-tête centré */
.cr-calendar-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 20px;
}

/* Ligne du sélecteur de vue */
.cr-header-top {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Ligne centrale : flèches + mois */
.cr-header-center {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

/* Ligne du sélecteur de date */
.cr-header-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

/* Style des boutons de navigation */
.cr-prev-month-med,
.cr-next-month-med {
  border: none;
  background: #eee;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s;
}
.cr-prev-month-med:hover,
.cr-next-month-med:hover {
  background: #ddd;
}

/* Style du texte du mois */
.cr-current-month {
  font-weight: bold;
  font-size: 18px;
}

/* Centrer aussi le calendrier */
.cr-calendar-grid {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.cr-day {
  width: 100% !important;
}

.input-period {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#cr-load-period {
  margin: 10px;
}

/* ✅ Le calendrier occupe toujours 100% de la largeur */
.cr-calendar-grid {
  width: 100%;
  overflow-x: auto;
}

/* ✅ Les cellules s’adaptent mieux aux petits écrans */
.cr-calendar-table {
  display: grid;
  grid-template-columns: repeat(7, 1fr); /* 7 colonnes équilibrées */
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
}

/* ✅ Chaque case du calendrier (jour) */
.cr-day {
  min-width: 0; /* évite que les colonnes débordent */
  word-wrap: break-word;
}

/* ✅ Optimisation sur mobile */
@media (max-width: 768px) {
  .cr-calendar-grid {
    padding: 0 5px;
  }

  .cr-calendar-table {
    grid-template-columns: repeat(7, 1fr); /* garde les 7 colonnes */
  }

  .cr-day {
    padding: 3px !important;
    min-height: 60px;
  }

  .cr-day-title {
    font-size: 12px;
  }

  .cr-slot {
    font-size: 10px !important;
    padding: 3px !important;
  }

  .cr-slot-time {
    white-space: normal !important;
  }
}

/* Conteneur principal du calendrier */
.cr-calendar-grid {
  position: relative;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

/* ✅ Ajout d’un dégradé visuel à droite pour indiquer qu’il y a du contenu au-delà */
/* .cr-calendar-grid::after {
  content: "→";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: rgba(0,0,0,0.3);
  pointer-events: none;
  animation: blinkArrow 1.5s infinite;
} */

/* ✅ Animation subtile de l’indicateur */
@keyframes blinkArrow {
  0%,
  100% {
    opacity: 0.4;
    transform: translate(0, -50%);
  }
  50% {
    opacity: 1;
    transform: translate(5px, -50%);
  }
}

/* ✅ L’indicateur disparaît quand on a scrollé jusqu’à la fin */
.cr-calendar-grid.scrolled-right::after {
  opacity: 0;
}

.cr-slot {
  padding: 5px;
  margin: 2px;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
}
/* .cr-slot.red { background:#f44336; color:#fff; }
.cr-slot.orange { background:#ff9800; color:#fff; }
.cr-slot.white { background:#fff; color:#000; border:1px solid #ccc; }
.cr-slot.green-light { background:#8bc34a; color:#fff; }
.cr-slot.green-dark { background:#4caf50; color:#fff; }
.cr-slot.blue { background:#79c4b5; color:#fff; }

 */

#cr-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#cr-toast.show {
  display: block;
  opacity: 1;
}

/* Modal container */
.cr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* cachée par défaut */
  z-index: 9999;
  overflow-y: auto; /* scroll si contenu trop grand */
  text-align: center; /* centrer horizontalement les enfants inline-block */
}

/* Trick pour centrer verticalement avec inline-block */
.cr-modal::before {
  content: "";
  display: inline-block;
  height: 100%;
  vertical-align: middle;
}

/* Modal content */
.cr-modal-content {
  display: inline-block;
  vertical-align: middle;
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: fadeInModal 0.2s ease;
  text-align: left; /* pour le contenu */
  z-index: 60 !important;
}

/* Modal backdrop */
.cr-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

/* Close button */
.cr-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 20px;
  color: #333;
}

/* Slot line */
.cr-modal-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 5px 0;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

/* Toast */
#cr-toast {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 8px 15px;
  border-radius: 4px;
  z-index: 10010;
}

/* Fade in animation */
@keyframes fadeInModal {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal container */
.cr-coord-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none; /* cachée par défaut */
  z-index: 9999;
  text-align: center; /* centrer horizontalement avec inline-block */
}

/* Trick pour centrer verticalement */
.cr-coord-modal::before {
  content: "";
  display: inline-block;
  height: 100%;
  vertical-align: middle;
}

/* Modal backdrop */
.cr-coord-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

/* Modal content */
.cr-coord-modal-content {
  display: inline-block;
  vertical-align: middle;
  background: #fff;
  padding: 20px;
  border-radius: 6px;
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: fadeInModal 0.2s ease;
  text-align: left;
  z-index: 60 !important;
}

/* Close button */
.cr-coord-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  font-size: 20px;
  color: #333;
}

/* Slot line */
.cr-coord-modal-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 5px 0;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.cr-coord-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
}

.cr-coord-modal-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  top: 0;
  left: 0;
}

.cr-coord-modal-content {
  position: relative;
  background: #fff;
  max-width: 480px;
  margin: 40px auto;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.cr-coord-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

.cr-coord-modal-slot {
  border: 1px solid #ddd;
  padding: 8px;
  margin-bottom: 6px;
  border-radius: 5px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* Styles pour les badges médecins */
.cr-coord-modal-slot .cr-doctor-badges span,
.cr-coord-modal-slot > span {
  background: #eee;
  border-radius: 3px;
  padding: 2px 6px;
  margin: 2px 4px 2px 0;
  font-size: 12px;
  display: flex;
  align-items: center;
}

.cr-coord-modal-slot button {
  font-size: 11px;
  margin-left: 4px;
  padding: 9px 12px;
}

@media (max-width: 500px) {
  .cr-coord-modal-content {
    width: 90%;
    margin: 20px auto;
  }
  .cr-coord-modal-slot {
    font-size: 14px;
  }
}

.cr-calendar-header div {
  margin: 5px;
}

/* ====== Container ====== */
#cr-calendar-container-medecin,
#cr-calendar-container-coord {
  /*  max-width: 800px; */
  margin: 20px auto;
  font-family: Arial, sans-serif;
}

/* ====== Header ====== */
.cr-calendar-header {
  text-align: center;
  margin-bottom: 10px;
}

.cr-calendar-header button {
  padding: 5px 10px;
  cursor: pointer;
  border: none;
  background-color: #79c4b5;
  color: #fff;
  border-radius: 3px;
  font-weight: bold;
  margin: 0 5px;
  transition: background 0.2s;
}

.cr-calendar-header button:hover {
  background-color: #1976d2;
}

/* ====== Grille ====== */
.cr-calendar-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: start;
}

.cr-day {
  width: calc(100% / 7 - 4px); /* 7 jours par ligne, 4px pour marges */
  border: 1px solid #ddd;
  margin: 2px 0;
  padding: 5px;
  box-sizing: border-box;
  background: #f9f9f9;
  border-radius: 3px;
}

.cr-day-title {
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
}

/* ====== Créneaux ====== */
.cr-slot {
  padding: 4px;
  margin: 2px 0;
  border-radius: 3px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85em;
  transition: opacity 0.2s, transform 0.2s;
}

.cr-slot:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* Couleurs des statuts */
/* .white { background:#fff; }
.blue { background:#79c4b5; color:#fff; }
.blue-dark { background:#1565c0; color:#fff; }
.green-light { background:#4CAF50; color:#fff; }
.green-dark { background:#006400; color:#fff; }
.red { background:#f44336; color:#fff; }
.red-dark { background:#b71c1c; color:#fff; }
.cr-slot { padding:5px; border-radius:3px; margin-bottom:2px; text-align:center; cursor:pointer; }

 */

/* ====== Responsive ====== */
@media (max-width: 600px) {
  .cr-day {
    width: calc(100% / 2 - 4px); /* 2 jours par ligne sur mobile */
    font-size: 0.9em;
  }

  .cr-slot {
    font-size: 0.75em;
    padding: 3px;
  }

  .cr-calendar-header button {
    padding: 4px 8px;
    margin: 0 3px;
    font-size: 0.9em;
  }
}

.cr-slot-menu.open {
  background: #79c4b5 !important;
}

.cr-slot-menu:hover {
  background: #79c4b5 !important;
}

.cr-actions-bar {
  margin-bottom: 8px;
}

#cr-add-slot-form-coord button {
  margin-top: 5px;
}

.cr-block-split {
  text-align: center;
}

#cr-modal-slots-coord {
  overflow-y: auto;
  max-height: 355px;
}

/* Recherche médecin - autocomplete custom */
.cr-doctor-search-wrapper {
  position: relative;
  width: 200px;
}

.cr-doctor-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  box-sizing: border-box;
}

.cr-doctor-input:focus {
  outline: none;
  border-color: #79c4b5;
}

.cr-doctor-input.cr-doctor-selected {
  border-color: #4caf50;
  background: #f0faf0;
}

.cr-doctor-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.cr-doctor-result-item {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

.cr-doctor-result-item:last-child {
  border-bottom: none;
}

.cr-doctor-result-item:hover {
  background: #e8f5e9;
}

.cr-doctor-result-item.cr-no-result {
  color: #999;
  cursor: default;
  font-style: italic;
}

.cr-doctor-result-item.cr-no-result:hover {
  background: transparent;
}
