/* Amortization Calculator Specific Styles */

/* Results Summary */
.results-summary {
    animation: fadeInUp 0.6s ease-out;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 30px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.summary-item:hover {
    background: #f0f4ff;
    transform: translateY(-2px);
}

.summary-item.highlight {
    background: linear-gradient(135deg, #204080 0%, #1a3366 100%);
    color: white;
    grid-column: 1 / -1;
}

.summary-item.highlight:hover {
    background: linear-gradient(135deg, #1a3366 0%, #142a5c 100%);
}

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(32, 64, 128, 0.1);
    flex-shrink: 0;
}

.summary-item.highlight .summary-icon {
    background: rgba(255, 255, 255, 0.2);
}

.summary-icon i {
    font-size: 20px;
    color: #204080;
}

.summary-item.highlight .summary-icon i {
    color: white;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
}

.summary-item.highlight .summary-label {
    color: rgba(255, 255, 255, 0.8);
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
}

.summary-item.highlight .summary-value {
    color: white;
}

/* Amortization Table Section */
.amortization-table-section {
    margin-top: 40px;
    animation: fadeInUp 0.8s ease-out;
}

.table-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-secondary {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #666;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.btn-secondary.active {
    background: #204080;
    border-color: #204080;
    color: white;
}

.table-container {
    overflow-x: auto;
    margin: 0;
    border-radius: 0 0 20px 20px;
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.amortization-table thead {
    background: #f8f9ff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.amortization-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #e9ecef;
    white-space: nowrap;
}

.amortization-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.amortization-table tbody tr:hover {
    background: #f8f9ff;
}

.amortization-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.amortization-table tbody tr:nth-child(even):hover {
    background: #f0f4ff;
}

/* Table cell specific styling */
.amortization-table td:first-child {
    font-weight: 600;
    color: #204080;
}

.amortization-table td:nth-child(3),
.amortization-table td:nth-child(4),
.amortization-table td:nth-child(5),
.amortization-table td:nth-child(6) {
    text-align: right;
    font-family: 'Monaco', 'Menlo', monospace;
    font-weight: 500;
}

/* Highlight yearly rows */
.amortization-table .year-row {
    background: #e8f2ff !important;
    font-weight: 600;
}

.amortization-table .year-row:hover {
    background: #d4edff !important;
}

.amortization-table .year-row td:first-child {
    color: #1a3366;
}

/* Loading state */
.table-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.table-loading i {
    font-size: 24px;
    color: #204080;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
    display: block;
}

/* Responsive table */
@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px;
    }

    .summary-item.highlight {
        grid-column: 1;
    }

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

    .table-controls {
        justify-content: center;
        flex-wrap: wrap;
    }

    .amortization-table {
        font-size: 12px;
    }

    .amortization-table th,
    .amortization-table td {
        padding: 8px 6px;
    }

    .amortization-table th {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .summary-item {
        padding: 15px;
    }

    .summary-icon {
        width: 40px;
        height: 40px;
    }

    .summary-icon i {
        font-size: 16px;
    }

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

    .amortization-table {
        font-size: 11px;
    }

    .amortization-table th,
    .amortization-table td {
        padding: 6px 4px;
    }

    /* Stack table on very small screens */
    .amortization-table,
    .amortization-table thead,
    .amortization-table tbody,
    .amortization-table th,
    .amortization-table td,
    .amortization-table tr {
        display: block;
    }

    .amortization-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .amortization-table tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 8px;
        background: white;
    }

    .amortization-table td {
        border: none;
        position: relative;
        padding: 8px 8px 8px 35%;
        text-align: left !important;
    }

    .amortization-table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 30%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        color: #204080;
    }
}

/* Animation for table rows */
@keyframes fadeInRow {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.amortization-table tbody tr {
    animation: fadeInRow 0.3s ease-out;
}

/* Spin animation for loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print styles */
@media print {
    .table-controls,
    .card-header {
        display: none;
    }

    .amortization-table {
        font-size: 10px;
    }

    .amortization-table th,
    .amortization-table td {
        padding: 4px;
    }
}

/* Scrollbar styling for webkit browsers */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Info Section Styles */
.info-section {
    margin: 60px 0;
    padding: 50px 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.info-section h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.info-section h2 i {
    color: #204080;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 0 30px;
}

.info-card {
    background: #f8f9ff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(32, 64, 128, 0.1);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(32, 64, 128, 0.15);
}

.info-icon {
    width: 60px;
    height: 60px;
    background: #204080;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.info-icon i {
    font-size: 24px;
    color: white;
}

.info-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.info-card p {
    color: #666;
    line-height: 1.6;
    font-size: 15px;
}

/* Reading Guide */
.reading-guide {
    margin: 60px 0;
    padding: 50px 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-radius: 20px;
}

.reading-guide h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.reading-guide h2 i {
    color: #204080;
}

.guide-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 0 30px;
}

.guide-text h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.column-explanations {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.column-item {
    background: white;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #204080;
    font-size: 15px;
    line-height: 1.5;
}

.column-item strong {
    color: #204080;
}

.guide-visual {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.sample-payment h4 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    text-align: center;
}

.payment-visual {
    margin-bottom: 20px;
}

.payment-bar {
    display: flex;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.interest-portion {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.principal-portion {
    background: linear-gradient(135deg, #204080, #1a3366);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.payment-total {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.payment-note {
    font-size: 14px;
    color: #666;
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

/* Benefits Section */
.benefits-section {
    margin: 60px 0;
    padding: 50px 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.benefits-section h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.benefits-section h2 i {
    color: #204080;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 30px;
}

.benefit-item {
    background: #f8f9ff;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid rgba(32, 64, 128, 0.1);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(32, 64, 128, 0.15);
}

.benefit-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #204080, #1a3366);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.benefit-item h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.benefit-item p {
    color: #666;
    line-height: 1.6;
    font-size: 15px;
}

/* FAQ Section */
.faq-section {
    margin: 60px 0;
    padding: 50px 0;
    background: #f8f9fa;
    border-radius: 20px;
}

.faq-section h2 {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.faq-section h2 i {
    color: #204080;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 30px;
}

.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.faq-question {
    padding: 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(32, 64, 128, 0.05);
}

.faq-question h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.faq-question i {
    color: #204080;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 25px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 25px;
}

.faq-answer p {
    color: #666;
    line-height: 1.6;
    font-size: 15px;
    margin: 0;
}

/* Responsive adjustments for new content */
@media (max-width: 768px) {
    .guide-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .payment-bar {
        height: 40px;
    }

    .interest-portion,
    .principal-portion {
        font-size: 12px;
    }

    .column-item {
        font-size: 14px;
    }
}
