/* Amortization Calculator Styles */

.amort-calc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.amort-calc-header {
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.amort-calc-header h2 {
    margin: 0 0 10px 0;
    font-size: 32px;
    font-weight: 700;
}

.amort-calc-header p {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
    font-weight: 300;
}

.amort-calc-wrapper {
    background: white;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Input Section */
.amort-calc-inputs {
    background: linear-gradient(to bottom, #f8f9ff 0%, #f5f7ff 100%);
    padding: 35px;
    border-bottom: 2px solid #e8ebff;
}

.input-group {
    margin-bottom: 25px;
}

.input-group:last-of-type {
    margin-bottom: 10px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group small {
    display: block;
    margin-top: 6px;
    color: #999;
    font-size: 12px;
}

.input-with-icon {
    display: flex;
    align-items: center;
    position: relative;
}

.input-with-icon input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    color: #333;
}

.input-with-icon input::placeholder {
    color: #ccc;
    font-weight: 400;
}

.input-with-icon input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.currency-icon,
.rate-icon {
    display: none;
}

.amort-calc-inputs input[type="number"],
.amort-calc-inputs select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.amort-calc-inputs input[type="number"]:focus,
.amort-calc-inputs select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amort-btn-calculate {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.amort-btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.amort-btn-calculate:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 18px;
}

/* Results Section */
.amort-calc-results {
    padding: 35px;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.button-group .amort-btn-download,
.button-group .amort-btn-reset {
    flex: 1;
    min-width: 160px;
    padding: 12px 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.amort-btn-reset {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.amort-btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.amort-btn-reset:active {
    transform: translateY(0);
}

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

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    border-radius: 10px;
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.summary-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
}

/* Charts */
.amort-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.chart-container {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
}

.chart-container h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.chart-container canvas {
    max-height: 350px;
}

/* Table */
.amort-table-container {
    margin-top: 40px;
    border-top: 2px solid #e8ebff;
    padding-top: 40px;
}

.amort-table-container h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #e8ebff;
}

.amort-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.amort-schedule-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.amort-schedule-table th {
    padding: 15px;
    text-align: right;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.amort-schedule-table th:first-child {
    text-align: left;
}

.amort-schedule-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.amort-schedule-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: #667eea;
}

.amort-schedule-table tbody tr:hover {
    background: #f9f9f9;
}

.amort-schedule-table tbody tr:nth-child(even) {
    background: #fafbff;
}

/* Download Button */
.amort-btn-download {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.amort-btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Loading Spinner */
.amort-loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.amort-loading p {
    color: #667eea;
    font-weight: 600;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .amort-calc-container {
        padding: 10px;
    }

    .amort-calc-inputs,
    .amort-calc-results {
        padding: 20px;
    }

    .amort-calc-header {
        padding: 30px 20px;
    }

    .amort-calc-header h2 {
        font-size: 24px;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group .amort-btn-download,
    .button-group .amort-btn-reset {
        width: 100%;
        min-width: unset;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }

    .amort-charts {
        grid-template-columns: 1fr;
    }

    .summary-value {
        font-size: 24px;
    }

    .amort-schedule-table {
        font-size: 12px;
    }

    .amort-schedule-table th,
    .amort-schedule-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .amort-calc-inputs {
        padding: 15px;
    }

    .input-group {
        margin-bottom: 18px;
    }

    .amort-calc-header h2 {
        font-size: 20px;
    }

    .summary-value {
        font-size: 20px;
    }

    .button-group {
        flex-direction: column;
        gap: 10px;
    }

    .button-group .amort-btn-download,
    .button-group .amort-btn-reset {
        width: 100%;
        font-size: 13px;
        padding: 10px 16px;
    }
}
