/* ========================================
   Estilos para Gastos Estimados
   ======================================== */

/* Seção principal */
.secao-gastos-estimados {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 16px;
    margin: 25px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
}

.secao-titulo {
    color: #2c3e50;
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

.secao-descricao {
    color: #6c757d;
    font-size: 1.1em;
    text-align: center;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Grid de áreas */
.gastos-areas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(550px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

/* Cards de área */
.gastos-area-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border: 1px solid #e0e0e0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 520px;
}

.gastos-area-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Card especial para totais */
.gastos-totais-card {
    border: 3px solid #28a745;
    background: linear-gradient(135deg, #f0f8f0 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.gastos-totais-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #20c997);
}

/* Títulos das áreas */
.gastos-area-titulo {
    color: #343a40;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.gastos-totais-titulo {
    color: #28a745;
    font-size: 1.4em;
    font-weight: 700;
}

.gastos-totais-titulo-consolidado {
    font-size: 1.1em;
    line-height: 1.3;
}

/* Container de valores */
.gastos-valores-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

/* Cards individuais de tipos de gasto */
.gastos-tipo-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    padding-top: 28px;
}

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

.gastos-ano-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Títulos dos tipos */
.gastos-tipo-titulo {
    color: #6c757d;
    font-size: 0.80em;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Valores */
.gastos-valor {
    font-size: 1.0em;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

/* Cores específicas para cada tipo */
.gastos-exclusivos {
    color: #1f77b4;
}

.gastos-tipo-card:has(.gastos-exclusivos) {
    border-color: #1f77b4;
}

.gastos-nao-exclusivos {
    color: #ff7f0e;
}

.gastos-tipo-card:has(.gastos-nao-exclusivos) {
    border-color: #ff7f0e;
}

.gastos-totais {
    color: #2ca02c;
}

.gastos-tipo-card:has(.gastos-totais) {
    border-color: #2ca02c;
}

.gastos-totais-gerais {
    color: #28a745;
    font-size: 1.0em;
    font-weight: 800;
}

.gastos-tipo-card:has(.gastos-totais-gerais) {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0f8f0 0%, #ffffff 100%);
}

/* Container do gráfico */
.gastos-grafico-container {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e9ecef;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

/* Fonte dos dados */
.gastos-fonte {
    font-size: 0.85em;
    color: #6c757d;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

/* Estados de erro e sem dados */
.gastos-sem-dados, .sem-dados, .erro-dados {
    text-align: center;
    color: #6c757d;
    padding: 30px;
    font-style: italic;
    font-size: 1.0em;
}

.erro-dados {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}

/* ========================================
   Responsividade
   ======================================== */

/* Tablets */
@media (max-width: 992px) {
    .gastos-areas-grid {
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
        gap: 20px;
    }
    
    .gastos-area-card {
        padding: 25px;
        min-width: auto;
    }
    
    .secao-titulo {
        font-size: 1.6em;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .gastos-areas-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gastos-valores-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .gastos-area-card {
        padding: 18px;
        min-width: auto;
    }
    
    .gastos-valor {
        font-size: 1.0em;
    }
    
    .gastos-totais-gerais {
        font-size: 1.0em;
    }
    
    .secao-titulo {
        font-size: 1.4em;
    }
    
    .secao-descricao {
        font-size: 1em;
    }
    
    .gastos-area-titulo {
        font-size: 1.2em;
    }
}

/* Mobile pequeno */
@media (max-width: 480px) {
    .secao-gastos-estimados {
        padding: 15px;
        margin: 15px 0;
    }
    
    .gastos-area-card {
        padding: 15px;
        min-width: auto;
    }
    
    .gastos-tipo-card {
        padding: 15px;
    }
    
    .gastos-valor {
        font-size: 1.0em;
    }
    
    .gastos-area-titulo {
        font-size: 1.1em;
    }
}

/* ========================================
   Animações e Transições
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gastos-area-card {
    animation: fadeInUp 0.5s ease-out;
}

.gastos-area-card:nth-child(1) { animation-delay: 0.1s; }
.gastos-area-card:nth-child(2) { animation-delay: 0.2s; }
.gastos-area-card:nth-child(3) { animation-delay: 0.3s; }
.gastos-area-card:nth-child(4) { animation-delay: 0.4s; }
.gastos-area-card:nth-child(5) { animation-delay: 0.5s; }

/* ========================================
   Acessibilidade
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .gastos-area-card,
    .gastos-tipo-card {
        animation: none;
        transition: none;
    }
    
    .gastos-area-card:hover,
    .gastos-tipo-card:hover {
        transform: none;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .gastos-area-card {
        border-width: 2px;
    }
    
    .gastos-tipo-card {
        border-width: 2px;
    }
    
    .gastos-valor {
        font-weight: 800;
    }
}
