/* ===== ESTILOS ESPECÍFICOS PARA A DRE ===== */

.dre-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.dre-calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

/* Seção de Entrada */
.dre-input-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.dre-input-section h2 {
    color: #ff6b35;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.dre-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid rgb(255, 60, 0);
}

.dre-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dre-section h3 i {
    color: #ff6b35;
}

.dre-input {
    background: white;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s ease;
}

.dre-input:focus {
    border-color: #ff6b35;
    outline: none;
}

.dre-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Seção de Resultados */
.dre-results-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex; /* Adicionado: Usar flexbox */
    flex-direction: column; /* Adicionado: Organizar itens em coluna */
    max-height: 1000vh; /* Altura máxima para a seção de resultados */
    overflow-y: auto; /* Rolagem interna se o conteúdo exceder a altura máxima */
}

.dre-results-section h2 {
    color: #ff6b35;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Tabela DRE */
.dre-table {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.dre-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}

.dre-row:last-child {
    border-bottom: none;
}

.dre-row.subtotal {
    background: rgba(255, 107, 53, 0.1);
    margin: 5px -10px;
    padding: 15px 10px;
    border-radius: 6px;
    font-weight: 600;
    border-bottom: none;
}

.dre-row.final-result {
    background: rgba(255, 107, 53, 0.2);
    margin: 10px -10px 0;
    padding: 20px 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    border-bottom: none;
}

.dre-row.deduction .dre-value {
    color: #dc3545;
}

.dre-label {
    font-weight: 500;
    color: #333;
}

.dre-value {
    font-weight: 600;
    color: #28a745;
    min-width: 100px;
    text-align: right;
}

/* Indicadores */
.dre-indicators {
    margin-bottom: 30px;
}

.dre-indicators h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.indicator-card {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(255, 107, 53, 0.3);
}

.indicator-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.indicator-value {
    font-size: 24px;
    font-weight: 700;
}

/* Gráficos */
.dre-charts {
    margin-top: 30px;
    flex-shrink: 0; /* Adicionado: Evita que os gráficos encolham */
    max-height: 400px; /* Adicionado: Altura máxima para a seção de gráficos */
    overflow-y: auto; /* Adicionado: Rolagem interna para a seção de gráficos */
}

.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    align-items: start;
}

.chart-wrapper {
    background: #f8f9fa;
    padding: 5px;
    border-radius: 8px;
    text-align: center;
    height: 300px; /* Altura fixa para o wrapper do gráfico */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-wrapper canvas {
    max-width: 100%;
    height: 150px; /* Altura fixa para o canvas do gráfico */
}

/* Responsividade */
@media (max-width: 1200px) {
    .dre-calculator-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dre-container {
        padding: 10px;
    }
    
    .dre-input-section,
    .dre-results-section {
        padding: 20px;
    }
    
    .indicators-grid {
        grid-template-columns: 1fr;
    }
    
    .dre-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 200px;
    }
}

/* Tema escuro */
body.dark-theme .dre-input-section,
body.dark-theme .dre-results-section {
    background-color: #333;
    color: #e2e8f0;
}

body.dark-theme .dre-section {
    background-color: #3a3a3a;
}

body.dark-theme .dre-table {
    background-color: #3a3a3a;
}

body.dark-theme .dre-input {
    background-color: #3a3a3a;
    border-color: #3a3a3a;
    color: #e2e8f0;
}

body.dark-theme .dre-input:focus {
    border-color: #ff6b35;
}

body.dark-theme .chart-wrapper {
    background-color: #3a3a3a;
}

body.dark-theme .dre-label {
    color: #e2e8f0;
}

body.dark-theme .dre-row.subtotal {
    background: rgb(0 0 0 / 20%);
}

body.dark-theme .dre-row.final-result {
    background: rgb(0 0 0 / 30%);
}
