/* Estilos responsivos adicionais para o dashboard */

/* Ajustes para telas pequenas */
@media (max-width: 640px) {
    .dashboard-card {
        padding: 1rem !important;
    }
    
    .dashboard-title {
        font-size: 1.5rem !important;
    }
    
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .mobile-full-width {
        width: 100% !important;
    }
    
    .mobile-stack {
        flex-direction: column !important;
    }
    
    .mobile-stack > * {
        margin-bottom: 0.5rem !important;
        margin-right: 0 !important;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem !important;
    }
    
    .mobile-text-xs {
        font-size: 0.75rem !important;
    }
}

/* Ajustes para o menu lateral em dispositivos móveis */
.sidebar-mobile {
    position: fixed;
    top: 0; 
    left: 0;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

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

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 40;
    display: none;
}

.sidebar-overlay.open {
    display: block;
}

/* Estilos para o botão flutuante do menu */
.sidebar-toggle-button {
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #3B82F6;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 50;
    transition: all 0.2s ease-in-out;
}

.sidebar-toggle-button:hover {
    background-color: #2563EB;
    transform: scale(1.05);
}

.sidebar-toggle-button:active {
    transform: scale(0.95);
}

/* Ajustes para modais em dispositivos móveis */
@media (max-width: 640px) {
    .modal-content {
        width: 95% !important;
        margin: 1rem auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    
    .modal-form-grid {
        display: block !important;
    }
    
    .modal-form-grid > * {
        margin-bottom: 1rem !important;
    }
}

/* Melhorias de acessibilidade para toque */
@media (max-width: 768px) {
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    button, 
    [role="button"],
    a.button,
    input[type="button"],
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem 1rem;
    }

    /* Exceção: manter o toggle compacto no mobile */
    .dark-mode-toggle {
        min-height: 0 !important;
        min-width: 0 !important;
        padding: 0 !important;
    }

    /* Reservar espaço no topo para o botão flutuante do menu mobile */
    main > .py-6 {
        padding-top: 4.5rem !important;
    }
    
    .touch-action-none {
        touch-action: none;
    }
    
    /* Dark mode toggle button size adjustment for mobile */
    .dark-mode-toggle {
        width: 32px !important;
        height: 16px !important;
    }
    
    .dark-mode-toggle::before {
        width: 14px !important;
        height: 14px !important;
        top: 1px !important;
        left: 1px !important;
    }
    
    .dark-mode-toggle.active::before {
        transform: translateX(16px) !important;
    }
}

/* Estilos para o menu mobile da landing page */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 50;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    color: white;
    font-size: 1.25rem;
    padding: 1rem;
    width: 100%;
    text-align: center;
}

.mobile-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
