/**
 * TXL Gen4 Design System - Navigation
 * 
 * Composants de navigation (navbar, sidebar, breadcrumbs, tabs, pagination)
 */

/* ============================================
   NAVBAR
   ============================================ */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-4) var(--spacing-6);
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.navbar-sticky {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.navbar-brand:hover {
    color: var(--color-primary-600);
}

.navbar-brand-logo {
    height: 2rem;
    width: auto;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-item {
    position: relative;
}

.navbar-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
    padding: var(--spacing-2) var(--spacing-4);
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: var(--radius-base);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
}

.navbar-link:hover {
    background-color: var(--color-neutral-100);
    color: var(--color-primary-600);
}

.navbar-link.active {
    background-color: var(--color-primary-100);
    color: var(--color-primary-600);
}

/* Navbar Toggle (Mobile Menu) */
.navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: var(--spacing-2);
    background: none;
    border: none;
    cursor: pointer;
}

.navbar-toggle-bar {
    width: 1.5rem;
    height: 2px;
    background-color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.is-active .navbar-toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 767px) {
    .navbar-toggle {
        display: flex;
    }
    
    .navbar-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        display: none;
        padding: var(--spacing-4);
    }
    
    .navbar-nav.is-active {
        display: flex;
    }
    
    .navbar-link {
        width: 100%;
    }
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 16rem;
    height: 100vh;
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
    z-index: var(--z-fixed);
}

.sidebar-collapsed {
    width: 4rem;
}

.sidebar-collapsed .sidebar-item-text {
    display: none;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-6);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-brand {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
}

.sidebar-toggle {
    padding: var(--spacing-2);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
}

.sidebar-toggle:hover {
    color: var(--color-text-primary);
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-4);
    list-style: none;
    margin: 0;
}

.sidebar-item {
    margin-bottom: var(--spacing-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-3) var(--spacing-4);
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.sidebar-link:hover {
    background-color: var(--color-neutral-100);
}

.sidebar-link.active {
    background-color: var(--color-primary-100);
    color: var(--color-primary-600);
}

.sidebar-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.sidebar-item-text {
    flex: 1;
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
    padding-left: var(--spacing-8);
}

.sidebar-item.is-expanded .sidebar-submenu {
    max-height: 500px;
}

.sidebar-submenu-link {
    display: block;
    padding: var(--spacing-2) var(--spacing-4);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-base);
    transition: all var(--transition-fast);
}

.sidebar-submenu-link:hover {
    color: var(--color-text-primary);
    background-color: var(--color-neutral-50);
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-2);
    padding: var(--spacing-4) 0;
    list-style: none;
    margin: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

.breadcrumb-item::after {
    content: '/';
    color: var(--color-text-secondary);
    margin-left: var(--spacing-2);
}

.breadcrumb-item:last-child::after {
    content: none;
}

.breadcrumb-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--color-primary-600);
}

.breadcrumb-item.active {
    color: var(--color-text-primary);
    font-weight: var(--font-weight-medium);
}

/* ============================================
   TABS
   ============================================ */

.tabs {
    display: flex;
    border-bottom: 2px solid var(--color-border);
    gap: var(--spacing-2);
    margin-bottom: var(--spacing-6);
}

.tab-item {
    padding: var(--spacing-3) var(--spacing-4);
    color: var(--color-text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    cursor: pointer;
    font-weight: var(--font-weight-medium);
}

.tab-item:hover {
    color: var(--color-text-primary);
}

.tab-item.active {
    color: var(--color-primary-600);
    border-bottom-color: var(--color-primary-600);
}

.tab-content {
    display: none;
    animation: tab-fade-in var(--transition-base);
}

.tab-content.active {
    display: block;
}

@keyframes tab-fade-in {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tabs Vertical */
.tabs-vertical {
    flex-direction: column;
    border-bottom: none;
    border-right: 2px solid var(--color-border);
}

.tabs-vertical .tab-item {
    border-bottom: none;
    border-right: 2px solid transparent;
    margin-bottom: 0;
    margin-right: -2px;
}

.tabs-vertical .tab-item.active {
    border-bottom-color: transparent;
    border-right-color: var(--color-primary-600);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    list-style: none;
    margin: var(--spacing-8) 0;
    padding: 0;
}

.page-item {
    display: inline-flex;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: var(--spacing-2) var(--spacing-3);
    color: var(--color-text-primary);
    text-decoration: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-base);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.page-link:hover {
    background-color: var(--color-neutral-100);
    border-color: var(--color-primary-500);
}

.page-item.active .page-link {
    background-color: var(--color-primary-500);
    color: var(--color-neutral-0);
    border-color: var(--color-primary-500);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.page-link-prev,
.page-link-next {
    font-weight: var(--font-weight-medium);
}

/* Pagination Sizes */
.pagination-sm .page-link {
    min-width: 2rem;
    height: 2rem;
    padding: var(--spacing-1) var(--spacing-2);
    font-size: var(--font-size-sm);
}

.pagination-lg .page-link {
    min-width: 3rem;
    height: 3rem;
    padding: var(--spacing-3) var(--spacing-4);
    font-size: var(--font-size-lg);
}

/* Pagination Rounded */
.pagination-rounded .page-link {
    border-radius: var(--radius-full);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.is-active {
        transform: translateX(0);
    }
    
    .tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .pagination {
        gap: var(--spacing-1);
    }
    
    .page-link {
        min-width: 2rem;
        height: 2rem;
        padding: var(--spacing-1) var(--spacing-2);
        font-size: var(--font-size-sm);
    }
}
