/* Loan Calculator Pro Styles */
.loan-calculator-pro {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.calculator-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.calculator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.calculator-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.calculator-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.calculator-header i {
    margin-right: 10px;
}

.calculator-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 30px;
}

/* Input Section */
.input-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.input-card h3 {
    margin: 0 0 25px 0;
    color: #333;
    font-size: 1.3rem;
}

.input-card h3 i {
    color: #667eea;
    margin-right: 10px;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.input-with-slider {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-with-slider input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.input-with-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.input-with-slider input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.input-with-slider input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.calculate-button {
    width: 100%;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.calculate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.calculate-button:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    grid-column: 1 / -1;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
}

.emi-card {
    border-left: 4px solid #667eea;
}

.interest-card {
    border-left: 4px solid #ff6b6b;
}

.amount-card {
    border-left: 4px solid #4cd137;
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.emi-card .card-icon {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.interest-card .card-icon {
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
}

.amount-card .card-icon {
    background: rgba(76, 209, 55, 0.1);
    color: #4cd137;
}

.card-content {
    flex: 1;
}

.result-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.result-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

/* Graph Section */
.graph-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.graph-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.graph-tab {
    background: none;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
}

.graph-tab.active {
    background: #667eea;
    color: white;
}

.graph-tab:hover:not(.active) {
    background: #f8f9fa;
}

.graph-container {
    height: 300px;
    position: relative;
}

#loan-chart {
    width: 100% !important;
    height: 100% !important;
}

/* Amortization Section */
.amortization-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.amortization-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
}

.amortization-section h3 i {
    color: #667eea;
    margin-right: 10px;
}

.table-container {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.amortization-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #e9ecef;
    position: sticky;
    top: 0;
}

.amortization-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.amortization-table tbody tr:hover {
    background: #f8f9fa;
}

.amortization-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Responsive Design */
@media (max-width: 968px) {
    .calculator-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .loan-calculator-pro {
        padding: 10px;
    }
    
    .calculator-header {
        padding: 30px 20px;
    }
    
    .calculator-content {
        padding: 20px;
    }
    
    .graph-tabs {
        flex-direction: column;
    }
    
    .graph-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .calculator-header h1 {
        font-size: 1.5rem;
    }
    
    .result-card {
        flex-direction: column;
        text-align: center;
    }
    
    .amortization-table {
        font-size: 0.8rem;
    }
    
    .amortization-table th,
    .amortization-table td {
        padding: 8px 6px;
    }
}

/* Loading Animation */
.calculate-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.calculate-button.loading::after {
    content: ' Calculating...';
}

/* Animation Classes */
.results-section.show {
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}