/* Force sidebar to be visible on desktop */
@media (min-width: 992px) {
    .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 250px !important;
        height: 100vh !important;
        display: flex !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        z-index: 1000;
        transition: all 0.3s ease;
        overflow: hidden !important;
    }
    
    /* Limiter le scroll uniquement au sous-menu historique */
    .app-sidebar-menu#kt_app_sidebar_menu_wrapper {
        overflow-y: auto !important;
        max-height: calc(100vh - 300px) !important;
    }
    
    .app-sidebar-menu#kt_app_sidebar_favmenu_wrapper {
        overflow: visible !important;
    }
    
    .app-header {
        position: fixed !important;
        top: 0 !important;
        left: 250px !important;
        right: 0 !important;
        z-index: 999;
        transition: all 0.3s ease;
    }
    
    .app-main {
        margin-left: 250px !important;
        margin-top: 80px !important;
        min-height: calc(100vh - 160px);
        transition: all 0.3s ease;
    }
    
    .app-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: 250px !important;
        right: 0 !important;
        z-index: 998;
        transition: all 0.3s ease;
    }

    /* Styles for minimized sidebar using Metronic's attribute */
    body[data-kt-app-sidebar-minimize="on"] .app-sidebar {
        transform: translateX(-250px) !important;
    }
    
    body[data-kt-app-sidebar-minimize="on"] .app-header,
    body[data-kt-app-sidebar-minimize="on"] .app-footer {
        left: 0 !important;
    }

    body[data-kt-app-sidebar-minimize="on"] .app-main {
        margin-left: 0 !important;
    }

    /* Hide the header toggle button when sidebar is open, as there is a close button inside the sidebar */
    body:not([data-kt-app-sidebar-minimize="on"]) #kt_app_sidebar_toggle {
        display: none !important;
    }
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .app-main {
        margin-left: 0 !important;
        min-height: calc(100vh - 120px) !important;
    }
    
    .app-footer {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 98;
    }

    /* Fix pour éviter le scroll de toute la page */
    body {
        overflow-x: hidden;
        position: relative;
        height: 100vh;
    }
    
    .app-root {
        height: 100vh;
        overflow: hidden;
    }
        
    .app-main {
        margin-top: 0 !important;
    }
}


/* Style pour les liens dans les détails utilisateur */
.text-hover-primary:hover {
    color: var(--bs-primary) !important;
    text-decoration: none;
}

/* Amélioration de la lisibilité */
.fs-7 {
    font-size: 0.75rem !important;
}

.text-gray-900 {
    font-weight: 500;
}

/* Animation pour les détails temporels */
.text-muted.fs-7 {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.d-flex:hover .text-muted.fs-7 {
    opacity: 1;
}
