/* ==========================================================================
   ESTILOS DA SIDEBAR (CABEÇALHO LATERAL) - PDF CONCURSOS
   ========================================================================== */
:root {
    --brand-orange: #fa6e1d; 
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 80px;
    --sidebar-bg: #001242; /* Fundo azul escuro premium para contrastar com o laranja */
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(250, 110, 29, 0.15); /* Fundo laranja transparente ao passar o mouse/ativo */
    --sidebar-active-border: #fa6e1d;
}

/* =========================================
   1. ESTRUTURA GERAL DA SIDEBAR (DESKTOP)
========================================= */
.sidebar-custom {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Esconde a barra de rolagem da sidebar (fica mais clean) */
.sidebar-custom::-webkit-scrollbar {
    display: none;
}
.sidebar-custom {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Área da Logo */
.sidebar-brand-area {
    padding: 25px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 80px;
}

.sidebar-brand-area img {
    height: 40px;
    width: auto;
    transition: all 0.3s ease;
}

/* Navegação da Sidebar */
.sidebar-nav {
    flex-grow: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-link {
    color: var(--sidebar-text);
    text-decoration: none;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-link i {
    font-size: 1.2rem;
    min-width: 24px; /* Garante alinhamento dos ícones */
    text-align: center;
    transition: color 0.2s ease;
}

.sidebar-link span {
    white-space: nowrap;
}

.sidebar-link:hover {
    color: var(--sidebar-text-hover);
    background-color: rgba(255, 255, 255, 0.03);
}

.sidebar-link:hover i {
    color: var(--brand-orange);
}

.sidebar-link.active {
    color: var(--sidebar-text-hover);
    background-color: var(--sidebar-active-bg);
    border-left-color: var(--sidebar-active-border);
    font-weight: 600;
}

.sidebar-link.active i {
    color: var(--brand-orange);
}

/* =========================================
   2. PERFIL DO USUÁRIO NO RODAPÉ DA SIDEBAR
========================================= */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s;
    text-decoration: none !important;
}

.sidebar-user-box:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--brand-orange);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
}

.sidebar-user-name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.sidebar-user-status {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    margin: 0;
}

/* Botões da Sidebar para deslogados */
.sidebar-btn-login {
    display: block;
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: 0.2s;
    margin-bottom: 10px;
}

.sidebar-btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-btn-solid {
    background-color: var(--brand-orange);
    color: white;
    border: none;
}

.sidebar-btn-solid:hover {
    background-color: #d85b13;
    color: white;
}


/* =========================================
   3. AJUSTE DO CONTEÚDO PRINCIPAL (DESKTOP)
   Quando a sidebar está fixa, o body precisa de margem
========================================= */
@media (min-width: 992px) {
    body {
        padding-left: var(--sidebar-width);
    }
    
    /* Navbar superior oculta no Desktop (pois agora é Sidebar) */
    .mobile-topbar {
        display: none !important;
    }
}


/* =========================================
   4. COMPORTAMENTO MOBILE (OFFCANVAS)
========================================= */
@media (max-width: 991.98px) {
    /* Barra Superior Fixa no Celular */
    .mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background-color: var(--sidebar-bg);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        z-index: 1040;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .mobile-topbar img {
        height: 30px;
    }

    .btn-menu-mobile {
        background: transparent;
        border: none;
        color: white;
        font-size: 1.5rem;
        padding: 0;
        cursor: pointer;
    }

    /* O Body precisa de padding superior no celular para o conteúdo não entrar embaixo da topbar */
    body {
        padding-top: 60px;
    }

    /* A Sidebar vira um Menu Offcanvas (escondido na esquerda) */
    .sidebar-custom {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar-custom.show-mobile {
        transform: translateX(0);
    }

    /* Overlay escuro que fica atrás da sidebar no celular */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1045;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

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