/* === BOUTON DE DÉCONNEXION ORIENTAJEU - CORRIGÉ === */

/* Conteneur du bouton de déconnexion */
.logout-button-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999; /* ✅ CORRECTION : z-index très élevé pour être au-dessus de tout */
    animation: slideInRight 0.5s ease-out;
    pointer-events: none; /* ✅ CORRECTION : Le conteneur ne capture pas les événements */
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Bouton de déconnexion */
.logout-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    
    /* ✅ CORRECTION : Fond plus opaque et couleur Rhinodream */
    background: linear-gradient(135deg, rgba(217, 104, 94, 0.95), rgba(194, 88, 80, 0.95));
    
    /* ✅ CORRECTION : Bordure plus visible */
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ✅ CORRECTION : Ombre plus marquée pour la visibilité */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    
    min-height: 44px;
    
    /* ✅ CORRECTION : Le bouton capture les événements */
    pointer-events: auto;
    
    /* ✅ CORRECTION : Empêcher la sélection du texte */
    user-select: none;
    -webkit-user-select: none;
}

.logout-button:hover {
    /* ✅ CORRECTION : Fond encore plus visible au survol */
    background: linear-gradient(135deg, rgba(217, 104, 94, 1), rgba(194, 88, 80, 1));
    border-color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.logout-button:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.logout-button-icon {
    font-size: 18px;
    line-height: 1;
}

.logout-button-text {
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

/* ✅ CORRECTION : Empêcher l'interaction avec d'autres éléments */
.logout-button-container * {
    pointer-events: auto;
}

/* Modal de confirmation de déconnexion */
.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.logout-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.logout-modal-header {
    background: #5a9099;
    color: white;
    padding: 24px;
    text-align: center;
    border-radius: 16px 16px 0 0;
}

.logout-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-modal-body {
    padding: 24px;
    text-align: center;
}

.logout-modal-body p {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 24px;
    line-height: 1.6;
}

.logout-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.logout-modal-actions button {
    flex: 1;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    min-height: 44px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.logout-confirm-button {
    background: #d9685e;
    color: white;
}

.logout-confirm-button:hover {
    background: #c25850;
    transform: translateY(-2px);
}

.logout-cancel-button {
    background: #ecf0f1;
    color: #2c3e50;
}

.logout-cancel-button:hover {
    background: #bdc3c7;
}

/* Indicateur de session */
.session-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 8px 16px;
    background: rgba(90, 144, 153, 0.9);
    border-radius: 20px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
    transition: opacity 0.3s;
    z-index: 998;
}

.session-indicator:hover {
    opacity: 1;
}

.session-indicator.expiring {
    background: rgba(243, 156, 18, 0.9);
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Notification de session expirée */
.session-expired-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 10001;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.5s ease-out;
}

.session-expired-notification h3 {
    font-size: 20px;
    color: #f39c12;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.session-expired-notification p {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 24px;
}

.session-expired-notification button {
    background: #5a9099;
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    min-height: 44px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.session-expired-notification button:hover {
    background: #4a7f88;
    transform: translateY(-2px);
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
    .logout-button-container {
        top: 12px;
        right: 12px;
    }
    
    .logout-button {
        padding: 10px 16px;
        font-size: 13px;
        gap: 6px;
        border-radius: 10px;
        /* ✅ CORRECTION : Garder le texte visible sur mobile */
    }
    
    .logout-button-icon {
        font-size: 16px;
    }
    
    .logout-button-text {
        font-size: 13px;
    }
    
    .logout-modal-content {
        max-width: 90%;
    }
    
    .logout-modal-actions {
        flex-direction: column;
    }
    
    .logout-modal-actions button {
        width: 100%;
    }
    
    .session-indicator {
        left: 50%;
        transform: translateX(-50%);
        bottom: 12px;
        font-size: 11px;
    }
}

/* Très petit écran */
@media (max-width: 375px) {
    .logout-button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .logout-button-icon {
        font-size: 14px;
    }
    
    .logout-button-text {
        /* ✅ CORRECTION : Sur très petit écran, on peut masquer le texte */
        display: none;
    }
    
    .logout-button {
        /* Bouton circulaire sur très petit écran */
        width: 44px;
        height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* Accessibilité - focus visible */
.logout-button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ✅ CORRECTION : Empêcher les conflits de z-index avec d'autres éléments */
.metier-button,
.btn-primary,
.btn-secondary {
    position: relative;
    z-index: 1; /* Les autres boutons restent en dessous */
}

/* ✅ CORRECTION : S'assurer que le bouton est au-dessus des cartes */
.card,
.milieu-card,
.metier-item {
    position: relative;
    z-index: 1;
}

/* ✅ CORRECTION : Le bouton de déconnexion reste au-dessus de tout */
.logout-button-container {
    isolation: isolate; /* Crée un nouveau contexte d'empilement */
}