/**
 * Menu Hybride - Styles CSS
 *
 * Navigation horizontale + Sidebar contextuelle
 * Design moderne avec support dark theme
 *
 * Date: 16 décembre 2025
 */

/* =============================================================================
   1. CSS VARIABLES
   ============================================================================= */

:root {
    /* Navigation horizontale */
    --nav-height: 56px;
    --nav-bg: linear-gradient(135deg, #000050 0%, #000080 100%);
    --nav-hover: rgba(255, 255, 255, 0.1);
    --nav-active: rgba(51, 51, 153, 0.8);
    --nav-text: #ffffff;
    --nav-border: rgba(255, 255, 255, 0.1);

    /* Sidebar contextuelle */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 60px;
    --sidebar-bg: linear-gradient(180deg, #000040 0%, #000030 100%);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-item-hover: rgba(255, 255, 255, 0.08);
    --sidebar-item-active: rgba(51, 51, 153, 0.5);

    /* Recherche */
    --search-modal-bg: rgba(0, 0, 40, 0.95);
    --search-highlight: #ffc107;
    --search-result-hover: rgba(255, 255, 255, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* =============================================================================
   2. NAVIGATION HORIZONTALE
   ============================================================================= */

.menu-hybrid-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 1rem;
    max-width: 100%;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: var(--nav-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.nav-logo img {
    height: 32px;
    width: auto;
}

.nav-logo:hover {
    color: var(--nav-text);
    text-decoration: none;
}

/* Categories */
.nav-categories {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-categories::-webkit-scrollbar {
    display: none;
}

.nav-category {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: var(--nav-text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: background var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
    opacity: 0.85;
}

.nav-category:hover {
    background: var(--nav-hover);
    opacity: 1;
}

.nav-category.active {
    background: var(--nav-active);
    opacity: 1;
}

.nav-category i {
    font-size: 1rem;
}

/* Quick Actions */
.nav-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    padding-left: 1rem;
    border-left: 1px solid var(--nav-border);
}

.nav-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: var(--nav-text);
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--transition-fast);
    position: relative;
}

.nav-action:hover {
    background: var(--nav-hover);
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: #dc3545;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* User Menu */
.nav-user {
    position: relative;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--nav-border);
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--nav-text);
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.nav-user-btn:hover {
    background: var(--nav-hover);
}

.nav-user-btn i:first-child {
    font-size: 1.5rem;
}

.nav-user-btn span {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-user-btn i:last-child {
    font-size: 0.7rem;
    opacity: 0.7;
    transition: transform var(--transition-fast);
}

.nav-user.open .nav-user-btn i:last-child {
    transform: rotate(180deg);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: #1a1a3a;
    border: 1px solid var(--nav-border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 1040;
}

.nav-user.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #e0e0e0;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.user-dropdown a:hover {
    background: var(--nav-hover);
    color: #fff;
}

.user-dropdown a i {
    width: 20px;
    text-align: center;
    opacity: 0.7;
}

.user-dropdown hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--nav-border);
}

/* Hamburger (Mobile) */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--nav-text);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    margin-left: 0.5rem;
}

.nav-hamburger:hover {
    background: var(--nav-hover);
}

/* =============================================================================
   3. SIDEBAR CONTEXTUELLE
   ============================================================================= */

.menu-hybrid-sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    transition: width var(--transition-normal), transform var(--transition-normal);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.menu-hybrid-sidebar::-webkit-scrollbar {
    width: 6px;
}

.menu-hybrid-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.menu-hybrid-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.menu-hybrid-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sidebar collapsed */
.menu-hybrid-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.menu-hybrid-sidebar.collapsed .sidebar-section h4 span,
.menu-hybrid-sidebar.collapsed .sidebar-item span,
.menu-hybrid-sidebar.collapsed .btn-add-favorite {
    display: none;
}

.menu-hybrid-sidebar.collapsed .sidebar-item-header {
    justify-content: center;
}

.menu-hybrid-sidebar.collapsed .sidebar-expand {
    display: none;
}

/* Sidebar Toggle */
.sidebar-toggle {
    position: absolute;
    bottom: 1rem;
    right: -14px;
    width: 28px;
    height: 28px;
    background: #1a1a3a;
    border: 1px solid var(--sidebar-border);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    z-index: 1025;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: #333366;
}

.menu-hybrid-sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

/* Sidebar Sections */
.sidebar-section {
    padding: 1rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem 0;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-section h4 i {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Sidebar Menu */
.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu.level-1,
.sidebar-menu.level-2,
.sidebar-menu.level-3 {
    padding-left: 1rem;
    display: none;
}

.sidebar-item.expanded > .sidebar-menu {
    display: block;
}

.sidebar-item {
    margin-bottom: 2px;
}

.sidebar-item.active > .sidebar-link,
.sidebar-item.active > .sidebar-item-header > .sidebar-link {
    background: var(--sidebar-item-active);
    color: #fff;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 6px;
    transition: background var(--transition-fast), color var(--transition-fast);
    font-size: 0.9rem;
    position: relative;
}

.sidebar-link:hover {
    background: var(--sidebar-item-hover);
    color: #fff;
    text-decoration: none;
}

.sidebar-link.no-link {
    cursor: default;
}

.sidebar-link i:first-child {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.sidebar-link span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Add to Favorites Button */
.btn-add-favorite {
    opacity: 0;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: opacity var(--transition-fast), color var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-link:hover .btn-add-favorite {
    opacity: 1;
}

.btn-add-favorite:hover {
    color: #ffc107;
}

.btn-add-favorite.is-favorite i {
    font-weight: 900;
    color: #ffc107;
}

/* Sidebar Item Header (for expandable items) */
.sidebar-item-header {
    display: flex;
    align-items: center;
}

.sidebar-item-header .sidebar-link {
    flex: 1;
}

.sidebar-expand {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.sidebar-expand:hover {
    color: #fff;
}

.sidebar-item.expanded > .sidebar-item-header .sidebar-expand {
    transform: rotate(90deg);
}

/* =============================================================================
   4. SEARCH MODAL
   ============================================================================= */

.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}

.search-modal.open {
    display: flex;
}

.search-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--search-modal-bg);
    backdrop-filter: blur(4px);
}

.search-modal-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: #1a1a3a;
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: search-modal-in 200ms ease;
}

@keyframes search-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--nav-border);
}

.search-input-wrapper i {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

.search-input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input-wrapper kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-family: inherit;
}

/* Search Results */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--search-result-hover);
    color: #fff;
}

.search-result-item i {
    width: 24px;
    text-align: center;
    opacity: 0.7;
}

.search-result-item .result-label {
    flex: 1;
}

.search-result-item .result-label mark {
    background: var(--search-highlight);
    color: #000;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-item .result-category {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.search-no-results {
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.search-no-results i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Search Footer */
.search-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--nav-border);
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.search-footer kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    margin-right: 0.25rem;
}

/* =============================================================================
   5. MAIN CONTENT LAYOUT
   ============================================================================= */

body.menu-hybrid-enabled {
    padding-top: var(--nav-height);
    padding-left: var(--sidebar-width);
    transition: padding-left var(--transition-normal);
}

body.menu-hybrid-enabled.sidebar-collapsed {
    padding-left: var(--sidebar-collapsed-width);
}

/* =============================================================================
   6. RESPONSIVE
   ============================================================================= */

@media (max-width: 1199.98px) {
    .nav-category span {
        display: none;
    }

    .nav-category {
        padding: 0.5rem 0.75rem;
    }
}

@media (max-width: 991.98px) {
    :root {
        --sidebar-width: 260px;
    }

    .nav-user-btn span {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .nav-categories {
        display: none;
    }

    .nav-quick-actions {
        border-left: none;
        padding-left: 0;
    }

    .nav-hamburger {
        display: flex;
    }

    .menu-hybrid-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .menu-hybrid-sidebar.mobile-open {
        transform: translateX(0);
    }

    body.menu-hybrid-enabled {
        padding-left: 0;
    }

    .sidebar-toggle {
        display: none;
    }

    /* Mobile overlay */
    .sidebar-overlay {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1015;
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition-normal);
    }

    .sidebar-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    .search-modal-content {
        margin: 0 1rem;
        max-height: calc(100vh - 20vh - 2rem);
    }

    /* Mobile category selector visible */
    .sidebar-mobile-categories {
        display: flex;
    }
}

/* =============================================================================
   MOBILE CATEGORY SELECTOR
   ============================================================================= */

.sidebar-mobile-categories {
    display: none;
    padding: 0.75rem;
    border-bottom: 1px solid var(--sidebar-border);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-mobile-categories::-webkit-scrollbar {
    height: 4px;
}

.sidebar-mobile-categories::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-mobile-categories::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 2px;
}

.sidebar-mobile-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--sidebar-hover-bg);
    border: 1px solid var(--sidebar-border);
    border-radius: 20px;
    color: var(--sidebar-text);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-mobile-cat-btn:hover,
.sidebar-mobile-cat-btn.active {
    background: var(--nav-category-active-bg);
    color: var(--nav-category-active-text);
    border-color: var(--nav-category-active-bg);
}

.sidebar-mobile-cat-btn i {
    font-size: 0.85rem;
}

.sidebar-mobile-cat-btn span {
    font-weight: 500;
}

@media (max-width: 575.98px) {
    .nav-logo span {
        display: none;
    }

    .nav-action {
        width: 36px;
        height: 36px;
    }

    .search-modal {
        padding-top: 10vh;
    }
}

/* =============================================================================
   7. NOTIFICATIONS DROPDOWN (Bootstrap 5 compatible)
   ============================================================================= */

/* Container wrapper - NE PAS cacher avec opacity/visibility car Bootstrap gère le menu */
.notifications-dropdown.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

/* Wrapper pour le dropdown notifications dans menu-hybrid */
.nav-action-wrapper.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-action-wrapper .dropdown-menu.notifications-menu {
    background: #1a1a3a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    padding: 0;
    z-index: 1050 !important;
    right: 0;
    left: auto;
}

.nav-action-wrapper .dropdown-menu.notifications-menu.show {
    display: block !important;
}

/* Bouton cloche dans le header */
.notifications-dropdown .btn-link {
    color: var(--header-text, #fff) !important;
    text-decoration: none;
}

.notifications-dropdown .btn-link:hover {
    color: var(--nav-link-hover, #8ab4f8) !important;
}

/* Style du dropdown-menu Bootstrap */
.notifications-dropdown .dropdown-menu {
    background: #1a1a3a;
    border: 1px solid var(--nav-border, rgba(255,255,255,0.1));
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    padding: 0;
    z-index: 1050 !important;
}

/* S'assurer que le dropdown-menu s'affiche correctement quand Bootstrap ajoute .show */
.notifications-dropdown .dropdown-menu.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Header du dropdown Bootstrap */
.notifications-dropdown .dropdown-header {
    background: rgba(255,255,255,0.05);
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.notifications-dropdown .dropdown-header a {
    color: var(--nav-link-hover, #8ab4f8);
}

/* Liste des notifications */
.notifications-dropdown #notificationsList {
    background: transparent;
}

/* Items de notification (lu/non-lu) */
.notifications-dropdown .notification-unread {
    background: rgba(13, 110, 253, 0.08);
}

.notifications-dropdown .notification-read {
    opacity: 0.7;
}

.notifications-dropdown .notification-item:hover {
    background: rgba(255,255,255,0.08) !important;
}

/* Texte dans le dropdown sombre */
.notifications-dropdown .text-body {
    color: #fff !important;
}

.notifications-dropdown .text-muted {
    color: rgba(255,255,255,0.6) !important;
}

/* Catégories de notification */
.notifications-dropdown .notification-category {
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.notifications-dropdown .notification-category:first-child {
    border-top: none;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--nav-border);
}

.notifications-header h5 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--nav-border);
    transition: background var(--transition-fast);
}

.notification-item:hover {
    background: var(--nav-hover);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.approval {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.notification-icon.meeting {
    background: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
}

.notification-icon.alert {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.notifications-empty {
    padding: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

/* =============================================================================
   8. HIDE OLD MENU WHEN HYBRID IS ENABLED
   ============================================================================= */

/* Cacher l'ancien header quand le menu hybride est actif */
body.menu-hybrid-enabled .site-header {
    display: none !important;
}

/* Cacher l'ancien menu de navigation */
body.menu-hybrid-enabled nav.site-menu {
    display: none !important;
}

/* Ajuster le layout principal */
body.menu-hybrid-enabled .layout {
    flex-direction: column;
    min-height: calc(100vh - var(--nav-height));
}

/* Conteneur principal */
body.menu-hybrid-enabled .main-content,
body.menu-hybrid-enabled .layout > *:not(nav):not(.site-menu):not(.menu-hybrid-sidebar) {
    flex: 1;
    min-height: auto;
}

/* Assurer que les containers bootstrap ne sont pas trop larges */
body.menu-hybrid-enabled .container-fluid {
    max-width: 100%;
}

/* =============================================================================
   9. ANIMATIONS
   ============================================================================= */

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

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

.sidebar-section {
    animation: slideInLeft 300ms ease forwards;
}

.sidebar-section:nth-child(1) { animation-delay: 0ms; }
.sidebar-section:nth-child(2) { animation-delay: 50ms; }
.sidebar-section:nth-child(3) { animation-delay: 100ms; }
.sidebar-section:nth-child(4) { animation-delay: 150ms; }

/* =============================================================================
   10. IMPERSONATION BAR (Simulation utilisateur)
   ============================================================================= */

.impersonation-bar {
    background: linear-gradient(90deg, #ff6b00, #ff8c00);
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 14px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    box-shadow: 0 2px 8px rgba(255, 107, 0, 0.4);
    animation: impersonationPulse 2s ease-in-out infinite;
}

@keyframes impersonationPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(255, 107, 0, 0.4); }
    50% { box-shadow: 0 2px 16px rgba(255, 107, 0, 0.7); }
}

.impersonation-bar i.fa-user-secret {
    font-size: 18px;
}

.impersonation-bar span {
    flex: 1;
    text-align: center;
}

.impersonation-bar strong {
    font-weight: 700;
}

.btn-stop-impersonation {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-stop-impersonation:hover {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border-color: white;
    transform: scale(1.05);
}

.btn-stop-impersonation i {
    font-size: 12px;
}

/* Ajuster le layout quand la barre d'impersonation est présente */
body.is-impersonating .menu-hybrid-nav {
    top: 44px !important;
}

body.is-impersonating .menu-hybrid-sidebar {
    top: calc(var(--nav-height) + 44px) !important;
    height: calc(100vh - var(--nav-height) - 44px) !important;
}

body.is-impersonating .main-content {
    padding-top: 44px;
}

/* Lien simuler dans le dropdown user */
.user-dropdown .impersonate-link {
    color: #ff8c00 !important;
}

.user-dropdown .impersonate-link:hover {
    background: rgba(255, 140, 0, 0.1) !important;
}

/* Mobile */
@media (max-width: 768px) {
    .impersonation-bar {
        padding: 8px 12px;
        font-size: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .impersonation-bar span {
        width: 100%;
        order: 2;
    }

    .btn-stop-impersonation {
        order: 3;
        width: 100%;
        justify-content: center;
    }
}
