/* Custom styles for Amortization Calculator */
.card {
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
}

.bg-light {
    background-color: #f8f9fa !important;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.display-6 {
    font-size: 2.5rem;
    font-weight: 700;
}

.btn-group .btn.active {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.btn-outline-secondary.active {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.table th {
    font-weight: 600;
    color: #495057;
    border-top: none;
    font-size: 0.875rem;
}

.table td {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.alert {
    border-radius: 8px;
    border: none;
}

/* Custom chart styling */
#amortizationChart {
    max-height: 200px;
}

/* Sticky table header for scrollable table */
.sticky-top {
    position: sticky;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem !important;
    }
    
    .display-6 {
        font-size: 2rem;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table th, .table td {
        padding: 0.375rem 0.5rem;
    }
}

/* Animation for results */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#monthlyPayment, #totalPaymentAmount, #interestSavings {
    animation: fadeIn 0.5s ease-out;
}

/* Hover effects for buttons */
.btn-primary {
    transition: all 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
}

.btn-outline-secondary:hover:not(.active) {
    background-color: #f8f9fa;
}

/* Form switch customization */
.form-switch .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Table row striping */
.table tbody tr:nth-child(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Highlight interest and principal columns */
.table td:nth-child(5) { /* Principal column */
    color: #198754;
    font-weight: 500;
}

.table td:nth-child(6) { /* Interest column */
    color: #dc3545;
    font-weight: 500;
}

/* Payment status colors */
.payment-paid {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.payment-current {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

/* Export button styling */
#exportBtn {
    transition: all 0.2s ease;
}

#exportBtn:hover {
    background-color: #0d6efd;
    color: white;
}

/* Pagination styling */
#pageIndicator {
    min-width: 80px;
    pointer-events: none;
}

/* Chart container transition */
#chartContainer {
    transition: all 0.3s ease;
}

/* Yearly summary table styling */
#yearlySummaryTable tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Date input styling */
input[type="date"] {
    padding: 0.375rem 0.75rem;
}

/* Small screen adjustments */
@media (max-width: 576px) {
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}