/* ============================================================
   JOBTRUST IBM 370 TERMINAL THEME
   Autor: JOBTRUST IA
   Descricao: Tema retro terminal com troca dinamica de cor
   ============================================================ */

:root {
    --terminal-color: #00FF00;
    /* cor padrão */
}

/* BODY */
body {
    background: #000000;

    display: flex;
    justify-content: center;
    align-items: center;

    min-height: 100vh;
    margin: 0;

    font-family: "Courier New", monospace;

    /* background-image: url('/assets/img/jt-logo-p.png'); */
    /* background-repeat: repeat; */
    /* background-position: center; */
    /* background-size: 60%; */
}

/* MOLDURA */
.monitor-frame {
    background: #2b2b2b;

    padding: clamp(15px, 2vw, 40px);

    border-radius: 20px;

    box-shadow:
        inset 0 0 40px #000,
        0 20px 40px rgba(0, 0, 0, 0.8);

    display: flex;
    justify-content: center;
}

.screen {
    background: #000;
    width: min(90vw, 1100px);
    aspect-ratio: 4 / 3;
    padding: clamp(10px, 1.5vw, 20px);
    border-radius: 15px;
    color: var(--terminal-color);
    position: relative;
    overflow: auto;
    box-shadow: inset 0 0 30px var(--terminal-color);
    box-sizing: border-box;
    position: relative;
    z-index: 0;
}

.screen::after {
    content: "";
    position: absolute;
    inset: 0;
    /* substitui top/left/width/height */

    background: repeating-linear-gradient(transparent 0px,
            transparent 2px,
            rgba(255, 255, 255, 0.04) 3px);

    pointer-events: none;
    z-index: 1;
}

/* HEADER */
.header {
    border-bottom: 1px solid var(--terminal-color);
    padding-bottom: 8px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

/* INPUTS */
input,
textarea,
select {
    width: 100%;
    background: black;
    color: var(--terminal-color);
    border: 1px solid var(--terminal-color);
    font-family: "Courier New", monospace;
    padding: 5px;
    margin-bottom: 10px;
    height: 20px;
}

select {
    height: auto;
}

textarea {
    height: auto;
}

/* BUTTON */
button {
    background: #002200;
    color: var(--terminal-color);
    border: 1px solid var(--terminal-color);
    padding: 8px;
    cursor: pointer;
    font-family: "Courier New", monospace;
    margin-bottom: 10px;
}

button:hover {
    background: #003300;
}

button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* SECTIONS */
.section-title {
    margin-top: 10px;
    border-bottom: 1px dashed var(--terminal-color);
}

/* RESULT */
#resultado {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
    white-space: pre-wrap;
}

#resultado::-webkit-scrollbar {
    width: 4px;
}

#resultado::-webkit-scrollbar-thumb {
    background: var(--terminal-color);
}

#modalTerminal {
    box-shadow: 0 0 20px var(--terminal-color);
    animation: popupTerminal 0.15s ease-out;
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background: black;
    color: var(--terminal-color);

    border: 1px solid var(--terminal-color);

    padding: 10px;
    /* menor */

    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 16px;
    /* fixo */

    white-space: pre;
    /* importante */

    box-shadow: 0 0 20px var(--terminal-color);
    z-index: 999;
}

#modalOverlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 998;
}

/* ==========================================================
   AUTOFILL CHROME - FIX DEFINITIVO IBM TERMINAL
   ========================================================== */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {

    -webkit-box-shadow: 0 0 0 1000px #000 inset !important;
    box-shadow: 0 0 0 1000px #000 inset !important;

    -webkit-text-fill-color: var(--terminal-color) !important;
    color: var(--terminal-color) !important;

    background-color: #000 !important;
    background-image: none !important;

    caret-color: var(--terminal-color) !important;

    border: 1px solid var(--terminal-color) !important;

    transition: background-color 9999s ease-in-out 0s;
}

/* Apenas LGPD */
.pagina-lgpd .screen {
    overflow-y: auto;
    scrollbar-width: none;
}

.pagina-lgpd .screen::-webkit-scrollbar {
    display: none;
}

.cursor-wait {
    cursor: wait !important;
}

@keyframes popupTerminal {
    from {
        opacity: 0;
        transform: translate(-50%, -55%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ============================
   DASHBOARD DE PESQUISA
   ============================ */
.pagina-pesquisa .screen {
    width: min(92vw, 1280px);
    aspect-ratio: auto;
    min-height: 80vh;
}

.pagina-pesquisa {
    display: block;
    min-height: 100vh;
    padding: 14px 0;
}

.pagina-pesquisa .monitor-frame {
    margin: 0 auto;
    width: fit-content;
    max-width: calc(100vw - 24px);
}

.slogan-pesquisa {
    border: 1px dashed var(--terminal-color);
    padding: 8px 10px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0.95;
}

.acoes-topo {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-terminal-link {
    display: inline-block;
    text-decoration: none;
    background: #002200;
    color: var(--terminal-color);
    border: 1px solid var(--terminal-color);
    padding: 8px 10px;
    font-family: "Courier New", monospace;
    font-size: 13px;
}

.btn-terminal-link:hover {
    background: #003300;
}

.atalhos-pf {
    position: absolute;
    bottom: 40px;
    width: 95%;
    padding-top: 8px;
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.atalhos-pf .btn-terminal-link {
    margin-bottom: 0;
    cursor: pointer;
}

.pesquisa-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.painel-terminal {
    border: 1px solid var(--terminal-color);
    padding: 10px;
    background: rgba(0, 0, 0, 0.55);
}

.painel-titulo {
    font-size: 12px;
    opacity: 0.9;
}

.painel-dado {
    margin-top: 6px;
    font-size: 24px;
    font-weight: 700;
}

.pizza-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.pizza-grid>.pizza-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.pizza-card {
    border: 1px solid var(--terminal-color);
    padding: 10px;
    background: rgba(0, 0, 0, 0.45);
}

.pizza-titulo {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pizza-meta {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.pizza-body {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.pizza-chart {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    border: 1px solid var(--terminal-color);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.45);
}

.pizza-legenda {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 220px;
    font-size: 12px;
}

.pizza-legenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pizza-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
}

.comentarios-wrapper {
    border: 1px solid var(--terminal-color);
    max-height: 420px;
    overflow: auto;
    padding: 8px;
}

.comentario-linha {
    border-bottom: 1px dashed rgba(0, 255, 0, 0.35);
    padding: 8px 4px;
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .pesquisa-grid {
        grid-template-columns: 1fr;
    }

    .pizza-grid {
        grid-template-columns: 1fr;
    }

}

/* ============================
   RESPONSIVO - HOME/MOBILE
   ============================ */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 8px 0;
    }

    .monitor-frame {
        width: calc(100vw - 12px);
        max-width: calc(100vw - 12px);
        padding: 8px;
        border-radius: 12px;
    }

    .screen {
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
        aspect-ratio: auto;
        padding: 10px;
        border-radius: 10px;
        overflow-x: hidden;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 12px;
    }

    input,
    textarea,
    select,
    button {
        font-size: 16px;
    }

    #statusLimite,
    .atalhos-pf,
    #barraMensagem {
        position: static !important;
        width: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        margin-top: 10px;
    }

    .atalhos-pf {
        padding-top: 0;
        gap: 6px;
    }

    .btn-terminal-link {
        padding: 8px;
        font-size: 12px;
    }

    #modalTerminal {
        max-width: calc(100vw - 24px);
        max-height: 70dvh;
        overflow: auto;
        font-size: 12px;
        line-height: 1.3;
    }

    #modalContato {
        width: calc(100vw - 16px) !important;
    }
}

@media (max-width: 520px) {
    .screen {
        padding: 8px;
    }

    .section-title {
        font-size: 13px;
    }

    .pizza-chart {
        width: 135px;
        height: 135px;
    }

    .pizza-legenda {
        min-width: 100%;
    }
}
