/* Navbar CSS - Integrado com o Sistema de Tema */

/* Estilos da Navbar - Altura Total e Distribuição Automática */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh; /* Altura total da viewport */
    background-color: var(--surface-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s ease, background-color var(--transition-speed);
    border-right: 1px solid var(--border-color);
    overflow: hidden; /* Previne scroll na sidebar */
    box-shadow: var(--shadow-md);
}

/* Header da Sidebar */
.sidebar-header {
    padding: 1.5rem 1rem 1rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Não diminui */
}

.sidebar .logo {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--text-color-dark);
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem;
    white-space: nowrap;
    font-family: var(--font-family);
}

.sidebar .logo i {
    color: var(--primary-color);
}

/* Botão Modo Escuro */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color-body);
    cursor: pointer;
    transition: all var(--transition-speed);
    margin-left: auto;
    margin-top: 0.5rem;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-sm);
}

.theme-toggle i {
    font-size: 1.1rem;
    transition: transform var(--transition-speed);
}

.theme-toggle:hover i {
    transform: rotate(15deg);
}

/* Container principal da navegação */
.sidebar .nav-list-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px); /* Altura total menos o header */
    overflow: hidden;
    flex: 1; /* Ocupa todo espaço disponível */
}

/* Container dos itens principais */
.nav-main-items {
    flex: 1; /* Ocupa espaço disponível */
    display: flex;
    flex-direction: column;
    padding: 1rem 0.5rem;
    overflow-y: auto; /* Scroll se necessário */
}

/* Container dos itens secundários (logout) */
.nav-secondary-items {
    flex-shrink: 0; /* Não diminui */
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-color);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.sidebar li {
    margin-bottom: 0.25rem; /* Espaçamento reduzido */
}

.sidebar li:last-child {
    margin-bottom: 0;
}

.sidebar a {
    color: var(--text-color-body);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    position: relative;
    font-family: var(--font-family);
}

.sidebar a:hover {
    background-color: var(--bg-color);
    color: var(--text-color-dark);
    transform: translateX(2px);
}

.sidebar a.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.sidebar a .fas {
    width: 18px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar a.logout-link {
    background-color: #fef2f2;
    color: var(--danger-color);
    border: 1px solid #fecaca;
}

.sidebar a.logout-link:hover {
    background-color: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.sidebar a.msg-link {
    position: relative;
}

.notification-dot {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1rem;
    width: 8px;
    height: 8px;
    background-color: var(--danger-color);
    border-radius: 50%;
    border: 2px solid var(--surface-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.sidebar a.active .notification-dot {
    border-color: var(--primary-color);
}

/* Busca Unificada */
.busca-unificada-container {
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    position: relative;
}

.busca-unificada-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.8rem;
    gap: 0.5rem;
}

.busca-unificada-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    flex: 1;
    padding: 0.4rem 0;
    color: var(--text-color-body);
    font-family: var(--font-family);
}

.busca-unificada-icone {
    color: var(--text-color-light);
    font-size: 1.1rem;
}

.busca-unificada-resultados {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    z-index: 2000;
    max-height: 320px;
    overflow-y: auto;
    margin-top: 0.2rem;
    padding: 0.3rem 0;
    overflow-x: hidden;
}

.busca-unificada-item {
    padding: 0.7rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: background 0.15s;
    color: var(--text-color-body);
    font-size: 0.98rem;
    max-width: 100%;
    font-family: var(--font-family);
}

.busca-unificada-item:hover {
    background: var(--bg-color);
}

.busca-unificada-item .tipo {
    font-size: 0.85em;
    color: var(--primary-color);
    font-weight: 600;
    margin-right: 0.5em;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

.busca-unificada-item .titulo {
    font-weight: 600;
    color: var(--text-color-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 170px;
}

/* Scrollbar personalizada para navegação */
.nav-main-items::-webkit-scrollbar {
    width: 4px;
}

.nav-main-items::-webkit-scrollbar-track {
    background: transparent;
}

.nav-main-items::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

.nav-main-items::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-color-light);
}

/* Estilo da navbar colapsada */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar .logo span, 
    .sidebar a span {
        display: none;
    }
    
    .sidebar .logo {
        justify-content: center;
        padding: 0;
    }
    
    .sidebar a {
        justify-content: center;
        padding: 0.75rem 0.5rem;
    }
    
    .notification-dot {
        top: 0.5rem;
        right: 0.5rem;
    }

    .sidebar .nav-list-container {
        height: calc(100vh - 70px);
    }

    .theme-toggle {
        width: 35px;
        height: 35px;
        margin: 0.5rem auto 0 auto;
    }
    
    .busca-unificada-container { 
        padding: 0; 
    }
    .busca-unificada-resultados { 
        left: 0; 
        right: 0; 
    }
}

/* Responsividade para telas muito pequenas */
@media (max-width: 480px) {
    .sidebar {
        width: 70px;
    }
    
    .sidebar .logo {
        font-size: 1.5rem;
    }
    
    .sidebar a {
        padding: 0.625rem 0.375rem;
    }
    
    .sidebar a .fas {
        font-size: 0.9rem;
    }
} 