.mdk-drawer.js-mdk-drawer {
    z-index: 1000;
}

/* Styles pour adapter la sidebar à la longueur du texte - LARGEUR ADAPTATIVE */
.sidebar {
    min-width: 280px !important; /* Largeur minimale */
    max-width: none !important; /* Pas de limite maximale */
    overflow-x: visible !important; /* Permet l'expansion mais pas de scrollbar */
    overflow-y: auto !important; /* Garde le défilement vertical */
}

.sidebar-menu-button {
    white-space: nowrap !important; /* TEXTE SUR UNE SEULE LIGNE */
    display: flex !important; /* Utilise flexbox pour la disposition */
    align-items: center !important; /* Centre verticalement les éléments */
    padding: 12px 20px !important; /* Espacement adapté */
    width: auto !important; /* Largeur auto pour s'adapter au texte */
    overflow: visible !important; /* Pas de cache du texte */
}

.sidebar-menu-text {
    white-space: nowrap !important; /* TEXTE SUR UNE SEULE LIGNE */
    flex: 1 1 auto !important; /* Prend l'espace nécessaire */
    overflow: visible !important; /* Pas de cache */
    display: inline-block !important;
}

.sidebar-menu-icon {
    flex-shrink: 0 !important; /* Empêche l'icône de se rétrécir */
    margin-right: 15px !important; /* Espacement entre l'icône et le texte */
    width: 24px !important; /* Largeur fixe pour l'icône */
}

.sidebar-menu-toggle-icon {
    flex-shrink: 0 !important; /* Empêche l'icône de toggle de se rétrécir */
    margin-left: 10px !important; /* Espacement à gauche de l'icône */
    width: 20px !important; /* Largeur fixe pour l'icône */
}

/* Adaptation pour les sous-menus */
.sidebar-submenu .sidebar-menu-button {
    padding-left: 50px !important; /* Indentation pour les sous-menus */
    width: auto !important;
}

.sidebar-submenu .sidebar-menu-text {
    font-size: 14px !important; /* Taille de police légèrement plus petite pour les sous-menus */
    white-space: nowrap !important; /* TEXTE SUR UNE SEULE LIGNE */
}

/* Pour les titres de section dans la sidebar */
.sidebar-heading {
    white-space: nowrap !important; /* TEXTE SUR UNE SEULE LIGNE */
    padding: 0 20px !important;
    width: auto !important;
}

/* S'assurer que la sidebar peut s'étendre */
.mdk-drawer__content {
    /* width: fit-content !important; /* S'adapte au contenu */
    width: inherit !important; /* S'adapte au contenu */
    min-width: 280px !important;
    max-width: none !important;
    overflow-x: visible !important;
}

/* Adaptation du contenu principal pour s'ajuster à la sidebar élargie */
.mdk-drawer-layout__content {
    transition: margin-left 0.3s ease;
}

/* Style pour l'effet de survol */
.sidebar-menu-button:hover .sidebar-menu-text {
    color: inherit;
}

/* ============================================
   DÉSACTIVATION DU SCROLLBAR HORIZONTAL PERFECT SCROLLBAR
   Empêche l'apparition du scrollbar mais permet l'expansion
   ============================================ */

/* Désactiver le rail horizontal de Perfect Scrollbar */
.sidebar .ps__rail-x,
.sidebar.ps--active-x > .ps__rail-x {
    display: none !important;
}

/* Désactiver le thumb horizontal */
.sidebar .ps__thumb-x {
    display: none !important;
}

/* Forcer tous les menus à s'adapter */
.sidebar-menu {
    width: fit-content !important;
    min-width: 100% !important;
}

/* Items de menu - largeur auto */
.sidebar-menu-item {
    width: fit-content !important;
    min-width: 100% !important;
}

/* Sous-menus également adaptatifs */
.sidebar-submenu {
    width: fit-content !important;
    min-width: 100% !important;
}

/* Badge orange - reste flexible */
.lesson-badge-orange {
    flex-shrink: 0 !important;
    margin-left: 8px !important;
}

/* Styles pour les statistiques de menu */
.menu-stats {
    flex-shrink: 0 !important;
    margin-left: auto !important;
    white-space: nowrap !important;
}

.menu-title-text {
    white-space: nowrap !important;
    flex: 1 1 auto !important;
}

/* ============================================
   COURSE ICON STYLES - Material Symbols
   ============================================ */

/* Base course icon styling */
.course-icon {
    /* Size matching thumbnails */
    width: 60px;
    height: 60px;

    /* Icon styling */
    font-size: 40px;
    color: #e77d01; /* Orange brand color */

    /* Centering */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Background */
    background: rgba(231, 125, 1, 0.1); /* Subtle orange background */
    border-radius: 10px;

    /* Optional: subtle border */
    border: 1px solid rgba(231, 125, 1, 0.2);

    /* Smooth transitions */
    transition: all 0.3s ease;
}

/* Hover effect for course items */
.list-group-item:hover .course-icon,
.card:hover .course-icon {
    background: rgba(231, 125, 1, 0.2);
    color: #e77d01;
    transform: scale(1.05);
}

/* Réduction de la taille des icônes dans "Cours suivis" pour égaliser la hauteur avec "Rapport" */
.list-group .course-icon {
    width: 40px;
    height: 40px;
    font-size: 24px;
    border-radius: 6px;
}

/* Aligner les items de cours pour que les boutons soient alignés verticalement */
.list-group-item {
    padding: 10px 16px !important;
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* Structure du contenu de gauche */
.list-group-item .d-flex {
    gap: 10px !important;
    align-items: center;
    flex: 1;
    min-width: 0;
}

/* Zone du bouton à droite - alignement fixe */
.list-group-item .dropdown {
    margin-left: auto;
    flex-shrink: 0;
    width: 100px; /* Largeur fixe pour aligner tous les boutons */
    display: flex;
    justify-content: flex-end;
}

/* Forcer les cartes du dashboard à avoir la même hauteur */
.row > .col-lg-7,
.row > .col-lg-5 {
    display: flex;
}

.row > .col-lg-7 > .card,
.row > .col-lg-5 > .card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Faire en sorte que le contenu de la carte s'étende pour remplir l'espace */
.card .list-group-fit {
    flex: 1;
}

/* ============================================
   BOUTON CONTINUER POUR COURS SUIVIS
   ============================================ */

/* Style du bouton "Continuer" pour chaque cours */
/* Course action container */
.course-action {
    flex-shrink: 0;
    margin-left: 12px;
}

/* Styles pour les boutons Continuer dans "Cours suivis" - SANS effet hover */
.list-group-item .course-action .btn-continuer {
    /* Couleur fixe - pas de changement au survol */
    background: linear-gradient(135deg, #e77d01 0%, #e77d01 100%) !important;
    color: #ffffff !important;

    /* Assurer le texte non sélectionnable */
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;

    /* Désactiver les transformations au survol */
    transform: none !important;
}

/* Désactiver TOUS les effets hover pour ces boutons */
.list-group-item .course-action .btn-continuer:hover,
.list-group-item .course-action .btn-continuer:focus,
.list-group-item .course-action .btn-continuer:active {
    background: linear-gradient(135deg, #e77d01 0%, #e77d01 100%) !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(255, 136, 0, 0.25) !important;
}

/* S'assurer que l'icône reste blanche et non sélectionnable */
.list-group-item .course-action .btn-continuer .material-icons {
    color: #ffffff !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    transform: none !important;
}

/* Icône reste fixe au survol aussi */
.list-group-item .course-action .btn-continuer:hover .material-icons {
    color: #ffffff !important;
    transform: none !important;
}

/* Dark theme adjustments */
body.dark-mode .course-icon,
[data-theme="dark"] .course-icon {
    background: rgba(231, 125, 1, 0.15);
    border-color: rgba(231, 125, 1, 0.3);
}

body.dark-mode .list-group-item:hover .course-icon,
body.dark-mode .card:hover .course-icon,
[data-theme="dark"] .list-group-item:hover .course-icon,
[data-theme="dark"] .card:hover .course-icon {
    background: rgba(231, 125, 1, 0.25);
    color: #e77d01;
}

/* ============================================
   RAPPORT BLOCK STYLING - Alignement des statistiques
   ============================================ */

/* Amélioration de l'espacement dans le bloc Rapport */
.col-lg-5 .list-group-item {
    padding: 14px 20px !important;
}

/* Alignement des éléments dans le bloc Rapport */
.col-lg-5 .list-group-item .media {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Texte à gauche avec plus d'espace */
.col-lg-5 .list-group-item .media-body {
    flex: 1;
    padding-right: 20px;
}

.col-lg-5 .list-group-item .media-body strong {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;
    display: block;
}

/* Chiffres alignés à l'extrême droite */
.col-lg-5 .list-group-item .media-right {
    margin-left: auto;
    min-width: 60px;
    text-align: right !important;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.col-lg-5 .list-group-item .media-right h4 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

/* ============================================
   PRELOADER - ORANGE THEME
   ============================================ */

/* Changer le fond bleu du preloader en orange propre */
.preloader,
[dir] .preloader,
div.preloader,
html .preloader,
body .preloader {
    background: linear-gradient(135deg, #e77d01 0%, #ff8c00 100%) !important;
    background-color: #e77d01 !important;
}

/* S'assurer que le spinner reste blanc pour un bon contraste */
:root {
    --sk-color: #ffffff !important;
    --sk-size: 64px;
}

/* Optionnel: Animation douce pour le preloader */
.preloader {
    transition: opacity 0.3s ease !important;
}

.mdk-drawer.js-mdk-drawer {
    width: 450px !important;
}

.sidebar-p-y {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge Legacy */
}

.mdk-header-layout__content {
    padding: 0 !important;
}
.sidebar-menu-button.lesson-item {
    padding-left: 8px !important;
}

[dir="ltr"] .sidebar-submenu .sidebar-menu-text {
    padding-left: 10px !important;
}
.btn-upgrade-premium {
    border-radius: 10px !important;
    margin-bottom: 5px !important;
}

/* Retirer le soulignement du lien formations gratuites */
.link-formations-gratuites {
    text-decoration: none !important;
    border-bottom: none !important;
}

.link-formations-gratuites:hover {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* ============================================
   AFFICHAGE DURÉE À DROITE DES LEÇONS
   ============================================ */

/* OVERRIDE des styles existants pour supporter la durée à droite */
.sidebar .sidebar-menu-button,
.sidebar-submenu .sidebar-menu-button {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    position: relative !important;
}

/* Forcer l'icône et le texte à rester à gauche */
.sidebar .sidebar-menu-icon {
    flex-shrink: 0 !important;
    margin-right: 15px !important;
    width: 24px !important;
}

.sidebar .sidebar-menu-text {
    flex: 1 1 auto !important;
    white-space: nowrap !important;
    overflow: visible !important;
    display: inline-block !important;
}

/* Durée positionnée à l'extrême droite - SPÉCIFICITÉ ÉLEVÉE */
.sidebar .duration,
.sidebar-submenu .duration,
.sidebar .sidebar-menu-button .duration {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 10px !important;
    color: #666 !important;
    opacity: 0.8 !important;
    white-space: nowrap !important;
    z-index: 1 !important;
    background: rgba(255, 255, 255, 0.9) !important;
    padding: 2px 4px !important;
    border-radius: 3px !important;
    pointer-events: none !important;
}

/* Style pour les sous-menus */
.sidebar-submenu .duration {
    font-size: 9px !important;
    right: 20px !important;
    color: #777 !important;
}

/* Ajuster le padding à droite des boutons pour faire place à la durée */
.sidebar .sidebar-menu-button {
    padding-right: 80px !important;
}

.sidebar-submenu .sidebar-menu-button {
    padding-right: 85px !important;
}

/* ============================================
   DURÉE POUR STRUCTURE .media (LISTE VIDÉOS)
   ============================================ */

/* Structure générale pour les éléments avec .media */
.list-group-item .media {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    position: relative !important;
}

/* Zone gauche avec l'index */
.list-group-item .media-left {
    flex-shrink: 0 !important;
    margin-right: 15px !important;
}

/* Zone centrale avec le titre */
.list-group-item .media-body {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin-right: 15px !important;
}

/* Zone droite avec la durée - FORCER À L'EXTRÊME DROITE */
.list-group-item .media-right {
    position: absolute !important;
    right: 15px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    flex-shrink: 0 !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* Style de la durée dans media-right - SIMPLE */
.list-group-item .media-right .duration {
    font-size: 13px !important;
    color: #ccc !important;
    opacity: 0.8 !important;
    white-space: nowrap !important;
}

/* Ajuster le padding des list-group-item pour faire place à la durée */
.list-group-item.videos {
    padding-right: 80px !important;
    position: relative !important;
}

/* ============================================
   NAVBAR - CORRECTION Z-INDEX POUR ÉVITER LES CONFLITS
   ============================================ */

/* S'assurer que la navbar reste toujours cliquable */
.navbar,
.navbar-nav,
.nav-item,
.nav-link,
.dropdown-menu,
.navbar-collapse {
    z-index: 1030 !important;
    position: relative !important;
}

/* Forcer les éléments interactifs de la navbar */
.navbar .btn,
.navbar .nav-link,
.navbar .dropdown-toggle,
.navbar .navbar-brand,
.navbar-toggler {
    z-index: 1031 !important;
    pointer-events: auto !important;
}

/* Responsive design pour les petits écrans */
@media (max-width: 768px) {
    .sidebar {
        min-width: 260px !important;
    }

    .sidebar-menu-button {
        padding: 10px 15px !important;
    }

    .sidebar-menu-icon {
        margin-right: 10px !important;
    }

    .mdk-drawer__content .sidebar-p-y *,
    .sidebar-menu-text {
        font-size: 12px !important;
    }

    .course-icon {
        width: 50px;
        height: 50px;
        font-size: 32px;
    }

    .mdk-drawer.js-mdk-drawer {
        width: 380px !important;
    }
    .sidebar-heading .menu-title-text,
    .menu-title-text {
        font-size: 14px !important;
    }

    .list-group-item.videos {
        padding-right: 1.5rem !important;
    }

    .list-group-item .media-right {
        top: 80% !important;
    }

    #notificationMenu
    {
        right: -85px !important;
    }
}
