/* Agenda Styles */

/* Ensure main content has proper spacing */
.main-content {
  padding: 2rem;
  margin: 0 auto;
}

/* Cabinet info is now integrated in the header */

.agenda-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.agenda-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.agenda-controls h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  min-width: 150px;
  text-align: center;
}

.agenda-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.doctor-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doctor-filter label {
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
}

.doctor-filter select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  min-width: 150px;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.view-toggle .btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Additional button styles for agenda */
.btn-outline {
  background: transparent;
  border: 1px solid #ddd;
  color: #333;
}

.btn-outline:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.btn-outline.active {
  background: #007bff;
  border-color: #007bff;
  color: white;
}

.btn-primary {
  background: #007bff;
  border-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
  border-color: #0056b3;
}

/* Calendar Container */
.calendar-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.day-header {
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: 600px;
  width: 100%;
}

/* Quand les vues semaine et jour sont actives, le grid doit s'adapter */
.calendar-grid.view-week,
.calendar-grid.view-day {
  display: block;
  min-height: 600px;
  width: 100%;
}

.calendar-grid.view-month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: 600px;
  width: 100%;
}

/* Masquer l'en-tête statique pour les vues semaine et jour */
.calendar-container.view-week .calendar-header,
.calendar-container.view-day .calendar-header {
  display: none;
}

/* Afficher l'en-tête statique seulement pour la vue mois */
.calendar-container.view-month .calendar-header {
  display: grid;
}

.calendar-day {
  border: 1px solid #e9ecef;
  padding: 0.5rem;
  min-height: 100px;
  position: relative;
  background: white;
  transition: background-color 0.2s;
}

.calendar-day:hover {
  background: #f8f9fa;
}

.calendar-day.other-month {
  background: #f8f9fa;
  color: #adb5bd;
}

.calendar-day.today {
  background: #e3f2fd;
  border-color: #3b82f6;
}

.calendar-day.selected {
  background: #e8f5e8;
  border-color: #4caf50;
}

.day-number {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.appointment-item {
  background: #e3f2fd;
  border-left: 3px solid #3b82f6;
  padding: 0.25rem 0.5rem;
  margin: 0.25rem 0;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}

.appointment-patient-name {
  font-weight: 600;
  color: #1f4e9c;
  font-size: 0.75rem;
  line-height: 1.2;
}

.appointment-doctor-name {
  color: #666;
  font-size: 0.7rem;
  line-height: 1.1;
  margin-top: 2px;
}

.appointment-item:hover {
  background: #bbdefb;
  transform: translateY(-1px);
}

.appointment-item.urgence {
  background: #ffebee;
  border-left-color: #f44336;
}

.appointment-item.consultation {
  background: #e8f5e8;
  border-left-color: #4caf50;
}

.appointment-item.suivi {
  background: #fff3e0;
  border-left-color: #ff9800;
}

.appointment-item.operation {
  background: #f3e5f5;
  border-left-color: #9c27b0;
}

.appointment-item.autre {
  background: #f5f5f5;
  border-left-color: #9e9e9e;
}

/* Upcoming Appointments */
.upcoming-appointments {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.upcoming-appointments h3 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.2rem;
}

.appointments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.appointment-card {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #3b82f6;
  transition: all 0.2s;
}

.appointment-card:hover {
  background: #e3f2fd;
  transform: translateX(4px);
}

.appointment-card.urgence {
  border-left-color: #f44336;
}

.appointment-card.consultation {
  border-left-color: #4caf50;
}

.appointment-card.suivi {
  border-left-color: #ff9800;
}

.appointment-card.operation {
  border-left-color: #9c27b0;
}

.appointment-time {
  font-weight: 600;
  color: #333;
  min-width: 80px;
}

.appointment-info {
  flex: 1;
  margin-left: 1rem;
}

.appointment-patient {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.25rem;
}

.appointment-doctor {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.appointment-type {
  font-size: 0.9rem;
  color: #666;
  text-transform: capitalize;
}

.appointment-actions {
  display: flex;
  gap: 0.5rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
  margin: 0;
  color: #333;
}

.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close:hover {
  color: #333;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

/* Appointment details styling */
.appointment-details {
  padding: 1rem;
}

.detail-item {
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.detail-item:last-child {
  border-bottom: none;
}

.detail-item strong {
  color: #333;
  font-weight: 600;
  display: inline-block;
  min-width: 120px;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .agenda-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .agenda-controls {
    justify-content: center;
  }

  .agenda-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }

  .appointment-item {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }

  .modal-content {
    width: 95%;
    margin: 2% auto;
  }

  .appointment-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .appointment-actions {
    align-self: flex-end;
  }
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1rem 2rem;
  border-radius: 8px;
  z-index: 1001;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #ddd;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calendar-day {
  animation: fadeIn 0.3s ease-out;
}

.appointment-card {
  animation: fadeIn 0.3s ease-out;
}

/* Styles pour les vues semaine et jour */

/* Vue Semaine */
.week-view {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.week-header {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  width: 100%;
}

.week-header .day-header {
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: #333;
  border-right: 1px solid #dee2e6;
}

.week-header .time-header {
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: #333;
  background: #e9ecef;
}

.week-grid {
  max-height: 600px;
  overflow-y: auto;
  width: 100%;
}

.time-slot {
  display: grid;
  grid-template-columns: 80px repeat(7, 1fr);
  border-bottom: 1px solid #dee2e6;
  min-height: 60px;
  width: 100%;
}

.time-slot:hover {
  background: #f8f9fa;
}

.time-label {
  padding: 0.5rem;
  text-align: center;
  font-weight: 600;
  color: #666;
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-slot {
  padding: 0.25rem;
  border-right: 1px solid #dee2e6;
  min-height: 60px;
  cursor: pointer;
  position: relative;
}

.day-slot:hover {
  background: #f0f8ff;
}

.day-slot .appointment-item {
  margin: 0.125rem 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  max-height: 40px;
  overflow: hidden;
}

.day-slot .appointment-patient-name {
  font-weight: 600;
  font-size: 0.7rem;
  line-height: 1.2;
}

.day-slot .appointment-time {
  font-size: 0.65rem;
  color: #666;
  margin-top: 0.125rem;
}

/* Vue Jour */
.day-view {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.day-view .day-header {
  padding: 1.5rem;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  text-align: center;
}

.day-view .day-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.5rem;
  font-weight: 600;
}

.day-timeline {
  max-height: 600px;
  overflow-y: auto;
  width: 100%;
}

.timeline-slot {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  min-height: 80px;
}

.timeline-slot:hover {
  background: #f8f9fa;
}

.timeline-slot .time-label {
  width: 80px;
  padding: 1rem 0.5rem;
  text-align: center;
  font-weight: 600;
  color: #666;
  background: #f8f9fa;
  border-right: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.appointments-slot {
  flex: 1;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.appointments-slot .appointment-item {
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  border-left: 4px solid;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.appointments-slot .appointment-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.appointments-slot .appointment-time {
  font-weight: 600;
  color: #007bff;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.appointments-slot .appointment-patient-name {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.appointments-slot .appointment-doctor-name {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.appointments-slot .appointment-duration {
  color: #999;
  font-size: 0.8rem;
  font-style: italic;
}

/* Couleurs spécifiques pour les types de rendez-vous */
.appointment-item.urgence {
  border-left-color: #dc3545;
  background: #fff5f5;
}

.appointment-item.consultation {
  border-left-color: #28a745;
  background: #f8fff9;
}

/* Statuts de rendez-vous */
.appointment-item.pending {
  border-left-color: #ff9800;
  background: #fff7e6;
}

.appointment-item.confirmed {
  border-left-color: #28a745;
}

.appointment-item.cancelled {
  border-left-color: #dc3545;
  opacity: 0.7;
}

.appointment-card.pending {
  border-left-color: #ff9800;
  background: #fff7e6;
}

.appointment-card.confirmed {
  border-left-color: #28a745;
}

.appointment-card.cancelled {
  border-left-color: #dc3545;
  opacity: 0.8;
}

.appointment-item.suivi {
  border-left-color: #ffc107;
  background: #fffdf5;
}

.appointment-item.operation {
  border-left-color: #6f42c1;
  background: #f8f5ff;
}

.appointment-item.autre {
  border-left-color: #6c757d;
  background: #f8f9fa;
}

/* Responsive pour les vues semaine et jour */
@media (max-width: 768px) {
  .week-header {
    grid-template-columns: 60px repeat(7, 1fr);
  }

  .time-slot {
    grid-template-columns: 60px repeat(7, 1fr);
  }

  .time-label {
    width: 60px;
    font-size: 0.8rem;
  }

  .day-slot .appointment-item {
    font-size: 0.65rem;
    padding: 0.125rem 0.25rem;
  }

  .timeline-slot .time-label {
    width: 60px;
    font-size: 0.8rem;
  }

  .appointments-slot .appointment-item {
    padding: 0.5rem;
  }

  .appointments-slot .appointment-patient-name {
    font-size: 0.9rem;
  }

  .appointments-slot .appointment-time {
    font-size: 0.8rem;
  }
}
