/**
 * Sidebar Fix - Baseado no sistema PROJETOS (100% funcional)
 */

/* ===== Sidebar ===== */
.sidebar {
    width: 200px;
    background: linear-gradient(180deg, var(--dark-sidebar) 0%, #2c3e50 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 1001;
    /* Inicia COLAPSADA por padrão */
    transform: translateX(-100%);
}

/* Scrollbar customizada */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

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

/* Mostra sidebar quando está ativa */
.sidebar.active {
    transform: translateX(0);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

/* ===== Main Content ===== */
#content {
    flex: 1;
    margin-left: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    width: 100%;
}

/* Quando sidebar está ativa */
#content.active {
    margin-left: 200px;
}

/* ===== Overlay ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== Botão Flutuante ===== */
.mobile-menu-toggle {
    display: flex;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #229954 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(39, 174, 96, 0.4);
    z-index: 1002;
    cursor: pointer;
    transition: all 0.3s;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(39, 174, 96, 0.6);
}

.mobile-menu-toggle i {
    font-size: 24px;
    color: white;
    transition: transform 0.3s;
}

.mobile-menu-toggle.active i {
    transform: rotate(180deg);
}

/* ===== Mobile Responsivo ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    #content {
        margin-left: 0;
        width: 100%;
    }

    #content.active {
        margin-left: 280px;
    }
}
