/* css/sidebar.css */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --primary-color: #00529c;
    --sidebar-bg: #ffffff;
    --sidebar-text: #333333;
    --sidebar-hover: #f8f9fa;
    --sidebar-active: #e3f2fd;
}

/* Layout Base */
body {
    padding-top: var(--header-height);
    background-color: #f8f9fa;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
.header {
    height: var(--header-height);
    z-index: 1030;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.header .navbar {
    padding: 0.5rem 1rem;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    background-color: var(--sidebar-bg);
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1020;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0,0,0,.05);
}

.sidebar-header {
    background: linear-gradient(135deg, var(--primary-color), #0066cc);
}

.sidebar-menu .nav-link {
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.sidebar-menu .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary-color);
    transform: translateX(5px);
}

.sidebar-menu .nav-link.active {
    background-color: var(--sidebar-active);
    color: var(--primary-color);
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
}

.sidebar-menu .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    margin-right: 10px;
}

.sidebar-menu small {
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.sidebar-footer {
    font-size: 0.8rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Breadcrumbs */
.breadcrumb-container {
    background-color: white;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
}

.breadcrumb {
    background-color: transparent;
    margin-bottom: 0;
    padding-left: 0;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

/* Estado Colapsado */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar .menu-text,
body.sidebar-collapsed .sidebar small,
body.sidebar-collapsed .sidebar .sidebar-footer,
body.sidebar-collapsed .sidebar .sidebar-header h6 span {
    display: none;
}

body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 0.75rem;
}

body.sidebar-collapsed .sidebar .nav-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

body.sidebar-collapsed .sidebar .sidebar-header h6 {
    text-align: center;
}

body.sidebar-collapsed .sidebar .sidebar-header h6 i {
    margin-right: 0;
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Overlay para Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1019;
}

.sidebar-overlay.show {
    display: block;
}

/* Responsividade */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0,0,0,.2);
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    body.sidebar-collapsed .sidebar {
        width: 280px;
        transform: translateX(-100%);
    }
    
    body.sidebar-collapsed .sidebar.show {
        transform: translateX(0);
    }
}

/* Ajuste para garantir que o header existe */
#mainHeader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--primary-color);
}

/* Ajuste de altura para conteúdo principal */
#mainContent {
    transition: margin-left 0.3s ease;
}

/* Scrollbar Personalizada */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animações */
@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sidebar-menu .nav-item {
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

.sidebar-menu .nav-item:nth-child(1) { animation-delay: 0.1s; }
.sidebar-menu .nav-item:nth-child(2) { animation-delay: 0.15s; }
.sidebar-menu .nav-item:nth-child(3) { animation-delay: 0.2s; }
.sidebar-menu .nav-item:nth-child(4) { animation-delay: 0.25s; }
.sidebar-menu .nav-item:nth-child(5) { animation-delay: 0.3s; }
.sidebar-menu .nav-item:nth-child(6) { animation-delay: 0.35s; }
.sidebar-menu .nav-item:nth-child(7) { animation-delay: 0.4s; }
.sidebar-menu .nav-item:nth-child(8) { animation-delay: 0.45s; }