/* Calculadora Comprar ou Alugar - Estilos */

/* Animation for highlighting results */
@keyframes highlight-fade {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.highlight-results {
    position: relative;
    animation: highlight-fade 2s ease-out;
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* Estilos para blocos de conteúdo */
.analise-personalizada,
.resumo-comparativo,
.fatores-influencia,
.conclusao-final {
    margin: 20px 0;
    padding: 18px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #4a90e2;
}

.analise-personalizada {
    border-color: #4a90e2;
}

.resumo-comparativo {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-color: #3b82f6;
    padding: 20px;
}

.resumo-comparativo .destaque {
    font-size: 1.1em;
    font-weight: 600;
    color: #1e40af;
    margin: 10px 0;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.resumo-comparativo .destaque span {
    color: #1e40af;
    font-weight: 700;
}

.resumo-comparativo .valor-destaque {
    font-size: 1.2em;
    font-weight: 700;
    color: #1e40af;
}

/* Layout do resumo comparativo */
.resumo-comparativo .comparativo-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.resumo-comparativo .opcao {
    flex: 1;
    min-width: 200px;
}

.resumo-comparativo .opcao-titulo {
    font-weight: 600;
    margin-bottom: 5px;
    color: #1e40af;
}

.resumo-comparativo .opcao-descricao {
    font-size: 0.9em;
    color: #4b5563;
}

.resumo-comparativo .detalhes-adicionais {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
    font-size: 0.95em;
}

.resumo-comparativo .detalhe-item {
    margin-bottom: 8px;
}

.fatores-influencia {
    border-color: #10b981;
}

.conclusao-final {
    background: #f0fdf4;
    border-color: #10b981;
}

/* Títulos dos blocos */
.analise-personalizada h4,
.resumo-comparativo h4,
.fatores-influencia h5 {
    margin-top: 0;
    color: #1e293b;
    font-size: 1.1em;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

/* Listas */
.analise-personalizada ul,
.fatores-influencia ul {
    padding-left: 20px;
    margin: 0;
}

.analise-personalizada li,
.fatores-influencia li {
    margin-bottom: 12px;
    line-height: 1.6;
}

/* Destaques */
.analise-personalizada b,
.resumo-comparativo b,
.fatores-influencia b {
    color: #1e40af;
}

/* Responsividade */
@media (max-width: 768px) {
    .result-summary,
    .result-card,
    .analise-personalizada,
    .resumo-comparativo,
    .fatores-influencia,
    .conclusao-final {
        padding: 15px;
        margin: 15px 0;
        width: 100%;
        box-sizing: border-box;
        border-radius: 0;
    }
    
    .fatores-influencia ul {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    
    .fatores-influencia li {
        margin: 0 0 15px 0;
        width: 100%;
    }
    
    /* Ajustes para telas muito pequenas (até 480px) */
    @media (max-width: 480px) {
        .analise-personalizada,
        .resumo-comparativo,
        .fatores-influencia,
        .conclusao-final {
            padding: 12px;
            margin: 12px 0;
            width: 100%;
        }
        
        .fatores-influencia h5 {
            font-size: 1em;
            padding-bottom: 6px;
        }
        
        .fatores-influencia li {
            padding: 12px 10px;
            font-size: 0.95em;
            line-height: 1.5;
        }
        
        .result-card {
            padding: 12px 8px;
        }
        
        .result-item {
            flex-direction: column;
            align-items: flex-start;
        }
        
        .result-label,
        .result-value {
            width: 100% !important;
            text-align: left !important;
            margin: 2px 0;
        }
    }
}

/* Estilos para o bloco de alerta importante */
.alerta-importante {
    margin: 25px 0;
    padding: 15px 20px;
    background: #fffbe6;
    border-left: 4px solid #f7b500;
    color: #665200;
    font-size: 0.95em;
    line-height: 1.6;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.alerta-importante b {
    color: #856404;
}

/* Estilo para destacar itens importantes */
.result-item.highlight {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.result-item.highlight .result-label {
    font-weight: 600;
    color: #2c3e50;
}

.result-item.highlight .result-value {
    font-size: 1.1em;
    font-weight: 700;
    color: #007bff;
}

/* Estilos para o resumo comparativo */
.resumo-comparativo {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 25px;
    margin: 0 0 25px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-top: 4px solid #3b82f6;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resumo-comparativo:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.resumo-comparativo h4 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.25em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resumo-comparativo p {
    margin: 10px 0;
    line-height: 1.6;
    color: #495057;
}

.resumo-comparativo b {
    color: #2c3e50;
    font-weight: 600;
}

/* Estilos para a seção de análise personalizada */
.analise-personalizada {
    margin: 25px 0;
}

.analise-personalizada h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.25em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analise-personalizada ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.analise-personalizada li {
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #6c757d;
    transition: all 0.3s ease;
}

.analise-personalizada li:hover {
    background-color: #e9ecef;
    transform: translateX(5px);
}

.analise-personalizada li b {
    color: #2c3e50;
}

/* Estilos para a seção de fatores de influência */
.fatores-influencia {
    margin: 25px 0;
    width: 100%;
    box-sizing: border-box;
    padding: 25px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.fatores-influencia h5 {
    color: #2c3e50;
    font-size: 1.2em;
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
}

.fatores-influencia ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.fatores-influencia b {
    color: #2c3e50;
}

/* Estilos para a conclusão */
.conclusao-final {
    margin: 25px 0;
    padding: 25px;
    background-color: #e8f4fd;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    width: 100%;
    box-sizing: border-box;
}

.conclusao-final b {
    color: #2c3e50;
}

/* Estilos para o bloco de resultados principais */
.resultado-principal {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.resultado-principal h3 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.resultado-destaque {
    background-color: white;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    border-left: 4px solid #28a745;
}

.resultado-destaque ul {
    margin: 10px 0;
    padding-left: 20px;
}

.resultado-destaque li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.highlight {
    color: #28a745;
    font-weight: 600;
}

.destaque-positivo {
    color: #28a745;
    font-weight: 600;
}

.dica {
    background-color: #e7f5ff;
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 15px;
    border-right: 3px solid #4dabf7;
}

.detalhes-adicionais {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #dee2e6;
}

/* Smooth scrolling for the whole page */
html {
    scroll-behavior: smooth;
}

/* Loading indicator */
.loading-indicator {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
}

.loading-indicator::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#calculadora-comprar-alugar-app {
    max-width: 1400px; /* Aumentei a largura máxima */
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.calculadora-header {
    text-align: center;
    margin-bottom: 30px;
}

.calculadora-header .data-atualizacao {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
    font-style: italic;
    opacity: 0.8;
}

.calculadora-header h1 {
    font-size: 2.5rem;
    margin: 0;
    color: #333;
}

.calculadora-header .compra {
    color: #007bff;
}

.calculadora-header .aluguel {
    color: #ff6b35;
}

.calculadora-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.calculadora-form h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-group input {
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group .input-suffix {
    position: relative;
}

.form-group .input-suffix::after {
    content: attr(data-suffix);
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

.form-group .input-suffix input {
    padding-right: 60px;
}

button[type="submit"] {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.3);
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.4);
}

.calculadora-results {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calculadora-results h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Estilos para a seção de gráficos */
.graficos-container {
    margin-top: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.graficos-container h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

.graficos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.grafico-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grafico-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.grafico-card h4 {
    color: #444;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1rem;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.grafico-card {
    position: relative;
    height: 400px;
    width: 100%;
}

.grafico-card canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Ajustes para responsividade */
@media (max-width: 992px) {
    .graficos-grid {
        grid-template-columns: 1fr;
    }
    
    .grafico-card {
        height: 350px;
    }
}

/* Garantir que os gráficos não fiquem muito pequenos em telas menores */
@media (max-width: 768px) {
    .grafico-card {
        height: 300px;
    }
}

/* Estilo do resumo dos resultados */
.result-summary {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px 30px;
    border-radius: 12px;
    margin: 0 0 25px 0;
    border-left: 5px solid #007bff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.result-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #007bff, #00b4d8);
}

.result-summary p {
    margin: 12px 0;
    line-height: 1.7;
    color: #444;
    font-size: 1.05rem;
}

.result-summary strong {
    color: #007bff;
    font-weight: 700;
    background: rgba(0, 123, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.result-summary .highlight {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 1.1em;
}

/* Destaque para 'Continuar alugando' */
.result-summary .highlight.aluguel-destaque {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 1.1em;
}

/* Estilo dos detalhes dos resultados */
.result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin: 20px 0 0 0;
    width: 100%;
    box-sizing: border-box;
    min-width: 0; /* Permite que o card encolha se necessário */
}

/* Seção de valores brutos e líquidos */
.value-section {
    margin: 20px 0;
    padding: 15px;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.value-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 8px;
}

/* Destaque para valores líquidos */
.net-value {
    background-color: #e8f4fd;
    border-left: 4px solid #007bff;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

/* Destaque para valores brutos */
.gross-value {
    background-color: #f8f9fa;
    border-left: 4px solid #6c757d;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
}

/* Melhorias na seção de fatores de influência */
.factors-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.factor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.factor-text {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 4px;
}

.factor-hint {
    font-size: 0.8em;
    color: #6c757d;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
}

.factor-item:hover .factor-hint {
    opacity: 1;
}

.factor-hint i {
    font-size: 0.9em;
}

.influence-factors {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f8ff 100%);
    border-radius: 12px;
    border: 1px solid #e1e7ec;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.influence-factors::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #007bff, #00b8d4);
}

.influence-factors h4 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e7ec;
    display: flex;
    align-items: center;
}

.influence-factors h4 i {
    margin-right: 12px;
    color: #007bff;
    font-size: 1.2em;
}

.factor-item {
    margin: 0;
    padding: 18px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.factor-item.positive {
    border-left-color: #28a745;
}

.factor-item.negative {
    border-left-color: #dc3545;
}

.factor-item.neutral {
    border-left-color: #6c757d;
}

.factor-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.factor-item i {
    font-size: 1.3em;
    min-width: 30px;
    text-align: center;
    margin-right: 12px;
}

.factor-item.positive i {
    color: #28a745;
}

.factor-item.negative i {
    color: #dc3545;
}

.factor-item.neutral i {
    color: #6c757d;
}

.factor-item span {
    font-size: 0.95em;
    line-height: 1.5;
}

.influence-factors h4 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.2em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.influence-factors h4 i {
    margin-right: 10px;
    color: #007bff;
}

.factor-item {
    margin: 12px 0;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.factor-item:hover {
    transform: translateX(5px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.factor-item i {
    margin-right: 12px;
    color: #007bff;
    font-size: 1.2em;
    min-width: 20px;
    text-align: center;
}

.fatores-influencia li {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-left: 4px solid #0073aa;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* Estilo para cards de resultado */
.result-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #007bff;
    height: 100%;
    box-sizing: border-box;
    min-width: 0;
    width: calc(50% - 12.5px);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.result-card.compra {
    border-top-color: #28a745;
}

.result-card.aluguel {
    border-top-color: #ff6b35;
    position: relative;
}

/* Estilo para o card de Custos com Aluguel */
.result-card.aluguel .result-group:last-child {
    width: 100%;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    grid-column: 1 / -1;
}

/* Grid interno para o card de Custos com Aluguel */
.result-card.aluguel .result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}

/* Seção de largura total */
.result-full-width {
    width: 100%;
    margin-top: 25px;
}

.result-full-width .result-card {
    width: 100%;
    margin: 0;
    border-top: 4px solid #ff6b35;
}

.result-full-width .result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 15px;
}

/* Estilo para o destaque */
.result-item.highlight {
    background-color: #fff9f6;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ff6b35;
}

.result-item.highlight .result-label {
    font-weight: 700;
    color: #333;
}

.result-item.highlight .result-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #ff6b35;
}

/* Ajuste para telas menores */
@media (max-width: 992px) {
    .result-card {
        width: 100%;
    }
    
    .result-card.aluguel .result-grid,
    .result-full-width .result-grid {
        grid-template-columns: 1fr;
    }
    
    .result-full-width .result-card {
        margin-top: 25px;
    }
}

.result-card h3 {
    color: #333;
    font-size: 1.4rem;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f1f1;
    display: flex;
    align-items: center;
}

.result-card h3::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.result-card.compra h3::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3E%3Cpath d='M12 2L1 12h3v9h16v-9h3L12 2zm0 3l7 6v8H5v-8l7-6z'/%3E%3C/svg%3E");
}

.result-card.aluguel h3::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ff6b35'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'/%3E%3Cpath d='M12.5 7H11v6l5.2 3.2.8-1.3-4.5-2.7z'/%3E%3C/svg%3E");
}

.result-item {
    padding: 12px 0;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.result-item:hover {
    background: rgba(0, 0, 0, 0.02);
    padding-left: 8px;
    border-radius: 4px;
}

.result-item.total {
    font-weight: 600;
    background: #f8f9fa;
    margin: 8px -15px -8px;
    padding: 12px 15px;
    border-radius: 0 0 8px 8px;
}

.result-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Estilos para a seção de gráficos */
.graficos-container {
    margin-top: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.graficos-container h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

.grafico-wrapper {
    margin-bottom: 50px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.grafico-wrapper h3 {
    color: #444;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    margin: 0 auto;
}

/* Estilos para tooltips dos gráficos */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    color: white;
    padding: 8px 12px;
    opacity: 0;
    position: absolute;
    pointer-events: none;
    transition: all 0.3s ease;
    transform: translate(-50%, 0);
    z-index: 100;
}

.chartjs-tooltip table {
    margin: 0;
    border-collapse: collapse;
}

.chartjs-tooltip table tr td {
    padding: 4px 0;
}

.chartjs-tooltip table tr td:first-child {
    padding-right: 12px;
}

.chartjs-tooltip-key {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border-radius: 2px;
}

/* Responsividade */
@media (max-width: 768px) {
    .grafico-wrapper {
        padding: 15px 10px;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* Estilo para notas explicativas */
.result-group .note {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
    font-style: italic;
}

/* Destaque para o valor do imóvel */
.highlight-box .result-value {
    font-size: 1.2em;
    font-weight: 600;
    color: #2c3e50;
}

.result-label {
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Estilo para a taxa de valorização */
.result-item .valorizacao-label {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    padding-left: 10px;
}

.result-value {
    font-weight: 600;
    color: #333;
    text-align: right;
}

.highlight-box {
    background: #f8f9ff;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 3px solid #4dabf7;
}

.highlight-box .result-value {
    font-size: 1.3rem;
    color: #007bff;
    font-weight: 700;
}

/* Grupos de resultados */
.result-group {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #e0e0e0;
}

/* Seção de largura total */
.result-full-width {
    grid-column: 1 / -1;
    margin: 20px 0 0 0;
    width: 100%;
    box-sizing: border-box;
}

.result-full-width .result-group {
    background: #fff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
    width: 100%;
}

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

.result-item.highlight {
    background: #f0f7ff;
    border-radius: 6px;
    padding: 10px;
    border-left: 3px solid #4dabf7;
}

.result-item.highlight .result-value {
    color: #0056b3;
    font-weight: 700;
    font-size: 1.1em;
}

.result-group h4 {
    margin: 0 0 12px 0;
    color: #555;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Container principal responsivo */
#calculadora-comprar-alugar-app {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

/* Remover borda azul em dispositivos móveis */
@media (max-width: 768px) {
    .calculadora-results {
        padding: 0 10px;
    }
    
    .result-card,
    .analise-personalizada,
    .resumo-comparativo,
    .fatores-influencia,
    .result-summary,
    .influence-factors {
        border-left: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    /* Remover os pseudo-elementos que criam as bordas azuis */
    .result-summary::before,
    .influence-factors::before,
    div.influence-factors::before {
        display: none !important;
    }
}

/* Melhorias para telas pequenas */
@media (max-width: 1024px) {
    #calculadora-comprar-alugar-app {
        max-width: 100%;
        padding: 10px;
    }
    
    /* Melhorias para tabelas em dispositivos móveis */
    .result-table {
        font-size: 0.9em;
    }
    
    .result-table th,
    .result-table td {
        padding: 8px 5px;
    }
    
    /* Ajustes para cards de resultado */
    .result-card {
        padding: 12px;
    }
    
    /* Reduzir tamanho de fontes em telas pequenas */
    h3, h4 {
        font-size: 1.1em;
    }
    
    .result-value {
        font-size: 1.2em;
    }
    
    .result-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .result-card {
        padding: 20px;
        width: 100%;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .result-value {
        text-align: left;
        width: 100%;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    #calculadora-comprar-alugar-app {
        padding: 15px;
    }
    
    .calculadora-header h1 {
        font-size: 2rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .result-details {
        grid-template-columns: 1fr;
    }
    
    .calculadora-form,
    .calculadora-results {
        padding: 20px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calculadora-results {
    animation: fadeIn 0.5s ease-out;
}

/* Estilos para a explicação dinâmica */
#explicacao-dinamica.explicacao-resposta {
    margin: 30px 0;
    padding: 25px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #4CAF50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: block !important;
    clear: both;
    font-size: 15px;
    color: #2c3e50;
    position: relative;
    opacity: 1 !important;
    visibility: visible !important;
    transition: all 0.3s ease;
    line-height: 1.7;
}

#explicacao-dinamica.explicacao-resposta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

#explicacao-dinamica .explicacao-conteudo h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

#explicacao-dinamica .explicacao-conteudo p {
    margin: 0;
    line-height: 1.7;
    color: #34495e;
    font-size: 15px;
}

/* Estilos para a seção de fatores influenciadores */
/* Estilos para o contêiner do gráfico */
.chart-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 400px;
    padding: 15px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.chart-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header .btn-detalhes {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.chart-header .btn-detalhes:hover {
    background: #0056b3;
}

.chart-legend {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.95rem;
    line-height: 1.5;
}

.chart-legend p {
    margin: 0 0 10px 0;
    color: #555;
}

.chart-legend ul {
    margin: 0;
    padding-left: 20px;
}

.chart-legend li {
    margin-bottom: 5px;
}

.chart-legend strong {
    color: #333;
}

/* Estilos para a tabela de evolução */
.tabela-evolucao {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tabela-container {
    padding: 15px;
}

.tabela-detalhada {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.tabela-detalhada th,
.tabela-detalhada td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tabela-detalhada th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.tabela-detalhada tr:hover {
    background: #f8f9fa;
}

.tabela-detalhada .positivo {
    color: #28a745;
    font-weight: 500;
}

.tabela-detalhada .negativo {
    color: #dc3545;
    font-weight: 500;
}

/* Estilos para a seção de análise detalhada */
.explicacao-conteudo {
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.destaque-resultado {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.destaque-resultado p {
    margin: 0;
    font-size: 1.05em;
    line-height: 1.6;
    color: #343a40;
}

.fatores-destaque {
    margin: 30px 0;
}

.fatores-destaque h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.25em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fatores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fator-item {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.fator-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.fator-icone {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: #007bff;
    font-size: 1.2em;
}

.fator-conteudo h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.fator-conteudo p {
    margin: 0;
    color: #6c757d;
    line-height: 1.6;
    font-size: 0.95em;
}

.consideracoes-finais {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.consideracoes-finais h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lista-consideracoes {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.lista-consideracoes li {
    margin-bottom: 10px;
    padding-left: 30px;
    position: relative;
    color: #495057;
    line-height: 1.6;
}

.lista-consideracoes li i {
    position: absolute;
    left: 0;
    top: 4px;
    color: #28a745;
}

.recomendacao {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
    border: 1px dashed #dee2e6;
}

.recomendacao h5 {
    margin-top: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.recomendacao p {
    margin: 10px 0 0 0;
    color: #495057;
    line-height: 1.7;
}

/* Melhorias de responsividade */
@media (max-width: 768px) {
    .fatores-grid {
        grid-template-columns: 1fr;
    }
    
    .fator-item {
        padding: 15px;
    }
    
    .explicacao-conteudo {
        padding: 15px;
    }
}

.fatores-influenciadores {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

.fatores-influenciadores h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fatores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.fator-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e9ecef;
}

.fator-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fator-icone {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e3f2fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    color: #1976d2;
    flex-shrink: 0;
}

.fator-conteudo h4 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 0.95em;
    font-weight: 600;
}

.fator-destaque {
    font-size: 1.3em;
    font-weight: 700;
    color: #1976d2;
    margin: 0 0 3px 0;
}

.fator-descricao {
    margin: 0;
    color: #6c757d;
    font-size: 0.85em;
}

.fatores-observacao {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f1f8ff;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #0d6efd;
    margin-top: 15px;
}

.fatores-observacao i {
    font-size: 1.2em;
}

/* Estilos para a seção de análise financeira */
.fatores-destaque {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
}

.fatores-destaque h4 {
    margin-top: 0;
    color: #0a58ca;
    font-size: 1.1em;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fatores-destaque ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.fatores-destaque li {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.fatores-destaque li:last-child {
    border-bottom: none;
}

.fatores-destaque i {
    font-size: 1.2em;
    color: #0d6efd;
    margin-top: 4px;
}

.fatores-destaque strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.fatores-destaque p {
    margin: 0;
    color: #555;
    font-size: 0.95em;
    line-height: 1.5;
}

.consideracoes-finais {
    margin-top: 25px;
    padding: 15px;
    background-color: #f0f7ff;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
}

.consideracoes-finais h4 {
    margin-top: 0;
    color: #0a58ca;
    font-size: 1.1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.consideracoes-finais p {
    margin: 0;
    color: #495057;
    font-size: 0.95em;
    line-height: 1.6;
}

/* Estilos para a seção informativa de curto prazo */
.info-box {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid #0d6efd;
    display: flex;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.info-box.short-term-notice {
    background-color: #f0f7ff;
    border-left-color: #0d6efd;
}

.info-icon {
    font-size: 1.5em;
    color: #0d6efd;
    margin-top: 4px;
}

.info-content h4 {
    margin-top: 0;
    color: #0a58ca;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.info-content p {
    margin-bottom: 10px;
    color: #495057;
    line-height: 1.5;
}

.info-content ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.info-content li {
    margin-bottom: 6px;
    color: #495057;
    font-size: 0.95em;
}

.info-content li::marker {
    color: #0d6efd;
}

/* Estilos para a classificação de intensidade */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.vantagem-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vantagem-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    gap: 6px;
    white-space: nowrap;
}

.vantagem-legenda {
    color: #6c757d;
    cursor: help;
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.vantagem-legenda:hover {
    opacity: 1;
}

.vantagem-tag.alta {
    background-color: #e6f7ee;
    color: #0d6832;
    border: 1px solid #a3e6c0;
}

.vantagem-tag.moderada {
    background-color: #fff8e6;
    color: #8a6d3b;
    border: 1px solid #ffecb3;
}

.vantagem-tag.baixa {
    background-color: #fff5f5;
    color: #a94442;
    border: 1px solid #f5c6cb;
}

.comparison-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-info {
    background: none;
    border: none;
    color: #6c757d;
    padding: 0;
    cursor: help;
    font-size: 1em;
    transition: color 0.2s;
}

.btn-info:hover {
    color: #0d6efd;
}

/* Melhorias na responsividade para prazos curtos */
@media (max-width: 768px) {
    .vantagem-tag {
        font-size: 0.75em;
        padding: 4px 8px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Estilos para o container do gráfico */
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0 15px 0;
}

.chart-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3em;
    color: #2c3e50;
}

.btn-detalhes {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #0d6efd;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-detalhes:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.btn-detalhes i {
    font-size: 0.9em;
}

.chart-container {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

/* Estilos para a tabela de evolução */
.tabela-evolucao {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.tabela-container {
    width: 100%;
    overflow-x: auto;
}

.tabela-detalhada {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.tabela-detalhada th,
.tabela-detalhada td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.tabela-detalhada th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.tabela-detalhada tbody tr:hover {
    background-color: #f8f9fa;
}

.tabela-detalhada td {
    color: #495057;
}

.tabela-detalhada td:not(:first-child) {
    font-family: 'Courier New', monospace;
    text-align: right;
}

/* Estilos para as diferenças na tabela */
.tabela-detalhada .positivo {
    color: #198754;
    font-weight: 600;
}

.tabela-detalhada .negativo {
    color: #dc3545;
    font-weight: 600;
}

.tabela-detalhada .positivo::before {
    content: '+';
}

/* Melhorias na responsividade */
@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .btn-detalhes {
        width: 100%;
        justify-content: center;
    }
    
    .tabela-detalhada {
        font-size: 0.85em;
    }
    
    .tabela-detalhada th,
    .tabela-detalhada td {
        padding: 8px 10px;
    }
}

/* Estilos para o gráfico de evolução */
.chart-container {
    position: relative;
    min-height: 400px;
    margin: 20px 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
}

.chart-legend {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9em;
    line-height: 1.6;
}

.chart-legend p {
    margin-top: 0;
    color: #495057;
}

.chart-legend ul {
    margin-bottom: 0;
    padding-left: 20px;
}

.chart-legend li {
    margin-bottom: 5px;
}

/* Estilo para mensagem de erro do gráfico */
.chart-error {
    text-align: center;
    padding: 40px 20px;
    background: #fff8f8;
    border: 1px solid #ffebee;
    border-radius: 8px;
}

.chart-error i {
    font-size: 2.5em;
    color: #dc3545;
    margin-bottom: 15px;
    display: block;
}

.chart-error p {
    color: #dc3545;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.btn-refresh {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.btn-refresh:hover {
    background: #c82333;
}

.btn-refresh i {
    font-size: 0.9em;
    color: white;
    margin: 0;
}

/* Melhorias na responsividade */
@media (max-width: 768px) {
    .chart-container {
        padding: 15px 10px;
    }
    
    .chart-legend {
        padding: 12px;
        font-size: 0.85em;
    }
}

/* Garante que o container não esteja vazio e tenha altura mínima */
#explicacao-dinamica:not(:empty) {
    min-height: 100px;
    display: block !important;
    padding: 25px !important;
}

/* Estilos para dispositivos móveis */
@media (max-width: 768px) {
    #explicacao-dinamica.explicacao-resposta {
        margin: 20px 0;
        padding: 20px 15px !important;
    }
    
    #explicacao-dinamica .explicacao-conteudo h4 {
        font-size: 16px;
    }
    
    #explicacao-dinamica .explicacao-conteudo p {
        font-size: 14px;
    }
}

.explicacao-resposta strong {
    color: #28a745;
}

#explicacao-dinamica p {
    margin: 0 0 10px 0;
}

#explicacao-dinamica strong {
    color: #28a745;
    font-size: 1.1em;
}

/* Cores para diferentes seções */
.highlight,
span.highlight,
.highlight span,
#resultados-calculadora .highlight {
    color: #28a745 !important;
    font-weight: 600 !important;
}

.compra-section {
    border-left-color: #007bff;
}

.aluguel-section {
    border-left-color: #ff6b35;
}

.compra-section h3 {
    color: #007bff;
}

.aluguel-section h3 {
    color: #ff6b35;
}

/* Estilos para o resultado detalhado */
.result-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 5px solid #007bff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.resultado-detalhado {
    color: #333;
}

.resultado-detalhado h3 {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    color: #333;
}

/* Estilos gerais para os destaques */
.highlight {
    color: #2c7be5;
    font-weight: 600;
    background-color: rgba(44, 123, 229, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Estilo específico para o destaque de aluguel */
.highlight.aluguel-destaque {
    color: #ff6b35;
    background-color: rgba(255, 107, 53, 0.1);
}

/* Estilos para o conteúdo do resultado */
.resultado-detalhado p {
    line-height: 1.7;
    font-size: 1.05em;
    margin: 15px 0 10px 0;
}

/* Estilo para valores em destaque */
.resultado-detalhado .highlight:not(.aluguel-destaque) {
    color: #2c7be5;
    background-color: rgba(44, 123, 229, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Estilo para texto em negrito */
.resultado-detalhado strong {
    color: #2c7be5;
    font-weight: 600;
}

/* Estilo para o título da melhor opção */
.result-summary h3 {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    color: #333;
}

/* Ajuste para o título de aluguel no resultado */
.result-summary .aluguel-destaque {
    color: #ff6b35;
    background-color: rgba(255, 107, 53, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}



/* Ajustes para responsividade dos gráficos e cards */
@media (max-width: 768px) {
    /* Reset de estilos para mobile */
    .analise-personalizada,
    .resumo-comparativo,
    .fatores-influencia,
    .conclusao-final,
    .result-card {
        margin: 0.5rem 0;
        padding: 0.75rem;
        border-left: none !important;
        border-right: none !important;
        border-radius: 0;
        box-shadow: none;
    }

    /* Layout em coluna para itens em linha */
    .result-group,
    .fatores-grid,
    .graficos-grid,
    .comparativo-grid {
        flex-direction: column;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Largura total para itens em telas pequenas */
    .result-item,
    .fator-item,
    .opcao,
    .box {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.5rem 0;
    }

    /* Ajuste de tipografia para melhor leitura */
    body {
        font-size: 15px;
        line-height: 1.5;
    }

    /* Evitar quebra de layout em textos longos */
    .result-label,
    .result-value,
    .texto-ajustavel,
    .analise-personalizada p,
    .resumo-comparativo p {
        word-break: break-word;
        hyphens: auto;
    }

    /* Ajuste para botões e inputs */
    button[type="submit"],
    .form-control,
    input[type="number"],
    input[type="text"] {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        box-sizing: border-box;
    }

    /* Esconder elementos não essenciais em mobile */
    .linha-vertical-azul,
    .detalhe-icone {
        display: none;
    }

    /* Ajuste específico para gráficos */
    .graficos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Melhorias para a seção de análise */
    .analise-personalizada,
    .resumo-comparativo,
    .fatores-influencia {
        padding: 15px;
        margin: 15px 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Ajuste para itens de lista */
    .analise-personalizada li {
        padding: 8px 10px;
        margin-bottom: 8px;
    }
    
    /* Melhorias para os cards de resultado */
    .result-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* Reduzir tamanho de fontes em telas muito pequenas */
    @media (max-width: 480px) {
        body {
            font-size: 14px;
        }
        
        .result-value {
            font-size: 1.1em;
        }
        
        .result-label {
            font-size: 0.9em;
        }
        
        /* Melhorias para os toggles e inputs */
        .form-group label {
            font-size: 0.9em;
        }
        
        .form-control {
            padding: 8px 12px;
            font-size: 0.95em;
        }
        
        /* Ajuste para botões */
        button[type="submit"] {
            padding: 10px 16px;
            font-size: 0.95em;
        }
    }

    .grafico-card {
        height: auto; /* Altura automática para gráficos em telas pequenas */
        min-height: 280px; /* Altura mínima para evitar que fiquem muito pequenos */
        width: 100%; /* Garante que o card ocupe a largura total disponível */
    }

    .chart-container {
        height: 250px; /* Ajusta a altura do container do gráfico para telas menores */
    }

    .result-details {
        flex-direction: column; /* Empilha os cards verticalmente em telas pequenas */
        gap: 20px;
    }

    .result-card {
        width: 100%; /* Cards de resultado ocupam a largura total em telas pequenas */
        max-width: 100%; /* Garante que não exceda a largura do contêiner pai */
    }
}

@media (max-width: 480px) {
    .grafico-card {
        min-height: 250px;
    }

    .chart-container {
        height: 200px;
    }
}




/* Melhorias específicas para a seção de fatores de influência */
.influence-factors .factors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

@media (max-width: 768px) {
    .influence-factors .factors-grid {
        display: flex;
        flex-direction: column;
    }

    .influence-factors .factor-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 15px;
    }

    .influence-factors .factor-item i {
        margin-right: 0;
        margin-bottom: 5px;
    }

    .influence-factors .factor-item span {
        font-size: 1em;
        line-height: 1.4;
    }

    .influence-factors .factor-highlight {
        font-size: 0.9em;
        line-height: 1.4;
        margin-top: 5px;
    }
}



/* ===== OTIMIZAÇÕES AVANÇADAS PARA TELAS MENORES ===== */

/* Melhorias para tipografia responsiva */
@media (max-width: 768px) {
    /* Tipografia fluida usando clamp() */
    h1, .calculadora-header h1 {
        font-size: clamp(1.5rem, 4vw, 2.5rem);
    }
    
    h2, .calculadora-form h2, .calculadora-results h2 {
        font-size: clamp(1.2rem, 3vw, 1.5rem);
    }
    
    h3, .result-card h3 {
        font-size: clamp(1rem, 2.5vw, 1.4rem);
    }
    
    h4, .influence-factors h4 {
        font-size: clamp(0.9rem, 2vw, 1.3rem);
    }
    
    /* Melhor espaçamento para toque */
    .factor-item {
        min-height: 44px; /* Tamanho mínimo recomendado para toque */
        padding: 16px;
        margin-bottom: 12px;
    }
    
    /* Botões mais acessíveis em mobile */
    button[type="submit"] {
        min-height: 48px;
        font-size: 1rem;
        padding: 12px 24px;
        width: 100%;
        margin-top: 16px;
    }
    
    /* Inputs mais amigáveis ao toque */
    .form-group input {
        min-height: 48px;
        font-size: 16px; /* Evita zoom no iOS */
        padding: 12px 16px;
    }
    
    /* Melhor contraste e legibilidade */
    .result-value {
        font-size: clamp(1rem, 2.5vw, 1.2rem);
        font-weight: 600;
    }
    
    .result-label {
        font-size: clamp(0.85rem, 2vw, 1rem);
        line-height: 1.4;
    }
}

/* Otimizações para telas muito pequenas (320px - 480px) */
@media (max-width: 480px) {
    /* Container principal com padding otimizado */
    #calculadora-comprar-alugar-app {
        padding: 8px;
        margin: 0;
        border-radius: 0;
    }
    
    /* Cards com espaçamento reduzido mas ainda respirável */
    .result-card,
    .analise-personalizada,
    .resumo-comparativo,
    .fatores-influencia,
    .influence-factors {
        padding: 12px;
        margin: 8px 0;
        border-radius: 8px;
    }
    
    /* Formulário otimizado */
    .calculadora-form {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .form-grid {
        gap: 12px;
    }
    
    /* Resultados mais compactos */
    .calculadora-results {
        padding: 16px;
    }
    
    .result-item {
        padding: 8px 0;
        font-size: 0.9rem;
    }
    
    /* Fatores de influência otimizados */
    .factor-item {
        padding: 12px;
        gap: 12px;
    }
    
    .factor-item i {
        font-size: 1.1rem;
        min-width: 24px;
    }
    
    .factor-item span {
        font-size: 0.9rem;
        line-height: 1.3;
    }
}

/* Melhorias para acessibilidade e usabilidade */
@media (max-width: 768px) {
    /* Foco mais visível em dispositivos móveis */
    .form-group input:focus,
    button:focus,
    .factor-item:focus {
        outline: 3px solid #007bff;
        outline-offset: 2px;
    }
    
    /* Hover states adaptados para touch */
    .factor-item:hover,
    .factor-item:focus {
        transform: none; /* Remove animações que podem confundir em touch */
        background-color: #f8f9fa;
        border-left-color: #007bff;
    }
    
    /* Melhor feedback visual para interações */
    .result-card:active,
    .factor-item:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* Otimizações para performance em dispositivos móveis */
@media (max-width: 768px) {
    /* Reduzir animações complexas */
    .result-card:hover,
    .grafico-card:hover,
    .resumo-comparativo:hover {
        transform: none;
    }
    
    /* Simplificar sombras para melhor performance */
    .result-card,
    .influence-factors,
    .factor-item {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    /* Otimizar gradientes */
    .resumo-comparativo {
        background: #f8f9fa; /* Cor sólida em vez de gradiente */
    }
    
    .result-summary {
        background: #f8f9fa;
    }
    
    .result-summary::before {
        display: none; /* Remove pseudo-elemento desnecessário */
    }
}

/* Layout flexível para diferentes orientações */
@media (max-width: 768px) and (orientation: landscape) {
    /* Ajustes para modo paisagem em tablets pequenos */
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .result-details {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .influence-factors .factors-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Melhorias para texto e conteúdo */
@media (max-width: 768px) {
    /* Quebra de linha inteligente */
    .factor-item span,
    .result-label,
    .analise-personalizada li {
        word-break: break-word;
        hyphens: auto;
        overflow-wrap: break-word;
    }
    
    /* Espaçamento entre parágrafos otimizado */
    .resumo-comparativo p,
    .analise-personalizada p {
        margin: 8px 0;
        line-height: 1.5;
    }
    
    /* Listas mais legíveis */
    .analise-personalizada li {
        margin-bottom: 8px;
        padding: 10px 12px;
        line-height: 1.4;
    }
}

/* Estados de carregamento e feedback visual */
@media (max-width: 768px) {
    /* Indicador de carregamento otimizado */
    .loading-indicator {
        padding: 16px;
        font-size: 0.9rem;
    }
    
    .loading-indicator::after {
        width: 16px;
        height: 16px;
        margin-left: 8px;
    }
    
    /* Feedback visual para ações */
    button[type="submit"]:active {
        transform: scale(0.98);
        background: #0056b3;
    }
}

/* Otimizações específicas para iOS Safari */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        /* Fix para viewport em iOS */
        #calculadora-comprar-alugar-app {
            min-height: -webkit-fill-available;
        }
        
        /* Melhor renderização de texto */
        body {
            -webkit-text-size-adjust: 100%;
            text-size-adjust: 100%;
        }
        
        /* Smooth scrolling otimizado */
        * {
            -webkit-overflow-scrolling: touch;
        }
    }
}

/* Melhorias para contraste e acessibilidade */
@media (max-width: 768px) {
    /* Melhor contraste para textos pequenos */
    .factor-item span,
    .result-label {
        color: #2c3e50;
    }
    
    .factor-highlight {
        background-color: #f8f9fa;
        padding: 8px;
        border-radius: 4px;
        margin-top: 8px;
        border-left: 3px solid #007bff;
    }
    
    /* Ícones mais visíveis */
    .factor-item i {
        opacity: 0.8;
    }
    
    .factor-item.positive i {
        color: #198754;
    }
    
    .factor-item.neutral i {
        color: #6c757d;
    }
}

/* Otimizações para telas de alta densidade (Retina) */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    /* Bordas mais nítidas */
    .factor-item,
    .result-card,
    .form-group input {
        border-width: 0.5px;
    }
    
    /* Ícones mais nítidos */
    .factor-item i {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Melhorias para navegação por teclado em dispositivos móveis */
@media (max-width: 768px) {
    /* Foco sequencial melhorado */
    .factor-item,
    .result-card,
    .form-group input,
    button {
        position: relative;
    }
    
    /* Skip links para acessibilidade */
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }
    
    .sr-only:focus {
        position: static;
        width: auto;
        height: auto;
        padding: 8px;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        background: #007bff;
        color: white;
        border-radius: 4px;
    }
}

/* Otimizações finais para UX em mobile */
@media (max-width: 768px) {
    /* Prevenção de zoom acidental */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Previne zoom no iOS */
        max-width: 100%;
    }
    
    /* Melhor área de toque para elementos interativos */
    .factor-item,
    button,
    .result-card {
        position: relative;
    }
    
    .factor-item::before,
    button::before {
        content: '';
        position: absolute;
        top: -8px;
        left: -8px;
        right: -8px;
        bottom: -8px;
        z-index: -1;
    }
    
    /* Feedback tátil visual */
    .factor-item:active,
    .result-card:active {
        background-color: rgba(0, 123, 255, 0.05);
    }
}

