﻿/* BioIoT - adaptacao mobile MostraTec */

.mobile-menu-button,
.mobile-menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-container {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .main-content,
    body.modo-apresentacao .main-content {
        margin-left: 0;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 76px 14px 24px;
        overflow-x: hidden;
    }

    .sidebar {
        width: min(290px, 85vw);
        max-width: 85vw;
        height: 100dvh;
        z-index: 1002;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 10px 0 35px rgba(0,0,0,.25);
    }

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

    .mobile-menu-button {
        display: flex;
        position: fixed;
        top: 12px;
        left: 14px;
        width: 46px;
        height: 46px;
        align-items: center;
        justify-content: center;
        z-index: 1003;
        border: 1px solid #334155;
        border-radius: 12px;
        background: #132238;
        color: #38bdf8;
        font-size: 26px;
        cursor: pointer;
    }

    .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 1001;
        background: rgba(0,0,0,.6);
    }

    body.mobile-menu-open .mobile-menu-overlay {
        display: block;
    }

    body.modo-apresentacao .mobile-menu-button,
    body.modo-apresentacao .mobile-menu-overlay {
        display: none;
    }

    .tab-content,
    .card,
    .chart-container,
    .ai-panel,
    .ai-live-panel {
        min-width: 0;
        max-width: 100%;
    }

    .grid-cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .card {
        padding: 16px;
    }

    .top-bar {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
    }

    .top-bar > * {
        max-width: 100%;
    }

    .chart-container {
        width: 100%;
        height: 260px;
    }

    .chart-container canvas {
        max-width: 100%;
    }

    .value-display .number {
        font-size: clamp(1.7rem, 8vw, 2.5rem);
    }

    .ai-summary,
    .ai-live-results,
    .ai-result-grid,
    .ai-metrics,
    .gemeo-metric-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ai-feature-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .ai-panel,
    .ai-live-panel {
        padding: 16px;
    }

    .ai-live-metric {
        min-width: 0;
    }

    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    input, select, textarea {
        max-width: 100%;
    }
}

/* Fluxo vertical e animado no celular */
@media (max-width: 768px) {

    .fluxo-bioiot {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .fluxo-etapa {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        min-height: 125px;
        padding: 16px;
    }

    .fluxo-conexao {
        display: block;
        align-self: center;
        width: 4px;
        height: 30px;
        margin: 5px 0;
        border-radius: 5px;
        overflow: hidden;
        background: #334155;
    }

    .fluxo-conexao span {
        display: block;
        width: 100%;
        height: 100%;
        background: #38bdf8;
        transform: translateY(-100%);
    }

    .fluxo-bioiot.transmitindo .fluxo-conexao span {
        animation: fluxoMobile 1.8s linear infinite;
    }

    .fluxo-cabecalho {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@keyframes fluxoMobile {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

/* Respeitar a preferência de movimento reduzido */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .fluxo-bioiot.transmitindo .fluxo-conexao span {
        animation: none;
        transform: translateY(0);
    }
}

