/* ====================================
   FERRAMENTAS - ESTILOS MODERNOS
==================================== */

.ferramenta-page {
    background: var(--bg-secondary);
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

.ferramenta-page .page-header {
    background: linear-gradient(135deg, var(--primary-color), #ff9933);
    color: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.ferramenta-page .page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.ferramenta-page .page-header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.ferramenta-page .page-header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.25rem;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* ====================================
   TOOL GRID
==================================== */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.tool-grid .card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.tool-grid .card:hover {
    border-color: rgba(255, 140, 0, 0.2);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.tool-grid .card h2 {
    color: var(--primary-color);
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

/* ====================================
   TOOL FORM
==================================== */
.tool-form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

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

.tool-form .form-group label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.tool-form .form-group input,
.tool-form .form-group select {
    padding: 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tool-form .form-group input:focus,
.tool-form .form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
    transform: translateY(-1px);
}

.tool-form .form-group small {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
    line-height: 1.5;
}

.tool-form input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: var(--gray-200);
    outline: none;
    -webkit-appearance: none;
}

.tool-form input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.tool-form input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
}

.range-value {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

/* ====================================
   RESULTADO
==================================== */
.resultado-card {
    background: linear-gradient(135deg, var(--primary-color), #ff9933) !important;
    color: white;
    position: relative;
    overflow: hidden;
}

.resultado-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.resultado-card h2 {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.resultado-destaque {
    background: rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.resultado-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.resultado-valor {
    display: block;
    font-size: 3rem;
    font-weight: 800;
}

.resultado-info {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.info-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.info-item strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.info-item p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.info-item.essenciais {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.info-item.lazer {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.3);
}

.info-item.poupanca {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.info-item small {
    font-size: 0.75rem;
    opacity: 0.8;
    display: block;
    margin-top: 0.25rem;
}

.chart-container-juros {
    position: relative;
    height: 350px;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.chart-container-financiamento {
    position: relative;
    height: 400px;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.comparacao-sistemas {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.1), rgba(255, 140, 0, 0.05));
    border-radius: var(--radius-md);
    border: 2px solid rgba(255, 140, 0, 0.3);
}

.comparacao-sistemas h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.comparacao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.sistema-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.sistema-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sistema-card strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.sistema-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.valor-sistema {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.valor-sistema.destaque {
    color: var(--success);
}

.economia-info {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.economia-info strong {
    color: var(--success);
    font-weight: 700;
}

.valor-percentual {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

.info-item-full {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.15), rgba(255, 140, 0, 0.05));
    padding: 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid rgba(255, 140, 0, 0.3);
}

.dica-box {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border-left: 5px solid var(--warning);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 1;
}

.dica-box strong {
    display: block;
    margin-bottom: 0.75rem;
    color: var(--warning);
    font-size: 1.125rem;
}

.dica-box p {
    margin: 0;
    line-height: 1.7;
    font-size: 1rem;
}

/* ====================================
   EDUCACIONAL
==================================== */
.educacional {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-top: 2rem;
}

.educacional h2 {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--primary-color);
    font-size: 2rem;
}

.educacional-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.educacional-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.educacional-item:hover {
    background: var(--bg-secondary);
    transform: translateY(-5px);
}

.edu-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.educacional-item h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.educacional-item p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
}

/* ====================================
   RESPONSIVE
==================================== */
@media (max-width: 968px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    .resultado-valor {
        font-size: 2.5rem;
    }
    
    .ferramenta-page .page-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .ferramenta-page {
        padding: 2rem 0;
    }
    
    .ferramenta-page .page-header {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .ferramenta-page .page-header h1 {
        font-size: 1.75rem;
    }
    
    .ferramenta-page .page-header p {
        font-size: 1rem;
    }
    
    .tool-grid .card {
        padding: 2rem 1.5rem;
    }
    
    .educacional {
        padding: 2rem 1.5rem;
    }
    
    .educacional-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .info-item {
        padding: 1.25rem;
    }
    
    .info-item p {
        font-size: 1.25rem;
    }
}

/* ====================================
   RESPONSIVE - MOBILE FIRST
==================================== */
@media (max-width: 768px) {
    .ferramenta-page {
        padding: 2rem 0;
    }
    
    .ferramenta-page .page-header {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
    }
    
    .ferramenta-page .page-header h1 {
        font-size: 2rem;
    }
    
    .ferramenta-page .page-header p {
        font-size: 1rem;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-grid .card {
        padding: 1.5rem;
    }
    
    .tool-grid .card h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .tool-form {
        gap: 1.5rem;
    }
    
    .tool-form .form-group label {
        font-size: 0.9375rem;
    }
    
    .tool-form input,
    .tool-form select {
        padding: 0.875rem;
        font-size: 16px; /* Evita zoom no iOS */
    }
    
    .tool-result {
        padding: 1.5rem;
    }
    
    .resultado-principal {
        font-size: 2rem;
    }
    
    .resultado-label {
        font-size: 0.9375rem;
    }
    
    .resultado-detalhes {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .detalhe-item {
        padding: 1rem;
    }
    
    .detalhe-valor {
        font-size: 1.25rem;
    }
    
    .educacional {
        padding: 1.5rem;
    }
    
    .educacional h3 {
        font-size: 1.25rem;
    }
    
    .educacional-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-item {
        padding: 1.25rem;
    }
    
    /* Calculadoras específicas */
    .parcelas-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .parcelas-table table {
        min-width: 500px;
        font-size: 0.875rem;
    }
    
    .chart-container {
        height: 250px !important;
    }
    
    /* Tabs em mobile */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-button {
        min-width: 120px;
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .ferramenta-page .page-header {
        padding: 1.5rem 1rem;
    }
    
    .ferramenta-page .page-header h1 {
        font-size: 1.75rem;
    }
    
    .ferramenta-page .page-header p {
        font-size: 0.9375rem;
    }
    
    .tool-grid .card {
        padding: 1.25rem;
    }
    
    .tool-grid .card h2 {
        font-size: 1.375rem;
    }
    
    .tool-form input,
    .tool-form select {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .resultado-principal {
        font-size: 1.75rem;
    }
    
    .detalhe-valor {
        font-size: 1.125rem;
    }
    
    .educacional {
        padding: 1.25rem;
    }
    
    .educacional h3 {
        font-size: 1.125rem;
    }
    
    .info-item {
        padding: 1rem;
    }
    
    .info-item p {
        font-size: 1.125rem;
    }
}

/* Touch devices - melhor experiência */
@media (hover: none) and (pointer: coarse) {
    .tool-form input,
    .tool-form select,
    .tool-form textarea {
        min-height: 44px;
    }
    
    .btn {
        min-height: 44px;
    }
    
    .tab-button {
        min-height: 44px;
    }
}
