/* Navigation du calendrier - Version améliorée */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    white-space: nowrap;
    flex-wrap: nowrap !important;
    padding: 10px 0;
}

.calendar-nav .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #007bff;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.calendar-nav .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.calendar-nav .btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
    border-color: #0056b3;
    background: linear-gradient(135deg, #0056b3, #004085);
}

.calendar-nav .btn:hover::before {
    left: 100%;
}

.calendar-nav .btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

.calendar-nav .btn i {
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.calendar-nav .btn:hover i {
    transform: scale(1.2);
}

.calendar-nav h4 {
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    min-width: 200px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 10px 20px;
    border-radius: 25px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Assurer que le conteneur reste sur une ligne */
.calendar-nav.d-flex {
    flex-wrap: nowrap;
    overflow-x: auto;
    min-width: 0;
}

/* Animation de pulsation pour le focus */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    }
}

.calendar-nav .btn:focus {
    animation: pulse 1.5s infinite;
    outline: none;
}

/* Styles pour les cartes et alertes */
.card.border-success {
    border-width: 2px !important;
}

.alert-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.btn-group .btn {
    flex: 1;
}

/* Styles du calendrier améliorés */
.calendar-grid {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
    border: 1px solid #e3f2fd;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, #1976d2, #1565c0);
    border-bottom: none;
}

.calendar-day-header {
    padding: 18px 12px;
    text-align: center;
    font-weight: 700;
    color: white;
    border-right: 1px solid rgba(255,255,255,0.2);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

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

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #f5f5f5;
    padding: 1px;
}

.calendar-day {
    min-height: 130px;
    padding: 12px;
    border: none;
    position: relative;
    background: white;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.calendar-day:hover {
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.calendar-day.empty {
    background: #fafafa;
    opacity: 0.6;
}

.calendar-day.today {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196f3;
    box-shadow: 0 4px 16px rgba(33,150,243,0.3);
}

.day-number {
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 8px;
    font-size: 1.1rem;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    background: rgba(25,118,210,0.1);
    min-width: 32px;
    text-align: center;
}

.calendar-day.today .day-number {
    background: #2196f3;
    color: white;
    box-shadow: 0 2px 8px rgba(33,150,243,0.4);
}

.calendar-event {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
    padding: 6px 10px;
    margin: 3px 0;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* Limitation à 3 lignes de hauteur */
    max-height: calc(3 * 1.3em);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
}

.calendar-event:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    background: linear-gradient(135deg, #5a6268, #495057);
}

.calendar-event.event-normal {
    background: linear-gradient(135deg, #17a2b8, #138496);
    border-left-color: #117a8b;
}

.calendar-event.event-lpro72 {
    background: linear-gradient(135deg, #28a745, #218838);
    border-left-color: #1e7e34;
}

.calendar-event.event-normal:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
}

.calendar-event.event-lpro72:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
}

/* Styles du pop-up d'événement améliorés */
.event-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
    width: 650px;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto; /* Permet le défilement vertical */
    overflow-x: hidden; /* Empêche le défilement horizontal */
    z-index: 1050;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    border: 1px solid #e8eaed;
    /* Amélioration du style de la barre de défilement */
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* Style personnalisé pour la barre de défilement sur WebKit (Chrome, Safari, Edge) */
.event-popup::-webkit-scrollbar {
    width: 8px;
}

.event-popup::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.event-popup::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.event-popup::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.popup-color-bar {
    flex: 1;
    min-height: 70px;
    background: linear-gradient(135deg, #28a745, #218838); /* Changé de bleu à vert */
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Changé pour espacer le titre et les boutons */
    padding: 0 20px;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
}

.popup-color-bar.lpro72 {
    background: linear-gradient(135deg, #28a745, #218838); /* Même vert pour lpro72 */
}

.popup-color-bar .popup-title {
    color: white !important;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    word-wrap: break-word;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    margin-right: 20px; /* Espace entre le titre et les boutons */
}

/* Déplacer les boutons dans la banderole */
.popup-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
    margin: 0; /* Supprimer la marge gauche */
}

.popup-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 16px;
}

.popup-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.popup-btn.btn-modify {
    background: rgba(255,255,255,0.25);
}

.popup-btn.btn-delete {
    background: rgba(220,53,69,0.3);
}

.popup-btn.btn-delete:hover {
    background: rgba(220,53,69,0.5);
}

.popup-btn.btn-close {
    background: rgba(255,255,255,0.2);
}

.popup-btn.btn-invite {
    background: rgba(40,167,69,0.3);
}

.popup-btn.btn-invite:hover {
    background: rgba(40,167,69,0.5);
}

.popup-content {
    padding: 0;
    max-height: none; /* Supprime toute limitation de hauteur */
}

.popup-details {
    padding: 20px;
    max-height: none; /* Supprime toute limitation de hauteur */
    overflow: visible; /* Permet l'affichage complet du contenu */
}

.popup-detail {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    font-size: 15px;
    color: #3c4043;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.popup-detail:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.popup-detail i {
    width: 24px;
    color: #1976d2;
    margin-top: 2px;
    flex-shrink: 0;
    font-size: 16px;
}

.popup-detail span, .popup-detail div {
    flex: 1;
    line-height: 1.5;
    font-weight: 500;
}

.lpro72-badge {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    color: #155724;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #c3e6cb;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}



.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
    display: none;
    backdrop-filter: blur(2px);
}

/* Responsive design */
@media (max-width: 768px) {
    .calendar-nav {
        gap: 10px;
    }
    
    .calendar-nav .btn {
        width: 40px;
        height: 40px;
    }
    
    .calendar-nav .btn i {
        font-size: 14px;
    }
    
    .calendar-nav h4 {
        font-size: 1.25rem;
        min-width: 150px;
        padding: 8px 15px;
    }
    
    .calendar-day {
        min-height: 80px;
        padding: 4px;
    }
    
    .calendar-event {
        font-size: 10px;
        padding: 1px 4px;
        /* Limitation à 3 lignes de hauteur pour mobile */
        max-height: calc(3 * 1.2em);
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        word-wrap: break-word;
        text-overflow: ellipsis;
    }
    
    .calendar-day-header {
        padding: 10px 5px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .calendar-nav {
        gap: 8px;
    }
    
    .calendar-nav h4 {
        font-size: 1rem;
        min-width: 120px;
        padding: 6px 12px;
    }
    
    .calendar-nav .btn {
        width: 35px;
        height: 35px;
    }
    
    .calendar-nav .btn i {
        font-size: 12px;
    }
    
    /* Dans la section responsive, vers la ligne 383 */
    @media (max-width: 768px) {
    .event-popup {
        width: 95vw;
        margin: 20px;
        max-height: 85vh; /* Optionnel : augmenter aussi la hauteur sur mobile */
    }
    
    .popup-title {
        font-size: 20px;
    }
    }
}

@media (max-width: 320px) {
    .calendar-nav h4 {
        font-size: 0.9rem;
        min-width: 100px;
        padding: 5px 10px;
    }
    
    .calendar-nav .btn {
        width: 30px;
        height: 30px;
    }
    
    .calendar-nav .btn i {
        font-size: 10px;
    }
}

/* Styles spécifiques pour éviter les conflits avec le header */
.calendar-nav {
    position: relative;
    z-index: 1;
}

.calendar-grid {
    position: relative;
    z-index: 1;
}

/* S'assurer que le header reste au-dessus */
header, .navbar {
    position: relative;
    z-index: 1000;
}

/* Éviter les conflits de positionnement */
.container.mt-4 {
    margin-top: 2rem !important;
    position: relative;
    z-index: 1;
}

/* Styles pour la liste des utilisateurs */
.user-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    background-color: #f9f9f9;
}

.user-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.user-item input[type="checkbox"] {
    margin-right: 10px;
}

.user-item label {
    margin: 0;
    font-weight: normal;
}

/* Styles pour la sélection des utilisateurs dans les modals */
.utilisateur-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 15px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.075);
}

.utilisateur-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: #f8f9fa;
}

.utilisateur-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.utilisateur-item.selected {
    background-color: #e7f1ff;
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13,110,253,0.2);
}

.utilisateur-checkbox {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.utilisateur-info {
    flex-grow: 1;
}

.utilisateur-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 1.1em;
}

.utilisateur-details {
    font-size: 0.9em;
    color: #6c757d;
}

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

.selection-title {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 5px;
}

.selection-description {
    color: #6c757d;
    font-size: 0.9em;
    margin: 0;
}

/* Styles pour les jours des autres mois */
.calendar-day.other-month {
    background-color: #f1f3f4;
    opacity: 0.4;
}

.calendar-day.other-month .day-number {
    color: #6596ba;
    font-weight: 400;
}

.calendar-day.other-month .day-number.prev-month,
.calendar-day.other-month .day-number.next-month {
    font-size: 0.85em;
}

.calendar-day.other-month:hover {
    background-color: #e8eaed;
    opacity: 0.6;
}

/* Styles pour les événements dans les jours des autres mois */
.calendar-day.other-month .calendar-event {
    opacity: 0.7;
    font-size: 0.8em;
}

.calendar-day.other-month .calendar-event:hover {
    opacity: 0.9;
}

/* Styles pour la pop-up des événements */
.description-container {
    margin-bottom: 15px;
}

.description-short,
.description-full {
    margin-bottom: 5px;
    line-height: 1.4;
}

.lpro72-participants {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
}

.participants-list {
    margin: 5px 0 0 0;
    padding-left: 20px;
}

.participants-list li {
    margin-bottom: 3px;
    font-style: italic;
}

.participants-dropdown {
    margin-top: 10px;
}

.participants-list-hidden {
    margin-top: 5px;
    padding-left: 20px;
}

.participants-dropdown .btn-link {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9em;
}

.participants-dropdown .btn-link:hover {
    text-decoration: underline;
}