/* Calculadora de Préstamos - Diseño Moderno con Verde Corporativo */

.loan-calculator-modern {
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.loan-calculator-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 204, 0, 0.02) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.5;
    }
}

.calculator-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.calculator-header {
    text-align: center;
    margin-bottom: 50px;
}

.calculator-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}

.calculator-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}

/* Panel de Inputs */
.calculator-inputs {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.input-group-modern {
    margin-bottom: 25px;
}

.input-label-modern {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Inputs Modernos */
.input-modern {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 204, 0, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.input-modern:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(0, 204, 0, 0.5);
}

.input-modern:focus {
    background: rgba(0, 0, 0, 0.9);
    border-color: #00cc00;
    box-shadow: 0 0 15px rgba(0, 204, 0, 0.3);
}

.input-modern::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Selectores Modernos */
.select-modern {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 204, 0, 0.3);
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.select-modern:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: rgba(0, 204, 0, 0.5);
}

.select-modern:focus {
    background: rgba(0, 0, 0, 0.9);
    border-color: #00cc00;
    box-shadow: 0 0 15px rgba(0, 204, 0, 0.3);
}

.select-modern option {
    background: #0a0a0a;
    color: #fff;
}

/* Panel de Resultados */
.calculator-results {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-title {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.main-payment {
    text-align: center;
    padding: 25px;
    background: linear-gradient(135deg, rgba(0, 204, 0, 0.08), rgba(0, 153, 0, 0.04));
    border-radius: 15px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 204, 0, 0.2);
}

.payment-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.payment-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #00cc00;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(0, 204, 0, 0.3);
    }

    50% {
        text-shadow: 0 0 20px rgba(0, 204, 0, 0.5);
    }
}

.payment-frequency {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Tarjetas de Información */
.info-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.info-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.3s ease;
}

.info-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.info-card-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-card-value {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
}

.info-card-icon {
    color: #00cc00;
    font-size: 1rem;
}

/* Gráfico de Distribución */
.distribution-chart {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
}

.chart-bar {
    display: flex;
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.chart-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.5s ease;
}

.chart-segment.capital {
    background: linear-gradient(90deg, #00cc00, #33cc33);
}

.chart-segment.interest {
    background: linear-gradient(90deg, #ff9500, #ff6b00);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 25px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.capital {
    background: linear-gradient(135deg, #00cc00, #33cc33);
}

.legend-color.interest {
    background: linear-gradient(135deg, #ff9500, #ff6b00);
}

/* Botón de Acción */
.action-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #00cc00, #33cc33);
    border: none;
    border-radius: 12px;
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 204, 0, 0.2);
    margin-top: 20px;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 204, 0, 0.3);
}

.action-button:active {
    transform: translateY(0);
}

/* Tabla de Amortización Compacta */
.amortization-section {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.amortization-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.amortization-title {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
}

.toggle-table-btn {
    padding: 8px 16px;
    background: rgba(0, 204, 0, 0.08);
    border: 1px solid rgba(0, 204, 0, 0.2);
    border-radius: 8px;
    color: #00cc00;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-table-btn:hover {
    background: rgba(0, 204, 0, 0.15);
    border-color: #00cc00;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 10px;
    font-size: 0.8rem;
}

.table-modern thead {
    background: rgba(0, 204, 0, 0.08);
}

.table-modern th {
    padding: 10px 8px;
    color: #00cc00;
    font-weight: 700;
    font-size: 0.75rem;
    text-align: center;
    border-bottom: 2px solid rgba(0, 204, 0, 0.2);
    white-space: nowrap;
}

.table-modern tbody tr {
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.table-modern tbody tr:hover {
    background: rgba(0, 204, 0, 0.04);
}

.table-modern tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.04);
}

.table-modern tbody tr:nth-child(even):hover {
    background: rgba(0, 204, 0, 0.04);
}

.table-modern td {
    padding: 8px 6px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.75rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
    font-weight: 600;
    color: #00cc00;
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .calculator-title {
        font-size: 2rem;
    }

    .payment-amount {
        font-size: 2rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    .calculator-inputs,
    .calculator-results,
    .amortization-section {
        padding: 20px;
    }

    .table-modern {
        font-size: 0.7rem;
    }

    .table-modern th,
    .table-modern td {
        padding: 6px 4px;
        font-size: 0.65rem;
    }

    .amortization-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

/* Loading State */
.calculating {
    opacity: 0.6;
    pointer-events: none;
}

.calculating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 204, 0, 0.2);
    border-top-color: #00cc00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}