/* ===== IMPORTATION DES POLICES ===== */
/* Police moderne depuis Google Fonts pour un look professionnel */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* ===== STYLES GÉNÉRAUX ET RESET ===== */
/* Configuration de base du corps de la page */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1e1e1e;  /* Fond sombre pour le thème dark */
    color: #f0f0f0;             /* Texte clair */
    display: flex;
    flex-direction: column;
    min-height: 100vh;          /* Pleine hauteur de la fenêtre */
}

/* ===== EN-TÊTE DE L'APPLICATION ===== */
header {
    background-color: #2c2c2c;  /* Fond légèrement plus clair que le body */
    color: #f0f0f0;
    padding: 1.5rem;
    text-align: center;
    display: flex;
    justify-content: space-between; /* Titre à gauche, bouton à droite */
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); /* Ombre subtile */
}

/* Titre principal de l'application */
h1 {
    margin: 0;
    font-weight: 600;
}

/* ===== STYLES DES BOUTONS ===== */
/* Style de base pour tous les boutons */
button {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;        /* Boutons arrondis */
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;  /* Animation douce */
    text-transform: uppercase;   /* Texte en majuscules */
}

/* Bouton principal de création d'événement */
#add-event-btn {
    background-color: #2ecc71;  /* Vert success */
    color: white;
}

#add-event-btn:hover {
    background-color: #27ae60;  /* Vert plus foncé au survol */
    transform: translateY(-2px); /* Effet de soulèvement */
}

/* ===== CONTENU PRINCIPAL ===== */
main {
    padding: 2rem;
    flex-grow: 1;               /* Prend tout l'espace restant */
    max-width: 1200px;          /* Largeur maximale pour la lisibilité */
    margin: 0 auto;             /* Centrage horizontal */
    width: 100%;
}

/* ===== NAVIGATION DU CALENDRIER ===== */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Titre du mois/année affiché */
.calendar-nav h2 {
    font-weight: 600;
    color: #f0f0f0;
    letter-spacing: 1px;        /* Espacement des lettres pour l'élégance */
}

/* Boutons de navigation (précédent/suivant) */
.calendar-nav button {
    background-color: #3a3a3a;
    color: #f0f0f0;
    border: 1px solid #555;
    border-radius: 5px;
}

.calendar-nav button:hover {
    background-color: #555;
    transform: none;            /* Pas d'effet de soulèvement pour ces boutons */
}

/* ===== SÉLECTEUR DE VUE ===== */
.view-selector {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 2rem;
    background: #3a3a3a;
    border-radius: 25px;
    padding: 5px;
    width: fit-content;
    margin: 0 auto 2rem;
}

.view-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    color: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-transform: none;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

.view-btn.active {
    background: #2ecc71;
    color: white;
    font-weight: 600;
}

.view-btn.active:hover {
    background: #27ae60;
}

/* ===== BARRE DE RECHERCHE ===== */
.search-container {
    text-align: center;
    margin-bottom: 20px;
}

#event-search {
    padding: 10px 15px;
    width: 80%;
    max-width: 400px;
    border-radius: 50px;        /* Forme arrondie */
    border: 1px solid #555;
    background-color: #3a3a3a;
    color: #f0f0f0;
    font-size: 16px;
    transition: all 0.3s ease;
}

/* Placeholder de la barre de recherche */
#event-search::placeholder {
    color: #bbb;
}

/* État focus de la barre de recherche */
#event-search:focus {
    outline: none;
    border-color: #2ecc71;      /* Bordure verte au focus */
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.5); /* Effet de halo */
}

/* ===== FILTRE PAR COULEUR ===== */
.filters-container {
    margin-bottom: 1.5rem;
    text-align: center;
}

#color-filter {
    padding: 8px 15px;
    border: 1px solid #555;
    border-radius: 50px;
    background-color: #3a3a3a;
    color: #f0f0f0;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.event-item {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-item::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    margin-bottom: 5px;
}

.event-item:hover::after {
    opacity: 1;
}

#color-filter:hover {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ===== GRILLE DU CALENDRIER ===== */
/* En-têtes des jours de la semaine */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 colonnes égales */
    gap: 12px;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
    color: #bdbdbd;            /* Couleur plus discrète */
}

/* Grille principale du calendrier */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* 7 colonnes pour les jours */
    gap: 12px;
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); /* Ombre prononcée */
}

/* Style des cellules de jour */
.calendar-day {
    min-height: 100px;
    max-height: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    overflow: hidden;
    position: relative;
    transition: background 0.2s;
    background: #232328;      /* <-- AJOUT : couleur de fond */
    border: 1px solid #333;  /* <-- AJOUT : bordure visible */
    border-radius: 8px;      /* <-- AJOUT : coins arrondis */
    margin: 2px;             /* <-- AJOUT : petit espace entre les cases */
}
/* Effet de survol sur les jours */
.calendar-day:hover {
    background-color: #555555;
    transform: translateY(-3px); /* Soulèvement */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.calendar-day.empty {
    background: #232328; /* Même couleur que les autres cases */
    opacity: 0.5;       /* Plus pâle pour indiquer qu'elles sont hors du mois */
    cursor: default;
    box-shadow: none;
}

.calendar-day.empty:hover {
    background: #232328;
    transform: none;
}



.hour-block:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.hour-block.drag-over {
    background-color: rgba(46, 204, 113, 0.1) !important;
    border-left: 3px solid #2ecc71;
}

.hour-label {
    min-width: 70px;
    width: 70px;
    padding: 5px 10px;
    font-size: 12px;
    color: #bbb;
    font-weight: 500;
    text-align: center;
    border-right: 1px solid #444;
    background-color: #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.events-zone {
    flex: 1;
    position: relative;
    min-height: 60px;
    padding: 2px;
}

/* Événements dans la vue jour */
.day-event {
    position: absolute;
    background: linear-gradient(135deg, var(--event-color, #3498db), var(--event-color-dark, #2980b9));
    color: white;
    border-radius: 6px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    font-size: 13px;
    line-height: 1.3;
    cursor: grab;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    z-index: 10;
}

.day-event:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 20;
}

.day-event:active {
    cursor: grabbing;
}

.day-event .event-title {
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.day-event .event-time-range {
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 3px;
    font-weight: 500;
}

.day-event .event-description {
    font-size: 11px;
    opacity: 0.8;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Adaptation pour les événements courts */
.day-event[style*="height: 30px"] .event-description,
.day-event[style*="height: 40px"] .event-description,
.day-event[style*="height: 50px"] .event-description {
    display: none;
}

/* Scrollbar personnalisée pour la vue jour */
.day-view-grid::-webkit-scrollbar {
    width: 8px;
}

.day-view-grid::-webkit-scrollbar-track {
    background: #1e1e1e;
    border-radius: 4px;
}

.day-view-grid::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.day-view-grid::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Indicateurs pour heures spéciales */
.hour-block[data-hour="00"] .hour-label,
.hour-block[data-hour="12"] .hour-label {
    color: #2ecc71;
    font-weight: 600;
    background-color: rgba(46, 204, 113, 0.1);
}

.hour-block[data-hour="06"] .hour-label {
    color: #f39c12;
    background-color: rgba(243, 156, 18, 0.1);
}

.hour-block[data-hour="18"] .hour-label {
    color: #e67e22;
    background-color: rgba(230, 126, 34, 0.1);
}

.hour-block[data-hour="22"] .hour-label,
.hour-block[data-hour="23"] .hour-label {
    color: #8e44ad;
    background-color: rgba(142, 68, 173, 0.1);
}

/* ===== STYLES DES MODALES ===== */
/* Overlay de fond des modales */
.modal {
    display: none;              /* Cachées par défaut */
    position: fixed;
    z-index: 1000;              /* Au-dessus de tout */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6); /* Fond semi-transparent */
    backdrop-filter: blur(5px); /* Effet de flou sur l'arrière-plan */
    -webkit-backdrop-filter: blur(5px);
    padding-top: 60px;
}

/* Contenu principal des modales */
.modal-content {
    background-color: #2c2c2c;
    color: #f0f0f0;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: fadeIn 0.3s;
}

/* Liste des événements avec scroll si nécessaire */
#event-list {
    overflow-y: auto;
    max-height: calc(85vh - 100px);
    padding-right: 10px;
}

/* Scrollbar personnalisée pour la modal */
.modal-content::-webkit-scrollbar,
#event-list::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track,
#event-list::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb,
#event-list::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover,
#event-list::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Animation d'ouverture des modales */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bouton de fermeture des modales */
.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.close-btn:hover,
.close-btn:focus {
    color: #f0f0f0;
    text-decoration: none;
    cursor: pointer;
}

/* ===== STYLES DES FORMULAIRES ===== */
/* Disposition en colonne des formulaires */
form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Labels des champs */
label {
    font-weight: 600;
    color: #f0f0f0;
    margin-top: 10px;
}

/* Champs de saisie standard */
input[type="text"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: calc(100% - 20px);   /* Largeur moins le padding */
    padding: 10px;
    border: 1px solid #555;
    background-color: #3a3a3a;
    color: #f0f0f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

/* États focus des champs */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #2ecc71;      /* Bordure verte au focus */
}

/* Zone de texte spécifique */
textarea {
    resize: vertical;           /* Redimensionnement vertical seulement */
    min-height: 80px;
}

/* ===== CHAMPS DE TEMPS ===== */
/* Styles spécifiques pour les champs time */
input[type="time"] {
    cursor: pointer;
}

/* Icône du sélecteur de temps (WebKit) */
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);          /* Inversion pour thème sombre */
}

/* ===== VALIDATION DES HEURES ===== */
.time-validation-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 4px;
    border-left: 3px solid #e74c3c;
}

input.error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.3);
}

/* ===== BOUTONS DE FORMULAIRE ===== */
/* Boutons de soumission principaux */
#event-form button[type="submit"],
#edit-event-form button[type="submit"] {
    background-color: #2ecc71;  /* Vert par défaut */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
}

/* Bouton de modification (bleu) */
#edit-event-form button[type="submit"] {
    background-color: #3498db;
}

#edit-event-form button[type="submit"]:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* Bouton de suppression (rouge) */
#delete-from-edit {
    background-color: #e74c3c;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
}

#delete-from-edit:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* ===== AFFICHAGE DES ÉVÉNEMENTS ===== */

/* Événements dans la vue mois - style amélioré */
.event-preview {
    background: linear-gradient(135deg, var(--event-color, #3498db), var(--event-color-dark, #2980b9));
    border-radius: 4px;
    padding: 2px 6px;
    margin: 1px 0;
    font-size: 11px;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: none;
    border-left: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.event-preview:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.event-mini-title {
    font-weight: 500;
    line-height: 1.2;
}

/* Conteneur individuel d'événement dans les modales */
.event-item {
    background-color: #3a3a3a;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-left: 5px solid;     /* Bordure colorée (couleur définie en JS) */
}

/* Titre de l'événement */
.event-item h4 {
    margin: 0 0 5px;
    font-weight: 600;
    color: #f0f0f0;
    word-wrap: break-word;
    white-space: normal;
}

/* Description de l'événement */
.event-item p {
    margin: 0;
    color: #bdbdbd;
}

.event-description {
    margin-top: 10px;
    color: #ccc;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Conteneur des boutons d'action */
.event-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

/* Style des boutons d'action */
.event-actions button {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 20px;
}

/* Bouton de modification */
.edit-btn {
    background-color: #3498db;  /* Bleu */
    color: white;
}

.edit-btn:hover {
    background-color: #2980b9;
}

/* Bouton de suppression */
.delete-btn {
    background-color: #e74c3c;  /* Rouge */
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* ===== SÉLECTEURS DE COULEUR ===== */
/* Configuration pour les sélecteurs de couleur */
.color-picker-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Input color personnalisé */
#event-color {
    padding: 0;
    width: 40px;
    height: 40px;
    border: 1px solid #555;
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
}

/* Suppression des styles par défaut des navigateurs */
#event-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

#event-color::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

#event-color::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

/* Pastilles de couleur cliquables */
.palette-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.palette-color:hover {
    transform: scale(1.1);
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

.palette-color.selected {
    border-color: #f0f0f0;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* ===== LISTE DÉROULANTE DE MODIFICATION ===== */
#edit-event-color-select {
    padding: 10px;
    border: 1px solid #555;
    background-color: #3a3a3a;
    color: #f0f0f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
}

/* Options de la liste déroulante */
#edit-event-color-select option {
    font-family: 'Poppins', sans-serif;
    color: #f0f0f0;
}

/* ===== SYSTÈME DRAG & DROP ===== */
/* Style pour les événements déplaçables */
.event-item[draggable="true"] {
    transition: opacity 0.2s ease, transform 0.2s ease;
    position: relative;
    cursor: grab;               /* Curseur de saisie */
}

/* Effet de survol sur les événements déplaçables */
.event-item[draggable="true"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Curseur pendant le drag */
.event-item[draggable="true"]:active {
    cursor: grabbing;
}

/* Indicateur visuel de déplacement (⋮⋮) */
.event-item[draggable="true"]::before {
    content: "⋮⋮";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 12px;
    opacity: 0;                 /* Invisible par défaut */
    transition: opacity 0.2s ease;
}

/* Affichage de l'indicateur au survol */
.event-item[draggable="true"]:hover::before {
    opacity: 1;
}

/* Zone de drop valide (jour du calendrier) */
.calendar-day.drag-over {
    background-color: #2ecc71 !important; /* Vert success */
    color: white !important;
    transform: scale(1.05);     /* Léger agrandissement */
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5); /* Halo vert */
    border: 2px solid #27ae60;
    border-radius: 8px;
}

/* Icône animée dans la zone de drop */
.calendar-day.drag-over::after {
    content: "📅";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    animation: bounce 0.5s infinite alternate; /* Animation de rebond */
}

/* Animation de rebond pour l'icône */
@keyframes bounce {
    0% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.2); }
}

/* ===== ÉTATS GLOBAUX PENDANT LE DRAG ===== */
/* Curseur global pendant le drag */
.is-dragging {
    cursor: grabbing !important;
}

.is-dragging * {
    cursor: grabbing !important;
}

/* ===== NOTIFICATIONS CUSTOM ===== */
.custom-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slideInNotification 0.5s ease-out;
    max-width: 350px;
    backdrop-filter: blur(10px);
}

.notification-content {
    padding: 20px;
    color: white;
    text-align: left;
}

.notification-content h4 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
}

.notification-content p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.notification-content .event-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-style: italic;
    margin-top: 8px;
}

.notification-content button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.notification-content button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

@keyframes slideInNotification {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== INDICATEURS MULTI-ÉVÉNEMENTS ===== */

/* Case de calendrier avec plusieurs événements */
.calendar-day.multiple-events {
    position: relative;
    overflow: visible;
}

/* Compteur d'événements dans le coin */
.event-counter {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Container des petits points colorés */
.event-dots {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2px;
    align-items: center;
}

/* Petits points pour les événements supplémentaires */
.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Point spécial pour "plus d'événements" */
.event-dot.more-events {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    border-radius: 3px;
    width: auto;
    height: auto;
    padding: 1px 3px;
    font-size: 8px;
    font-weight: bold;
    line-height: 1;
}

#add-participants-modal {
    z-index: 1001 !important;
}

#add-participants-modal .modal-content {
    z-index: 1002 !important;
}

#participants-modal {
    z-index: 1001 !important;
}

#participants-modal .modal-content {
    z-index: 1002 !important;
}

/* Effet de survol sur les cases multi-événements */
.calendar-day.multiple-events:hover .event-counter {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.calendar-day.multiple-events:hover .event-dot {
    transform: scale(1.2);
    transition: all 0.2s ease;
}

/* ===== SPINNER DE CHARGEMENT ===== */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner-content {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #555;
    border-top: 3px solid #2ecc71;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-content p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

/* ===== NOTIFICATIONS TOAST ===== */
.notification-toast {
    position: fixed;
    top: 20px;
    right: -300px;
    background: #2c2c2c;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: right 0.3s ease;
    z-index: 1000;
    min-width: 250px;
    max-width: 400px;
}

.notification-toast.show {
    right: 20px;
}

.notification-toast.success {
    border-left: 4px solid #2ecc71;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.notification-toast.error {
    border-left: 4px solid #e74c3c;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

/* ===== STYLES RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Navigation responsive */
    .calendar-nav {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 1rem;
    }
    
    .calendar-nav h2 {
        order: -1;
        margin-bottom: 10px;
    }
    
    /* Grille calendrier responsive */
    .calendar-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        grid-auto-rows: 100px; /* même hauteur pour chaque ligne */
        gap: 10px;
    }
    
    .calendar-day {
        padding: 10px 5px;
        font-size: 14px;
    }
    
    /* Vue jour responsive */
    .day-view-grid {
        max-height: 60vh;
    }
    
    .hour-label {
        min-width: 50px;
        width: 50px;
        font-size: 10px;
        padding: 2px 5px;
    }
    
    .day-event {
        font-size: 11px;
        padding: 2px 4px;
    }
    
    /* Modales responsive */
    .modal-content {
    width: 95%;
    margin: 2% auto;
    padding: 20px;
    max-height: 90vh;
    }

    #event-list {
        max-height: calc(90vh - 80px);
    }
    /* Boutons responsive */
    .view-selector {
        padding: 3px;
    }
    
    .view-btn {
        padding: 6px 15px;
        font-size: 12px;
    }
    
    /* Barre de recherche responsive */
    #event-search {
        width: 95%;
        font-size: 14px;
    }
    
    /* En-têtes responsive */
    .weekdays {
        font-size: 12px;
        gap: 8px;
    }
    
    /* Événements responsive */
    .event-preview {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    .event-counter {
        width: 16px;
        height: 16px;
        font-size: 9px;
        top: 2px;
        right: 2px;
    }
    
    /* Notifications responsive */
    .notification-toast {
        right: -250px;
        min-width: 200px;
        max-width: 90vw;
    }
    
    .notification-toast.show {
        right: 10px;
    }
}

@media (max-width: 480px) {
    /* Très petits écrans */
    main {
        padding: 1rem;
    }
    
    header {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .calendar-day {
        padding: 8px 2px;
        min-height: 40px;
    }
    
    .modal-content {
        width: 98%;
        padding: 15px;
    }
    
    .day-view-grid {
        max-height: 50vh;
    }
}
/* ===== STYLES STAR CITIZEN - CATÉGORIES ===== */

/* Badge de catégorie dans les événements détaillés */
.event-category-badge {
    display: inline-block;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
}

/* Icône de catégorie dans les événements compacts */
.event-category-icon {
    font-size: 12px;
    margin-right: 4px;
    opacity: 0.9;
}

/* Header des événements avec catégorie et système */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 11px;
}

/* Information système stellaire */
.event-system {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-style: italic;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== SÉLECTEURS DE CATÉGORIES STYLISÉS ===== */

/* Sélecteur principal avec icônes */
#event-color,
#edit-event-color-select {
    background-image: linear-gradient(135deg, #3a3a3a 0%, #2c2c2c 100%);
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px 15px;
    color: #f0f0f0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#event-color:hover,
#edit-event-color-select:hover {
    border-color: #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
}

/* Options avec couleurs de fond */
#event-color option,
#edit-event-color-select option {
    padding: 8px 12px;
    color: white;
    font-weight: 500;
}

/* ===== FILTRE PAR CATÉGORIE STAR CITIZEN ===== */

#color-filter {
    background: linear-gradient(135deg, #3a3a3a 0%, #2c2c2c 100%);
    border: 1px solid #555;
    border-radius: 20px;
    padding: 8px 20px;
    color: #f0f0f0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

#color-filter:hover {
    border-color: #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
    transform: translateY(-1px);
}

#color-filter:focus {
    outline: none;
    border-color: #2ecc71;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.5);
}

/* ===== STYLES SPÉCIFIQUES PAR CATÉGORIE ===== */

/* Combat - Rouge agressif */
.event-item[data-category="combat"],
.event-preview[data-category="combat"] {
    --event-color: #e74c3c;
    --event-color-dark: #c0392b;
    border-left-color: #e74c3c !important;
}

/* Exploration - Bleu spatial */
.event-item[data-category="exploration"],
.event-preview[data-category="exploration"] {
    --event-color: #3498db;
    --event-color-dark: #2980b9;
    border-left-color: #3498db !important;
}

/* Commerce - Orange doré */
.event-item[data-category="commerce"],
.event-preview[data-category="commerce"] {
    --event-color: #f39c12;
    --event-color-dark: #e67e22;
    border-left-color: #f39c12 !important;
}

/* Mining - Gris métallique */
.event-item[data-category="mining"],
.event-preview[data-category="mining"] {
    --event-color: #95a5a6;
    --event-color-dark: #7f8c8d;
    border-left-color: #95a5a6 !important;
}

/* Transport - Violet */
.event-item[data-category="transport"],
.event-preview[data-category="transport"] {
    --event-color: #9b59b6;
    --event-color-dark: #8e44ad;
    border-left-color: #9b59b6 !important;
}

/* Social - Vert communautaire */
.event-item[data-category="social"],
.event-preview[data-category="social"] {
    --event-color: #2ecc71;
    --event-color-dark: #27ae60;
    border-left-color: #2ecc71 !important;
}

/* Formation - Gris foncé */
.event-item[data-category="formation"],
.event-preview[data-category="formation"] {
    --event-color: #34495e;
    --event-color-dark: #2c3e50;
    border-left-color: #34495e !important;
}

/* Maintenance - Turquoise technique */
.event-item[data-category="maintenance"],
.event-preview[data-category="maintenance"] {
    --event-color: #16a085;
    --event-color-dark: #138d75;
    border-left-color: #16a085 !important;
}

/* ===== LÉGENDE DES CATÉGORIES ===== */

.categories-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
    font-weight: 500;
    color: #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-legend-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.category-legend-icon {
    font-size: 14px;
}

.category-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== SÉLECTEUR DE SYSTÈME STELLAIRE ===== */

select[id*="system"] {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px 15px;
    color: #f0f0f0;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

select[id*="system"]:hover {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

select[id*="system"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.5);
}

select[id*="system"] option {
    background: #2c3e50;
    color: #f0f0f0;
    padding: 8px;
}

/* ===== ANIMATIONS SPÉCIALES STAR CITIZEN ===== */

/* Animation de pulsation pour les événements combat */
.event-preview[data-category="combat"]:hover,
.day-event[data-category="combat"]:hover {
    animation: combatPulse 0.5s ease-in-out;
}

@keyframes combatPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(231, 76, 60, 0.5); }
}

/* Animation de rotation pour exploration */
.event-preview[data-category="exploration"]:hover .event-category-icon {
    animation: rotateIcon 1s ease-in-out;
}

@keyframes rotateIcon {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Effet de brillance pour commerce */
.event-preview[data-category="commerce"]:hover,
.day-event[data-category="commerce"]:hover {
    position: relative;
    overflow: hidden;
}

.event-preview[data-category="commerce"]:hover::before,
.day-event[data-category="commerce"]:hover::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 0.8s ease-in-out;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ===== RESPONSIVE POUR CATÉGORIES ===== */

@media (max-width: 768px) {
    .categories-legend {
        flex-direction: column;
        gap: 8px;
    }
    
    .category-legend-item {
        justify-content: flex-start;
        padding: 6px 10px;
    }
    
    .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .event-system {
        align-self: flex-end;
    }
    
    #color-filter {
        padding: 6px 15px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .event-category-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .event-category-icon {
        font-size: 10px;
        margin-right: 2px;
    }
    
    .event-system {
        font-size: 9px;
        padding: 1px 4px;
    }
}
/* Zones de drop avec indicateurs de conflit */
.calendar-day.drop-conflict {
    background-color: rgba(231, 76, 60, 0.3) !important;
    border: 2px solid #e74c3c !important;
    cursor: not-allowed !important;
}

.calendar-day.drop-conflict::after {
    content: "⚠️";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #e74c3c;
}

.calendar-day.drop-available {
    background-color: rgba(46, 204, 113, 0.2) !important;
    border: 2px solid #2ecc71 !important;
}

.calendar-day.drop-available::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #2ecc71;
}

/* ===== CORRECTION AFFICHAGE LISTE DÉROULANTE ===== */

/* Correction du conteneur select */
#color-filter {
    background: #3a3a3a !important;
    color: #f0f0f0 !important;
    border: 1px solid #555;
    border-radius: 20px;
    padding: 8px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    cursor: pointer;
    /* Forcer l'affichage du texte */
    text-indent: 0;
    text-overflow: clip;
    white-space: nowrap;
}

/* Correction des options - texte visible */
#color-filter option {
    background: #3a3a3a !important;
    color: #f0f0f0 !important;
    padding: 8px 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    /* Assurer la visibilité du texte */
    text-indent: 0;
    display: block;
    white-space: nowrap;
    overflow: visible;
}

/* Styles spécifiques pour différents navigateurs */
@supports (-webkit-appearance: none) {
    #color-filter option {
        -webkit-appearance: none;
        appearance: none;
        background-color: #3a3a3a !important;
        color: #f0f0f0 !important;
    }
}

/* Pour Firefox spécifiquement */
@-moz-document url-prefix() {
    #color-filter {
        background-color: #3a3a3a !important;
        color: #f0f0f0 !important;
    }
    
    #color-filter option {
        background-color: #3a3a3a !important;
        color: #f0f0f0 !important;
        padding: 6px 10px;
    }
}

/* État hover des options */
#color-filter option:hover {
    background-color: #555 !important;
    color: #ffffff !important;
}

/* État sélectionné */
#color-filter option:checked {
    background-color: #2ecc71 !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Correction pour les autres sélecteurs aussi */
#event-color option,
#edit-event-color-select option {
    background: #3a3a3a !important;
    color: #f0f0f0 !important;
    padding: 8px 12px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    text-indent: 0;
    white-space: nowrap;
}

/* Style pour le conteneur déroulant ouvert */
select:focus {
    outline: 2px solid #2ecc71;
    outline-offset: 2px;
}

/* Alternative si le problème persiste */
#color-filter {
    /* Forcer le rendu du texte */
    -webkit-text-fill-color: #f0f0f0;
    text-rendering: optimizeLegibility;
}
/* ===== AFFICHAGE SYSTÈME STELLAIRE ===== */

/* Système dans l'en-tête des événements détaillés */
.event-system {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Système dans la vue mois (compact) */
.event-mini-title {
    font-weight: 500;
    line-height: 1.2;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Système dans la vue jour */
.event-time-range {
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 3px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive pour petits écrans */
@media (max-width: 768px) {
    .event-system {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    .event-mini-title {
        font-size: 10px;
    }
    
    .event-time-range {
        font-size: 10px;
    }
}
/* ======= AJOUT STYLES ADMIN ======= */

/* Conteneur principal admin */
.admin-container {
    max-width: 900px;
    margin: 2em auto;
    background: #232733;
    border-radius: 15px;
    box-shadow: 0 4px 24px #0008;
    padding: 2em 2em 2.5em 2em;
}

header.admin-header {
    width: 100%;
    background: #232733;
    color: #fff;
    box-shadow: 0 2px 16px #0005;
    padding: 0.5em 0 0.5em 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
}

.header-icon {
    font-size: 2em;
    margin-right: 12px;
    vertical-align: middle;
}
/* h1 gardé générique car même style partout */

/* Recherche utilisateur */
.search-box {
    width: 100%;
    max-width: 350px;
    padding: 11px 16px;
    border-radius: 22px;
    border: none;
    outline: none;
    margin: 0 auto 2em auto;
    display: block;
    font-size: 1.05em;
    background: #191c23;
    color: #fff;
    box-shadow: 0 2px 8px #0002 inset;
    transition: box-shadow 0.2s;
}
.search-box:focus {
    box-shadow: 0 2px 16px #00d5ff33;
}

/* Table utilisateurs */
.user-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #232733;
    color: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 1px 8px #0003;
}
.user-table th, .user-table td {
    padding: 13px 14px;
    text-align: left;
}
.user-table th {
    background: #1e202a;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #2c2f3a;
}
.user-table tbody tr:nth-child(odd) {
    background: #232733;
}
.user-table tbody tr:nth-child(even) {
    background: #272b37;
}
.user-table tbody tr:hover {
    background: #32394a;
    transition: background 0.12s;
}

/* Avatar rond */
.avatar {
    display: inline-flex;
    width: 36px; height: 36px;
    background: linear-gradient(135deg,#0682a1,#2ecc71 70%);
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 8px;
    border: 2px solid #191c23;
    box-shadow: 0 2px 8px #0003;
}

/* Badge de rôle */
.role-badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 12px;
    color: #fff;
    font-size: 0.98em;
    font-weight: 600;
    text-shadow: 0 1px 2px #0005;
}
.role-visiteur { background: #757575; }
.role-Aspirant { background: #2ecc71; }
.role-Consacré { background: #f39c12; }
.role-Gardien { background: #9b59b6; }
.role-Inquisiteur { background: #e74c3c; }
.role-Maitre { background: #34495e; }
.role-Sage { background: #16a085; }

/* Bouton éditer utilisateur */
.edit-user-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    transition: color 0.2s;
    color: #00bfff;
    outline: none;
}
.edit-user-btn:hover { color: #2ecc71; }

/* Modal admin */
.modal-bg {
    position:fixed;left:0;top:0;width:100vw;height:100vh;
    background:#0007;display:flex;align-items:center;justify-content:center;z-index:9999;
}
.modal-content {
    background:#232733;
    padding:2em;
    border-radius:15px;
    min-width:300px;
    box-shadow:0 2px 16px #000a;
}
.modal-content h3 { margin-top:0 }
.modal-content label { margin-right:0.5em }
.modal-content select { padding:0.5em; border-radius:6px;}
.modal-content button {
    padding:0.6em 1.2em;
    background:#16a085;
    color:#fff;
    border:none;
    border-radius:8px;
    cursor:pointer;
    margin-right: 0.5em;
}
.modal-content button.cancel { background:#555; }

/* Bouton retour accueil */
#back-home-btn {
    margin-left: 30px;
    padding: 8px 16px;
    background: #2ecc71;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.18s;
}
#back-home-btn:hover {
    background: #27ae60;
}

/* Responsive admin */
@media (max-width: 700px) {
    .admin-container { padding: 1em 2px; }
    .user-table th, .user-table td { padding: 10px 6px; font-size: 0.96em;}
    .avatar { width:28px; height:28px; font-size:1em;}
    header.admin-header { flex-direction: column; gap: 12px; }
    #back-home-btn { margin-left: 0; }
}
@media (max-width: 500px) {
    .user-table th:nth-child(4), .user-table td:nth-child(4) { display: none; }
    h1 { font-size: 1.2em; }
}

/* Vue semaine */
.week-view-grid {
    display: block !important;
    background-color: #2c2c2c;
    border-radius: 12px;
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.week-container {
    position: relative;
    min-height: 1440px;
    width: 100%;
}

.week-days-header {
    display: grid;
    grid-template-columns: 70px repeat(7, 1fr);
    background: #1e1e1e;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #444;
}

.hour-column {
    border-right: 1px solid #444;
}

.day-column-header {
    padding: 10px;
    text-align: center;
    font-weight: 600;
    color: #2ecc71;
    border-right: 1px solid #444;
}

.week-hour-row {
    display: grid;
    grid-template-columns: 70px repeat(7, 1fr);
    height: 60px;
    border-bottom: 1px solid #444;
}

.week-hour-label {
    padding: 5px;
    font-size: 12px;
    color: #bbb;
    text-align: center;
    border-right: 1px solid #444;
    background: #3a3a3a;
}

.week-day-cell {
    position: relative;
    border-right: 1px solid #444;
    transition: background 0.2s;
}

.week-day-cell:hover {
    background: rgba(255, 255, 255, 0.02);
}

.week-day-cell.drag-over {
    background: rgba(46, 204, 113, 0.1);
}

.week-event {
    position: absolute;
    background: linear-gradient(135deg, var(--event-color), var(--event-color-dark));
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 11px;
    overflow: hidden;
    cursor: grab;
    z-index: 5;
}

.week-event .event-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.week-event .event-time-small {
    font-size: 9px;
    opacity: 0.9;
}

.week-event {
    position: absolute;
    background: linear-gradient(135deg, var(--event-color), var(--event-color-dark));
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
    overflow: hidden;
    cursor: pointer;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.week-event:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.week-event .event-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.week-event .event-time-small {
    font-size: 9px;
    opacity: 0.9;
    margin-bottom: 3px;
}

.event-description-week {
    font-size: 10px;
    line-height: 1.3;
    opacity: 0.85;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.week-container {
    position: relative;
    min-height: 1500px; /* 24h * 60px + header */
    width: 100%;
}

.week-events-container {
    position: absolute;
    top: 60px;
    left: 70px;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* ===== MENU UTILISATEUR DÉROULANT (RAPPEL EN FIN DE FICHIER) ===== */
.user-menu-container {
    position: relative;
    display: inline-block;
}

#user-menu-toggle {
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 30px;
    padding: 7px 15px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: #2ecc71;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 5px;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 120%;
    min-width: 180px;
    background: #232328;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-radius: 10px;
    z-index: 999;
    padding: 10px 0;
    flex-direction: column;
    gap: 5px;
    animation: fadeIn 0.25s;
}

.user-menu-dropdown.show {
    display: flex;
}

.user-menu-dropdown button {
    background: none;
    border: none;
    color: #f0f0f0;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 18px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s;
}

.user-menu-dropdown button:hover {
    background: #3498db22;
    color: #2ecc71;
}

#logout-btn {
    color: #e74c3c;
}

#logout-btn:hover {
    background: #e74c3c22;
}

/* ===== SOUS-MENU LIENS UTILES (dans le menu utilisateur) ===== */
.submenu-container {
    position: relative;
    width: 100%;
}

.submenu-toggle {
    width: 100%;
    background: none;
    color: #2ecc71;
    border: none;
    padding: 8px 18px;
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s;
}

.submenu-toggle:hover {
    background: #2ecc7122;
}

.submenu-dropdown {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    background: #232328;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-radius: 10px;
    padding: 8px 0;
    flex-direction: column;
    z-index: 1000;
}

.submenu-dropdown.show {
    display: flex;
}

.submenu-dropdown a {
    display: block;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
}

.submenu-dropdown a:hover {
    background: #3498db22;
    color: #2ecc71;
}

/* Responsive pour le sous-menu dropdown */
@media (max-width: 600px) {
    .submenu-dropdown {
        left: 0;
        top: 100%;
        min-width: 180px;
    }
}

/* ===== SECTION LIENS UTILES (si jamais utilisée ailleurs) ===== */
.useful-links-section {
    background: #191c23;
    border-radius: 10px;
    box-shadow: 0 2px 6px #0003;
    padding: 1.2em;
    margin-bottom: 2em;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.useful-links-section h2 {
    color: #2ecc71;
    margin: 0 0 0.5em 0;
    font-size: 1.12em;
}

#useful-links-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

#useful-links-list li {
    margin: 7px 0;
}

#useful-links-list a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.18s;
}

#useful-links-list a:hover {
    color: #2ecc71;
    text-decoration: underline;
}