/* =====================================================================
   SIMULADOR DE CIRCUITOS (MAQUEDIGITAL) - ESTILOS CSS DIDÁTICOS
   
   Este arquivo contém todas as regras visuais da aplicação Dash.
   O Dash carrega automaticamente qualquer arquivo .css colocado na pasta 'assets/'.
   ===================================================================== */

/* 1. RESET E ESTILOS GERAIS DO CORPO DA PÁGINA */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* Contêiner principal que centraliza o conteúdo na tela */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

/* 2. CABEÇALHO SUPERIOR (HEADER) */
.header-box {
    padding: 20px;
    background-color: #ffffff;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.header-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
}

.header-subtitle {
    margin: 5px 0 0 0;
    color: #64748b;
    font-size: 14px;
}

/* 3. CARTÕES DE SEÇÃO (CARDS BLOCKS) */
.card {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 12px;
    color: #1e293b;
}

/* 4. RÓTULOS E SELETORES (PRESETS) */
.label-bold {
    font-weight: 600;
    font-size: 15px;
    margin-right: 10px;
    color: #334155;
}

.dropdown-preset {
    width: 420px;
    display: inline-block;
    vertical-align: middle;
}

/* 5. BARRA DE CONTROLES E BOTÕES DE AÇÃO */
.control-bar {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.input-number {
    width: 90px;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

/* 6. ESTILIZAÇÃO DOS BOTÕES */
.btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.2s ease;
}

/* Botão Secundário (Adicionar Componente) */
.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

/* Botão Principal (Simular Circuito) */
.btn-primary {
    background-color: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

/* 7. BANNERS DE ALERTA DINÂMICOS (RETORNADOS NOS CALLBACKS) */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 15px;
}

.alert-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* 8. BLOCO DE TEXTO DE RESULTADO (RESUMO DOS NÓS) */
.output-resumo {
    padding: 15px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #0f172a;
    white-space: pre-wrap;
}

/* 9. IMAGEM DO ESQUEMÁTICO (SCHEMDRAW) */
.schematic-img {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    background-color: #ffffff;
    margin-top: 10px;
}

/* 10. CONTROLE DE DISPOSIÇÃO DOS GRÁFICOS (DROPDOWN) */
.dropdown-layout {
    width: 380px;
    display: inline-block;
    vertical-align: middle;
}

/* 11. CONTÊINER DOS GRÁFICOS (LAYOUT EMPILHADO VS LADO A LADO) */
.container-graficos-empilhado>*,
.container-graficos-lado-a-lado>* {
    width: 100%;
    min-height: 450px;
}

.container-graficos-empilhado {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    width: 100%;
}

.container-graficos-lado-a-lado {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 20px;
}

@media (max-width: 992px) {
    .container-graficos-lado-a-lado {
        grid-template-columns: 1fr;
        width: 100%;
        left: 0;
        right: 0;
        margin-left: 0;
        margin-right: 0;
        padding: 0;
    }
}