﻿/* ===== Leo Data AI ===== */
.lda-section {
    background-color: #00060c;    
    padding: 24px;
    margin-top: 50px;
}

.lda-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lda-header h2 {
    color: #00ffff;
    margin: 0 0 8px 0;
    font-size: 2.4rem;
}

.lda-subtitle {
    color: #c4f0ff;
    margin: 0 0 8px 0;
}

.lda-bullets {
    margin: 0;
    padding-left: 16px;
    color: #f0f8ff;
}

    .lda-bullets code {
        color: #00ffff;
    }

.lda-diagram {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    background: #061929;
    border: 1px solid #00ced144;
    border-radius: 8px;
    padding: 12px;
}

.lda-diagram-title {
    color: #c4f0ff;
    font-weight: 600;
}

.lda-diagram-img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 0 10px #00ced133;
    background: #0b0f1a;
    object-fit: contain;
}

.lda-query-card {
    width: min(100%, 980px); /* desktop: até 980px */
    margin-inline: auto; /* centraliza */
    box-sizing: border-box;
}

.lda-query-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.lda-hero-base {
    width: 480px !important;
    height: 480px !important;
}

@media (max-width: 992px) {
    .lda-query-row {
        grid-template-columns: 1fr;
    }

    .lda-hero-base {
        width: 270px !important;
        height: 270px !important;
    }
}

/* Esticar as colunas para a mesma linha */
.lda-query-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch; /* estica as duas colunas na mesma altura da linha */
}

/* Deixa a esquerda com visual de card e capaz de ocupar a altura total */
.lda-input-col {
    background: #00070c;
    
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 100%; /* usado junto com JS para "colar" altura */
}

    /* Quando estiver sem nada ainda, não parecer “vão vazio” */
    .lda-input-col .lda-hero-compact {
        margin-bottom: 12px;
    }

/* A direita já era card; só garante que fique coluna flex para medir corretamente */
.lda-results-col {
    display: flex;
    flex-direction: column;
}

/* Tabs dos múltiplos resultsets (Leo Data AI) */
.lda-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lda-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lda-tab-btn {
    padding: 6px 10px;
    border: 1px solid var(--lda-cyan, #22d3ee);
    background: transparent;
    color: var(--lda-cyan, #22d3ee);
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .06s ease;
}

    .lda-tab-btn:hover {
        transform: translateY(-1px);
    }

    .lda-tab-btn.active {
        background: var(--lda-cyan, #22d3ee);
        color: #001017;
    }

.lda-tab-panels {
    position: relative;
}

.lda-tab-panel {
    display: none;
}

    .lda-tab-panel.active {
        display: block;
    }

/* Tabela responsiva (evita “vazar” para a direita) */
.lda-grid-table {
    width: 100%;
    border-collapse: collapse;
    display: block;
    overflow: auto;
}

    .lda-grid-table th, .lda-grid-table td {
        padding: 6px 8px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        white-space: nowrap;
    }


/* Opcional: mantém os painéis com uma altura-base agradável,
   evitando que a direita colapse e crie assimetria */
.lda-panel-body.scrollable,
.lda-table.scrollable {
    margin-left: 10px;
    margin-right: 10px;
    margin-top: 10px;
    margin-bottom: 5px;
    min-height: 300px;
    overflow-x: auto;
    overflow-y: auto;
}

@media (max-width: 992px) {
    .lda-query-row {
        grid-template-columns: 1fr;
    }
    /* Em mobile, não forçamos alturas iguais */
    .lda-input-col {
        min-height: auto !important;
    }
}


.lda-input-col, .lda-results-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lda-label {
    color: #e2e8f0;
    font-weight: 600;
}

.lda-input-wrap {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.lda-input {
    background: #1a1a1a;
    color: #f0f8ff;
    border: 1px solid #00ced1;
    border-radius: 6px;
    padding: 10px 12px;
    outline: none;
}

    .lda-input:focus {
        box-shadow: 0 0 12px #00ced1aa;
    }

.lda-send-btn {
    background: #00ced1;
    color: #0b0f1a;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 700;
}

    .lda-send-btn:hover {
        background: #22d3ee;
        box-shadow: 0 0 12px #00ced1;
    }

    .lda-send-btn:disabled {
        opacity: .6;
        cursor: wait;
    }

.lda-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lda-suggestion {
    background: transparent;
    color: #00ced1;
    border: 1px solid #00ced1;
    padding: 8px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

    .lda-suggestion:hover {
        background: #00ced1;
        color: #0b0f1a;
    }

.lda-loader {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0b0f1a;
    border: 1px dashed #00ced1aa;
    padding: 10px;
    border-radius: 8px;
}

    .lda-loader img {
        width: 36px;
        height: 36px;
        object-fit: contain;
        filter: drop-shadow(0 0 6px #00ced1);
    }

    .lda-loader span {
        color: #c4f0ff;
    }

.lda-curl summary {
    color: #00ffff;
    cursor: pointer;
    font-weight: 600;
}

.lda-curl pre {
    background: #000;
    color: #0ff;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #00ced1;
    overflow: auto;
}

.lda-panels-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 992px) {
    .lda-panels-row {
        grid-template-columns: 1fr;
    }
}

.lda-panel {
    background: #0b0f1a;
    border: 1px solid #00ced144;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
   
    
}

.lda-panel-header {
    padding: 8px 10px;
    border-bottom: 1px solid #00ced133;
    color: #c4f0ff;
    font-weight: 600;
    background: #061929;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.lda-panel-body {
    margin: 0;
    padding: 10px;
    color: #0ff;
    background: #000;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    
}

.scrollable {
    max-height: 300px;
    overflow: auto;
}

    .scrollable::-webkit-scrollbar {
        height: 10px;
        width: 10px;
    }

    .scrollable::-webkit-scrollbar-thumb {
        background: #00ffff88;
        border-radius: 6px;
    }

.lda-table-card {
    background: #0b0f1a;
    border: 1px solid #00ced144;
    border-radius: 8px;
    padding-bottom: 8px;
}

.lda-table {
    /* ocupa a largura do card, nunca passa dela */
    width: 95%;
    max-width: 100%;
    /* altura proporcional à viewport */
    max-height: clamp(220px, 55vh, 420px);
    display: block;
    overflow: auto; /* scroll horizontal/vertical aqui */
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    /* NOVO: evita que o conteúdo aumente a largura do container/página */
    contain: inline-size; /* cria um contexto isolado p/ largura */
    isolation: isolate; /* extra segurança p/ efeitos/sticky */
}


.lda-table-empty {
    color: #9aa7b5;
    text-align: center;
    padding: 14px;
}

.lda-table.is-hidden {
    opacity: 0.15;
    filter: blur(2px);
    transition: opacity .35s ease, filter .35s ease;
}

.lda-table.is-visible {
    opacity: 1;
    filter: blur(0);
}

.lda-grid-table {
    width: max-content; /* cresce conforme conteúdo */
    min-width: 100%; /* mas ocupa pelo menos a largura do container */
    table-layout: auto;
}

    .lda-grid-table th,
    .lda-grid-table td {
        border: 1px solid #00ced122;        
        text-align: left;
        vertical-align: top;
        /*white-space: nowrap;  evita quebrar colunas largas */
    }

    .lda-grid-table th {
        color: #00ffff;
        background: #061929;
        position: sticky;
        top: 0;
        z-index: 1;
    }

/* Centralização do título e do subtítulo */
.lda-title-centered {
    text-align: center;
}

.lda-subtitle-centered {
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1rem;
}

.lda-subtitle-lefted {
    text-align: left;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1rem;
}

/* Banner/GIF decorativo */
.lda-hero img {
    display: block; /* remove espaços fantasmas de inline-image */
    max-width: 100%;
    height: auto; /* mantém proporção */
    object-fit: contain;
}

    .lda-hero img {
        width: 100%;
        height: 100%;
        object-fit: contain;        
    }



.lda-hero-orb {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px; /* garante área */
}
/* Versão compacta acima do input */
.lda-hero-compact {
    margin-bottom: 8px;
}

    .lda-hero-compact img {
       
    }

.lda-recaptcha {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}
@media (max-width: 768px) {
    .lda-section {
        padding: 16px;
    }

    .lda-query-card {
        padding: 12px;
    }

    .lda-input-wrap {
        grid-template-columns: 1fr; /* empilha */
        gap: 10px;
    }

    .lda-send-btn {
        width: 100%;
    }
}
/* Em telas muito estreitas, evita corte horizontal do widget */
@media (max-width: 360px) {
    .lda-recaptcha {
        transform: scale(0.9);
        transform-origin: center top;
    }
    .lda-table {
        max-height: 50vh;
    }

}

@media (max-width: 480px) {
    .lda-grid-table th {
        position: static;
    }
}

/* --- Card e seções: nunca deixam filho “puxar” o body --- */
.lda-query-card,
.lda-section,
.grid-wrapper,
.grid-layout {
    overflow-x: clip; /* fallback moderno p/ esconder sobras laterais */
}

/* --- GIF nunca vaza do card --- */
.lda-hero {
    width: 100%;
    overflow: hidden; /* corta qualquer sobra do GIF */
    border-radius: 10px;
}

    .lda-hero img {
        display: block;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }
/* Overlay com fade-in/out */
.lda-hero {
    position: relative;
    display: grid;
    place-items: center;
}

.lda-hero-base,
.lda-hero-overlay {
    display: block;
    transition: opacity .35s ease;
     display: block;
        max-width: 100%;
        height: auto;
        object-fit: contain;
    
}

.lda-hero-overlay {
    position: absolute;
    inset: 0; /* cobre o base */
    margin: auto;
    opacity: 0; /* começa escondido */
    pointer-events: none;
    background-color: #00070c;
    background-blend-mode: multiply;
    mix-blend-mode: lighten;
    filter: brightness(1.2) contrast(1.1);
}

/* Quando "ocupado", o overlay aparece e o base suaviza */
.lda-hero.is-busy .lda-hero-overlay {
    opacity: 1;
}

.lda-hero.is-busy .lda-hero-base {
    opacity: .25;
}

/* ===== MIC (limpo, sem redundâncias) ===== */
:root {
    --lda-cyan: #00ced1;
}

/* mantém seu grid/layout; só precisa do contexto p/ sobrepor o mic */
.lda-input-wrap {
    position: relative;
}

/* folga para o mic “dentro” do input */
.lda-input {
    padding-right: 48px;
}

/* base do mic — mesmas medidas/posicionamento que você já usa */
#lda-mic {
    position: absolute;
    right: 17%; /* mantém seu offset */
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px; /* mantém suas medidas */
    margin-left: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--lda-cyan); /* ciano em todos os estados */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: filter .15s ease, transform .06s ease, opacity .2s ease;
}

    #lda-mic:hover {
        filter: brightness(1.15);
    }

    #lda-mic:focus-visible {
        outline: 2px solid #6aaee8;
        outline-offset: 2px;
    }

    #lda-mic:disabled,
    #lda-mic[aria-disabled="true"] {
        opacity: .45;
        cursor: not-allowed;
    }

    /* conteúdo interno */
    #lda-mic .icon-mic {
        display: block;
        pointer-events: none;
    }

    #lda-mic .mic-wave {
        position: absolute;
        inset: -6px;
        border-radius: 10px;
        pointer-events: none;
        opacity: 0;
    }

    /* modo gravando — mesma cor (ciano) + brilho/ondas */
    #lda-mic.recording {
        color: var(--lda-cyan);
        transform: translateY(-50%) scale(.98);
        box-shadow: 0 0 0 2px rgba(0,206,209,.35) inset; /* sutil, sem estufar o input */
    }

        #lda-mic.recording .mic-wave {
            opacity: 1;
            background: radial-gradient(closest-side, rgba(0,206,209,.18), rgba(0,206,209,0));
            animation: ldaMicPulseCyan 900ms ease-in-out infinite, ldaMicWavesCyan 1400ms ease-in-out infinite;
        }

/* animações em ciano */
@keyframes ldaMicPulseCyan {
    0% {
        box-shadow: 0 0 0 0 rgba(0,206,209,.35);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0,206,209,0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0,206,209,0);
    }
}

@keyframes ldaMicWavesCyan {
    0%,100% {
        transform: scale(1);
        filter: brightness(1.1);
    }

    50% {
        transform: scale(1.06);
        filter: brightness(1.25);
    }
}

@media (max-width: 1300px) {
    #lda-mic {
        width: 40px;
        height: 40px;
        right: 2px;
        top: 21px;
    }

    .lda-input {
        padding-right: 42px;
    }
}

/* mobile: mantém suas medidas e só ajusta folga/right */
@media (max-width: 420px) {
    #lda-mic {
        width: 40px;
        height: 40px;
        right: 2px;
        top: 21px;
    }

    .lda-input {
        padding-right: 42px;
    }
}

/* container do dashboard (já tinha) */
#lda-dashboard {
    width: 100%;
    margin-top: 16px;
}

#lda-graphs {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(320px,1fr));
    gap: 16px;
}

/* cartão do gráfico */
.lda-graph-card {
    background: #0b1324;
    border: 1px solid #103047;
    border-radius: 12px;
    padding: 12px;
    overflow: hidden; /* evita o “crescimento” */
}

/* wrapper com ALTURA FIXA para o canvas */
.lda-chart-wrap {
    position: relative;
    width: 100%;
    height: 340px; /* ajuste livre (320–420) */
}

/* canvas ocupa 100% do wrapper */
.lda-graph-card canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
/* === Mobile: manter gráficos em pares (2 colunas) === */
@media (max-width: 768px) {
    /* força 2 colunas mesmo em telas menores */
    #lda-dashboard #lda-graphs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }

    .lda-graph-card {
        padding: 10px;
    }
    /* reduz a altura do canvas para caber melhor em 2 colunas */
    .lda-chart-wrap {
        height: 220px;
    }
    /* títulos um pouco menores no mobile */
    .lda-graph-title {
        font-size: 0.95rem;
    }

    .lda-graph-desc {
        font-size: 0.85rem;
        opacity: .9;
    }
}

/* opcional: telas muito estreitas (<420px) ainda em 2 colunas, um pouco mais baixo */
@media (max-width: 420px) {
    #lda-dashboard #lda-graphs {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px;
    }

    .lda-chart-wrap {
        height: 200px;
    }
}



