/* Styles pour le calendrier Agenda */

.calendar-table {
    width: 100%;
    table-layout: fixed;
}

.calendar-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    padding: 10px;
    text-align: center;
    border: 1px solid #dee2e6;
}

.calendar-table td {
    padding: 0;
    border: 1px solid #dee2e6;
    vertical-align: top;
    height: 100px;
    position: relative;
}

.calendar-day {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 5px;
}

.calendar-day:hover {
    background-color: #e9ecef;
}

.calendar-day.today {
    background-color: #e8ecff;
    border: 2px solid #6378da;
}

.calendar-day.has-appointments {
    background-color: #fff3cd;
}

.calendar-day.empty {
    background-color: #f8f9fa;
    cursor: default;
}

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

.calendar-day-number {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
}

.calendar-appointments-count {
    font-size: 11px;
    color: #6378da;
    font-weight: 600;
    margin-top: 5px;
}

#appointments-list {
    max-height: 500px;
    overflow-y: auto;
}

#appointments-list .list-group-item {
    border-left: 3px solid #6378da;
    margin-bottom: 10px;
}

#appointments-list .list-group-item h6 {
    color: #495057;
    font-weight: 600;
}

#appointments-list .list-group-item small {
    display: block;
    margin-top: 5px;
}

#calendar-month-year {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

/* Styles pour les boutons de navigation et de vue */
#btn-prev-period,
#btn-next-period {
    background: linear-gradient(135deg, #6378da 0%, #3b59df 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(99, 120, 218, 0.3);
    transition: all 0.3s ease;
}

#btn-prev-period:hover,
#btn-next-period:hover {
    background: linear-gradient(135deg, #3b59df 0%, #2d4ac7 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 120, 218, 0.4);
}

#btn-prev-period:active,
#btn-next-period:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(99, 120, 218, 0.3);
}

/* Styles pour les boutons de vue */
.btn-group #btn-view-month,
.btn-group #btn-view-week,
.btn-group #btn-view-day {
    background: linear-gradient(135deg, #6378da 0%, #3b59df 100%);
    color: white;
    border: 2px solid #6378da;
    font-weight: 600;
    padding: 8px 15px;
    transition: all 0.3s ease;
}

.btn-group #btn-view-month:hover,
.btn-group #btn-view-week:hover,
.btn-group #btn-view-day:hover {
    background: linear-gradient(135deg, #3b59df 0%, #2d4ac7 100%);
    color: white;
    border-color: #3b59df;
    transform: translateY(-1px);
}

.btn-group #btn-view-month.active,
.btn-group #btn-view-week.active,
.btn-group #btn-view-day.active {
    background: white;
    color: #6378da;
    border-color: #6378da;
    box-shadow: 0 2px 6px rgba(99, 120, 218, 0.2);
}

/* Bouton "Ajouter un créneau" */
#agendaModal .btn-primary[onclick="openAddSlotModal()"],
.btn-primary[onclick="openAddSlotModal()"] {
    background: linear-gradient(135deg, #6378da 0%, #3b59df 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    box-shadow: 0 2px 6px rgba(99, 120, 218, 0.3);
    transition: all 0.3s ease;
}

#agendaModal .btn-primary[onclick="openAddSlotModal()"]:hover,
.btn-primary[onclick="openAddSlotModal()"]:hover {
    background: linear-gradient(135deg, #3b59df 0%, #2d4ac7 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(99, 120, 218, 0.4);
}

#agendaModal .btn-primary[onclick="openAddSlotModal()"]:active,
.btn-primary[onclick="openAddSlotModal()"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(99, 120, 218, 0.3);
}

/* Amélioration générale des boutons dans l'agenda */
#agendaModal .btn-group {
    gap: 0;
}

#agendaModal .btn-group>.btn {
    border-radius: 0;
}

#agendaModal .btn-group>.btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

#agendaModal .btn-group>.btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* Styles pour les boutons de suppression dans la liste */
#appointments-list .btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    transition: all 0.3s ease;
}

#appointments-list .btn-outline-danger:hover {
    background-color: #dc3545;
    color: white;
    transform: scale(1.05);
}

/* Styles pour la vue hebdomadaire */
.calendar-week-view {
    width: 100%;
}

.week-header {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 10px;
}

.week-day-header {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-right: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.week-day-header:hover {
    background-color: #f8f9fa;
}

.week-day-header.today {
    background-color: #d1ecf1;
    font-weight: 600;
}

.week-day-name {
    font-weight: 600;
    font-size: 14px;
    color: #6c757d;
}

.week-day-number {
    font-size: 20px;
    font-weight: 700;
    color: #495057;
    margin: 5px 0;
}

.week-day-month {
    font-size: 12px;
    color: #6c757d;
}

.week-day-count {
    font-size: 11px;
    color: #6378da;
    font-weight: 600;
    margin-top: 5px;
}

.week-body {
    max-height: 600px;
    overflow-y: auto;
}

.week-hours {
    border-top: 1px solid #dee2e6;
}

.week-hour-row {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    min-height: 40px;
}

.week-hour-label {
    width: 60px;
    padding: 8px;
    font-size: 12px;
    color: #6c757d;
    border-right: 1px solid #dee2e6;
    text-align: right;
    font-weight: 500;
}

.week-hours-slots {
    flex: 1;
}

.week-slot {
    flex: 1;
    border-right: 1px solid #e9ecef;
    padding: 4px;
    min-height: 40px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.week-slot:hover {
    background-color: #f8f9fa;
}

.week-slot.current-time {
    background-color: #e8ecff;
    border-top: 2px solid #6378da;
}

.week-appointment {
    background: linear-gradient(135deg, #6378da 0%, #3b59df 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* Styles pour la vue journalière */
.calendar-day-view {
    width: 100%;
}

.day-header {
    padding: 15px;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.day-header.today {
    background: linear-gradient(135deg, #e8ecff 0%, #d1d9ff 100%);
    border-color: #6378da;
}

.day-header h4 {
    margin: 0;
    color: #495057;
}

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

.day-hour-row {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    min-height: 60px;
}

.day-hour-row.current-time {
    background-color: #e8ecff;
    border-top: 2px solid #6378da;
}

.day-hour-label {
    width: 80px;
    padding: 10px;
    font-size: 14px;
    color: #6c757d;
    border-right: 1px solid #dee2e6;
    text-align: right;
    font-weight: 600;
}

.day-hour-content {
    flex: 1;
    padding: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.day-hour-content:hover {
    background-color: #f8f9fa;
}

.day-appointment {
    background: linear-gradient(135deg, #6378da 0%, #3b59df 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    margin-bottom: 5px;
    box-shadow: 0 2px 6px rgba(99, 120, 218, 0.3);
    font-weight: 500;
}

.day-appointment strong {
    display: block;
    margin-bottom: 4px;
}

.day-appointment small {
    color: rgba(255, 255, 255, 0.9);
    display: block;
    margin-top: 4px;
}