/* ==========================================================================
   M12 : AGENDA MÉDECIN
   Préfixe : agenda-
   ========================================================================== */

/* ---------- MISE EN PAGE GLOBALE ---------- */

.agenda-screen {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  opacity: 0;
  animation: agenda-fade-in 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---------- SIDEBAR GAUCHE ---------- */

.agenda-sidebar {
  width: 180px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Mini-calendrier */
.agenda-mini-cal {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 0;
  padding: 14px;
}

.agenda-mini-cal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.agenda-mini-cal__month {
  font-size: 12px;
  font-weight: 600;
  color: #3A3E38;
}

.agenda-mini-cal__nav {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #E4E6E2;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64695F;
  font-size: 14px;
  line-height: 1;
  transition: all 150ms ease;
  padding: 0;
  font-family: inherit;
}

.agenda-mini-cal__nav:hover {
  border-color: #4A90E2;
  color: #4A90E2;
}

.agenda-mini-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.agenda-mini-cal__day-label {
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  color: #9CA09A;
  text-transform: uppercase;
  padding: 2px 0 5px;
}

.agenda-mini-cal__cell {
  text-align: center;
  font-size: 11px;
  color: #64695F;
  padding: 4px 2px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 100ms ease;
  line-height: 1.2;
}

.agenda-mini-cal__cell:hover:not(.is-empty):not(.is-today) {
  background: #F2F2F2;
}

.agenda-mini-cal__cell.is-empty {
  cursor: default;
}

.agenda-mini-cal__cell.is-current-week {
  background: #E8F1FB;
  color: #1A5DA0;
  font-weight: 500;
}

.agenda-mini-cal__cell.is-today {
  background: #4A90E2;
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 2px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
}

/* Résumé du jour */
.agenda-day-summary {
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 0;
  padding: 14px;
}

.agenda-day-summary__date {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #9CA09A;
  margin-bottom: 8px;
}

.agenda-day-summary__total {
  font-family: 'Prompt', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #4A90E2;
  line-height: 1;
  margin-bottom: 12px;
}

.agenda-day-summary__unit {
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  color: #64695F;
}

.agenda-day-summary__stats {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid #F2F2F2;
}

.agenda-day-summary__stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #64695F;
}

.agenda-day-summary__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agenda-day-summary__dot.is-done     { background: #2D8A4E; }
.agenda-day-summary__dot.is-current  { background: #4A90E2; }
.agenda-day-summary__dot.is-upcoming { background: #9CA09A; }

/* ---------- ZONE PRINCIPALE ---------- */

.agenda-main {
  flex: 1;
  min-width: 0;
  position: relative;
}

/* Barre d'outils */
.agenda-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.agenda-view-toggle {
  display: flex;
  border: 1px solid #E4E6E2;
  border-radius: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.agenda-view-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #64695F;
  background: transparent;
  border: none;
  border-left: 1px solid #E4E6E2;
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
}

.agenda-view-btn:first-child {
  border-left: none;
}

.agenda-view-btn.is-active {
  background: #4A90E2;
  color: #FFFFFF;
}

.agenda-view-btn:not(.is-active):hover {
  background: #F8F9FA;
}

.agenda-toolbar__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.agenda-toolbar__title {
  font-size: 13px;
  font-weight: 600;
  color: #3A3E38;
  min-width: 180px;
  text-align: center;
}

.agenda-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 0;
  border: 1px solid #E4E6E2;
  background: #FFFFFF;
  color: #64695F;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.agenda-nav-btn:hover {
  border-color: #4A90E2;
  color: #4A90E2;
  background: #E8F1FB;
}

.agenda-today-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 0;
  border: 1px solid #E4E6E2;
  background: #FFFFFF;
  color: #64695F;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 150ms ease;
  flex-shrink: 0;
}

.agenda-today-btn:hover {
  border-color: #4A90E2;
  color: #4A90E2;
}

/* ---------- GRILLE SEMAINE ---------- */

.agenda-week {
  display: grid;
  grid-template-columns: 44px 1fr;
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 0;
  overflow: hidden;
}

/* Colonne des heures */
.agenda-times {
  border-right: 1px solid #E4E6E2;
  background: #FAFAFA;
}

.agenda-times__spacer {
  height: 48px;
  border-bottom: 2px solid #E4E6E2;
}

.agenda-times__labels {
  position: relative;
  height: 792px;
}

.agenda-time-label {
  position: absolute;
  right: 5px;
  font-size: 9px;
  color: #9CA09A;
  font-weight: 600;
  text-align: right;
  line-height: 1;
}

/* Colonnes des jours : 5 jours ouvrables */
.agenda-days {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.agenda-day {
  border-right: 1px solid #F2F2F2;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.agenda-day:last-child {
  border-right: none;
}

.agenda-day__header {
  height: 48px;
  border-bottom: 2px solid #E4E6E2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  position: sticky;
  top: 0;
  z-index: 3;
}

.agenda-day.is-today .agenda-day__header {
  background: linear-gradient(180deg, #E0EEF9 0%, #EEF5FC 100%);
}

.agenda-day.is-today .agenda-day__body {
  background: rgba(74, 144, 226, 0.018);
}

.agenda-day__name {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9CA09A;
  font-weight: 600;
}

.agenda-day__date {
  font-family: 'Prompt', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #3A3E38;
  line-height: 1.2;
}

.agenda-day.is-today .agenda-day__date {
  color: #4A90E2;
}

.agenda-day__body {
  position: relative;
  height: 792px;
  flex: 1;
}

/* Lignes horaires */
.agenda-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #F8F8F8;
  pointer-events: none;
}

.agenda-hour-line.is-full-hour {
  background: #EEEEEE;
}

/* ---------- ÉVÉNEMENTS ---------- */

.agenda-event {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 0;
  padding: 4px 6px;
  cursor: pointer;
  overflow: hidden;
  transition: filter 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  border-left: 3px solid transparent;
  box-sizing: border-box;
  min-height: 22px;
}

.agenda-event:hover {
  filter: brightness(0.94);
  z-index: 10;
  transform: scaleX(1.02);
}

.agenda-event.is-done {
  background: #E3F4E8;
  border-left-color: #2D8A4E;
  color: #2D8A4E;
}

.agenda-event.is-current {
  background: linear-gradient(135deg, #DCE9F8, #C8DDED);
  border-left-color: #4A90E2;
  color: #1A5DA0;
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
  animation: agenda-pulse 2.5s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  z-index: 5;
}

.agenda-event.is-upcoming {
  background: #F2F3F5;
  border-left-color: #9CA09A;
  color: #64695F;
}

.agenda-event__name {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.agenda-event__motif {
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.75;
  line-height: 1.3;
  margin-top: 1px;
}

/* ---------- POPOVER ---------- */

.agenda-popover {
  position: absolute;
  z-index: 100;
  background: #FFFFFF;
  border: 1px solid #E4E6E2;
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.14);
  padding: 16px;
  width: 242px;
  display: none;
}

.agenda-popover.is-visible {
  display: block;
  animation: agenda-pop-in 200ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.agenda-popover__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #9CA09A;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  font-family: inherit;
}

.agenda-popover__close:hover {
  background: #F2F2F2;
  color: #3A3E38;
}

.agenda-popover__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 20px;
}

.agenda-popover__info {
  flex: 1;
  min-width: 0;
}

.agenda-popover__name {
  font-size: 13px;
  font-weight: 700;
  color: #3A3E38;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-popover__time {
  font-size: 11px;
  color: #9CA09A;
  margin-top: 1px;
}

.agenda-popover__motif {
  font-size: 12px;
  color: #64695F;
  line-height: 1.4;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #F2F2F2;
}

.agenda-popover__actions {
  display: flex;
  gap: 8px;
}

/* ---------- ANIMATIONS ---------- */

@keyframes agenda-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes agenda-pulse {
  0%, 100% { box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3); }
  50%       { box-shadow: 0 2px 18px rgba(74, 144, 226, 0.55); }
}

@keyframes agenda-pop-in {
  from { opacity: 0; transform: scale(0.9) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- TABLETTE ---------- */

.frame--tablet .agenda-sidebar {
  width: 150px;
}

.frame--tablet .agenda-mini-cal {
  padding: 10px;
}

.frame--tablet .agenda-mini-cal__cell {
  font-size: 10px;
  padding: 3px 1px;
}

.frame--tablet .agenda-day-summary__total {
  font-size: 18px;
}

.frame--tablet .agenda-event__motif {
  display: none;
}

.frame--tablet .agenda-event__name {
  font-size: 9px;
}

.frame--tablet .agenda-toolbar__title {
  font-size: 12px;
  min-width: 140px;
}

.frame--tablet .agenda-view-btn {
  padding: 6px 10px;
  font-size: 11px;
}
