/* Custom styles for Interest Rate 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.75rem 0.75rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.alert {
    border-radius: 8px;
    border: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem !important;
    }
    
    .display-6 {
        font-size: 2rem;
    }
    
    .btn-group {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .btn-group .btn {
        flex: 1;
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
}

/* Animation for results */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#calculatedRate, #calculatedLoanAmount {
    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);
}

/* Rate indicator colors */
.text-danger {
    color: #dc3545 !important;
}

.text-success {
    color: #198754 !important;
}

.text-warning {
    color: #ffc107 !important;
}

/* Rate comparison styling */
#rateComparison {
    color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.rate-higher {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.rate-lower {
    color: #198754;
    background-color: rgba(25, 135, 84, 0.1);
}

/* Market rates table styling */
.market-rate-good {
    color: #198754;
    font-weight: 500;
}

.market-rate-average {
    color: #ffc107;
    font-weight: 500;
}

.market-rate-high {
    color: #dc3545;
    font-weight: 500;
}

/* Modal styling */
.modal-content {
    border-radius: 12px;
    border: none;
}

/* Tab content transitions */
#interestRateCalculatorTab, #loanAmountCalculatorTab {
    transition: opacity 0.3s ease;
}

/* Progress bar for DTI ratio */
.progress {
    height: 10px;
    border-radius: 5px;
}

.progress-bar {
    border-radius: 5px;
}

/* List group customization for affordability */
.list-group-item {
    border: none;
    padding: 0.5rem 0;
}

/* Amortization schedule styling */
.amortization-row-current {
    background-color: rgba(13, 110, 253, 0.1) !important;
    border-left: 4px solid #0d6efd;
}

/* 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;
    }
    
    .input-group .btn {
        padding: 0.375rem 0.75rem;
    }
}

/* Loading animation */
.spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

/* Rate tips styling */
.rate-tip {
    padding: 1rem;
    border-left: 4px solid #0d6efd;
    background-color: #f8f9fa;
    margin-bottom: 1rem;
    border-radius: 0 8px 8px 0;
}

/* Interest rate visual indicator */
.rate-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.rate-low {
    background-color: #198754;
}

.rate-medium {
    background-color: #ffc107;
}

.rate-high {
    background-color: #dc3545;
}

/* Highlight important rate numbers */
.highlight-rate-number {
    font-weight: 700;
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

/* Payment breakdown styling */
.payment-breakdown {
    border-left: 4px solid #198754;
    padding-left: 1rem;
    margin-bottom: 1rem;
}