@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #ceaefd;
    min-height: 100vh;
    overflow-x: hidden;
    /* Evita scroll horizontal */
}

main {
    width: 100%;
    padding: 20px;
    padding-left: calc(82px + 20px);
    padding-bottom: 80px;
    /* Espaço para o footer fixo */
    text-align: center;
    min-height: 100vh;
}

#sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #ffffff;
    height: 100vh;
    border-radius: 0px 18px 18px 0px;
    transition: all .5s;
    min-width: 82px;
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
}

#sidebar_content {
    padding: 12px;
    overflow-y: auto;
    /* Permite scroll se o menu for muito grande */
    flex: 1;
}

#user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

#user_avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 20px;
}

#user_infos {
    display: flex;
    flex-direction: column;
}

#user_infos span:last-child {
    color: #6b6b6b;
    font-size: 12px;
}

#side_items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
}

.side-item {
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.side-item.active {
    background-color: #3D2364;
}

.side-item:hover:not(.active),
#logout_btn:hover {
    background-color: #e3e9f7;
}

.side-item a {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0a;
}

.side-item.active a {
    color: #e3e9f7;
}

.side-item a i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

#open_btn {
    position: absolute;
    top: 30px;
    right: -10px;
    background-color: #3D2364;
    color: #e3e9f7;
    border-radius: 100%;
    width: 20px;
    height: 20px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px;
}

#open_btn:hover {
    transform: scale(1.1);
}

#open_btn_icon {
    transition: transform .3s ease;
}

.open-sidebar #open_btn_icon {
    transform: rotate(180deg);
}

.item-description {
    width: 0px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
    transition: width .6s;
    height: 0px;
}

#sidebar.open-sidebar {
    min-width: 15%;
}

#sidebar.open-sidebar .item-description {
    width: 150px;
    height: auto;
}

#sidebar.open-sidebar .side-item a {
    justify-content: flex-start;
    gap: 14px;
}

/* Ajuste do main quando sidebar está aberta */
#sidebar.open-sidebar~main {
    padding-left: calc(15% + 20px);
}

footer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #3D2364;
    color: #fff;
    padding: 20px;
    width: 100%;
    text-align: center;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  /* Sidebar vira barra inferior */
    #sidebar {
        position: fixed;
        border-radius: 0px 0px 0px 0px;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        width: 100%;
        min-height: auto;
        height: 60px;
        z-index: 999;
        flex-direction: row;
        align-items: center;
    }
    
 footer {
margin-bottom: 55px;
}
    /* Ocultar bloco do usuário no mobile (opcional) */
    #user {
        display: none;
    }

    /* Conteúdo em linha */
    #sidebar_content {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 0 10px;
    }

    /* Ul ocupa toda a barra, em linha */
    #side_items {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        margin: 0;
    }

    .side-item {
        flex: 1;
        text-align: center;
    }

    .side-item a {
        flex-direction: column;
        justify-content: center;
        padding: 0;
        font-size: 0.65rem;
    }

    .side-item i {
        font-size: 1.1rem;
    }

    .item-description {
        font-size: 0.7rem;
    }

    /* Botão de abrir menu some ou pode ser reposicionado */
    #open_btn {
        display: none;
    }

    /* Dê um padding-bottom no conteúdo principal para não ficar escondido atrás da barra */
    main{
        padding-left: 20px; /* remover padding lateral extra */
        padding-bottom: 80px; /* ajuste conforme a altura da barra */

    }
    .main-content {
        padding-bottom: 70px; /* ajuste conforme a altura da barra */
        padding-left: 20px; /* remover padding lateral extra */
    }

}
