/* CSS Responsivo para iEstudei - Carregado apenas em telas pequenas */

/* Oculta o botão hamburguer no Desktop */
.mobile-menu-toggle {
    display: none;
}

/* Oculta o fundo escuro do menu lateral no Desktop */
.sidebar-overlay {
    display: none;
}

@media screen and (max-width: 768px) {
    /* Remove zoom forçado que atrapalha o celular */
    body {
        zoom: 1 !important;
        transform: none !important;
        flex-direction: column;
        overflow-x: hidden;
    }

    /* Content Area */
    .content {
        padding: 15px;
        width: 100vw;
        box-sizing: border-box;
    }

    /* Sidebar (Menu Lateral) */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Esconde para fora da tela */
        width: 260px;
        height: 100vh;
        z-index: 10001; /* Bem acima do resto */
        transition: left 0.3s ease-in-out;
        box-shadow: 4px 0 15px rgba(0,0,0,0.3);
    }

    /* Quando o menu estiver aberto, a classe .active entra em ação */
    .sidebar.active {
        left: 0;
    }

    /* Fundo escuro quando o menu estiver aberto */
    .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Header */
    .header {
        position: relative;
        padding-left: 50px; /* Dá espaço para o botão hamburguer */
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    /* Botão Menu Hamburguer */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        background: var(--primary-color, #0d6efd);
        color: white;
        border: none;
        border-radius: 4px;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        cursor: pointer;
        z-index: 9999;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .mobile-menu-toggle:active {
        background: var(--primary-hover, #0b5ed7);
    }

    /* Cards e Modais */
    .card {
        padding: 15px;
    }

    .modal-content {
        width: 95% !important;
        margin: 5% auto;
        padding: 15px;
        max-height: 85vh;
    }

    /* Tabelas e Planilhas */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        border: 1px solid var(--border-color, #e9ecef);
        border-radius: 6px;
    }

    .table-responsive table {
        margin-top: 0;
        min-width: 600px; /* Garante que as colunas não esmaguem, ativando o scroll */
    }

    table.tabela-notas {
        table-layout: fixed !important;
        width: max-content !important;
        min-width: 720px !important;
    }

    table.tabela-notas th,
    table.tabela-notas td {
        padding: 8px !important;
    }

    table.tabela-notas th,
    table.tabela-notas td {
        width: 110px !important;
        min-width: 110px !important;
        max-width: 110px !important;
    }

    table.tabela-notas th {
        white-space: normal !important;
        text-overflow: unset !important;
        overflow: visible !important;
        font-size: 0.72rem !important;
        line-height: 1.15 !important;
    }

    table.tabela-notas td {
        white-space: nowrap !important;
        font-size: 0.85rem !important;
    }

    /* Ajustes em Filtros (Flexbox) */
    #filtrosDrawer > div {
        flex-direction: column;
        gap: 10px !important;
    }
    
    #filtrosDrawer > div > div {
        min-width: 100% !important;
    }
}
