/* Calculadora de Amortización - Estilos Compactos y Alineados */

.calculadora-section {
    padding: 30px 0;
    background: #f5f7fa;
}

.calculadora-header {
    text-align: center;
    padding: 0 40px 25px;
    background: transparent;
}

.calculadora-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.title-underline {
    width: 70px;
    height: 3px;
    background: #B8860B;
    margin: 0 auto;
}

.calculadora-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Panel de Inputs Compacto */
.calculadora-inputs {
    background: #f8f9fa;
    padding: 30px 35px;
    border-right: 1px solid #eaeaea;
}

.calc-field {
    margin-bottom: 20px;
}

.calc-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.info-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #B8860B;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.info-btn:hover {
    background: #8B6914;
    transform: scale(1.1);
}

/* Fila compacta con input y slider */
.calc-row {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    flex-shrink: 0;
}

.input-with-select {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    flex-shrink: 0;
}

.calc-input {
    width: 90px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
    color: #333;
}

.calc-input-small {
    width: 60px;
    padding: 10px 8px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
    color: #333;
}

.calc-input:focus, .calc-input-small:focus {
    outline: none;
    border-color: #B8860B;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.1);
}

.calc-select {
    padding: 10px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    color: #333;
    min-width: 90px;
}

.calc-select:focus {
    outline: none;
    border-color: #B8860B;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.1);
}

.input-suffix {
    font-size: 0.95rem;
    font-weight: 700;
    color: #555;
    min-width: 25px;
}

/* Slider compacto alineado a la derecha */
.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.slider-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    min-width: 45px;
}

.calc-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
    transition: background 0.3s ease;
    min-width: 150px;
}

.calc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #B8860B;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.calc-slider::-webkit-slider-thumb:hover {
    background: #8B6914;
    transform: scale(1.1);
}

.calc-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #B8860B;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.calc-slider::-moz-range-thumb:hover {
    background: #8B6914;
    transform: scale(1.1);
}

/* Mensajes de Error */
.error-message {
    color: #dc3545;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 5px;
    min-height: 16px;
    text-align: center;
}

/* Botón Calcular Compacto */
.calc-button-container {
    text-align: center;
    margin-top: 25px;
}

.btn-calcular {
    padding: 12px 45px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    background: #B8860B;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(184, 134, 11, 0.3);
}

.btn-calcular:hover {
    background: #8B6914;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.4);
}

.btn-calcular:active {
    transform: translateY(0);
}

/* Panel de Resultados Compacto */
.calculadora-resultados {
    background: linear-gradient(135deg, #B8860B 0%, #8B6914 100%);
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: white;
}

.resultado-item {
    margin-bottom: 20px;
}

.resultado-item:last-child {
    margin-bottom: 0;
}

.resultado-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resultado-subtitulo {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resultado-valor-box {
    background: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.resultado-valor-box span {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    display: block;
}

/* Línea divisoria sutil */
.resultado-item:not(:last-child)::after {
    content: '';
    display: block;
    width: 70%;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 15px auto 0;
}

/* Tooltip Modal Compacto */
.tooltip-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.tooltip-modal.active {
    display: flex;
}

.tooltip-content {
    background: white;
    padding: 25px 30px;
    border-radius: 10px;
    max-width: 450px;
    margin: 20px;
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.tooltip-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    line-height: 1;
}

.tooltip-close:hover {
    color: #B8860B;
}

#tooltip-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #B8860B;
    margin-bottom: 10px;
    text-align: center;
}

#tooltip-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #666;
    text-align: center;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 1200px) {
    .calculadora-wrapper {
        max-width: 95%;
    }
    
    .calculadora-inputs,
    .calculadora-resultados {
        padding: 25px 30px;
    }
}

@media (max-width: 968px) {
    .calculadora-wrapper {
        grid-template-columns: 1fr;
        max-width: 600px;
    }

    .calculadora-inputs {
        padding: 25px 30px;
        border-right: none;
        border-bottom: 2px solid #B8860B;
    }

    .calculadora-resultados {
        padding: 25px 30px;
    }

    .calculadora-title {
        font-size: 1.3rem;
    }

    .calc-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .input-with-suffix,
    .input-with-select {
        justify-content: center;
    }

    .slider-container {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 600px) {
    .calculadora-section {
        padding: 20px 0;
    }
    
    .calculadora-inputs,
    .calculadora-resultados {
        padding: 20px 25px;
    }

    .calculadora-header {
        padding: 0 25px 20px;
    }

    .calculadora-title {
        font-size: 1.2rem;
    }

    .resultado-valor-box span {
        font-size: 1.3rem;
    }

    .btn-calcular {
        padding: 10px 35px;
        font-size: 1rem;
    }

    .calc-label {
        font-size: 0.9rem;
    }
    
    .calc-input {
        width: 80px;
        padding: 8px 10px;
    }
    
    .calc-input-small {
        width: 50px;
        padding: 8px 6px;
    }
    
    .slider-container {
        gap: 8px;
    }
    
    .slider-label {
        font-size: 0.75rem;
        min-width: 35px;
    }
}