/* ===== VARIABLES & ROOT STYLES ===== */
:root {
    --primary: #3b82f6;
    --secondary: #10b981;
    --accent: #8b5cf6;
    --dark: #1f2937;
    --light: #f9fafb;
}

/* ===== BASE STYLES ===== */
body {
    font-family: "Inter", sans-serif;
}

/* ===== UTILITY CLASSES ===== */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-shadow {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
/* Chart Styles */
.chart-container {
    position: relative;
    height: 400px; /* Increased height for better visibility */
    width: 100%;
    overflow: hidden;
}

.chart-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.chart-wrapper.active {
    display: block;
}

/* Ensure canvas takes full container */
.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chart toggle buttons */
.chart-toggle-btn {
    transition: all 0.3s ease;
}

.chart-toggle-btn.active {
    background-color: #3b82f6 !important;
    color: white !important;
}

.chart-toggle-btn:hover:not(.active) {
    background-color: #e5e7eb !important;
    transform: translateY(-1px);
}

/* ===== SLIDER STYLES ===== */
.slider-thumb::-webkit-slider-thumb {
    appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.slider-thumb::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ===== AMORTIZATION SCHEDULE STYLES ===== */
.year-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.year-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.year-header {
    cursor: pointer;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border-bottom: 1px solid #e5e7eb;
}

.year-header:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* FIX: Use .hidden class instead of .open */
.year-content {
    display: none;
    padding: 0;
}

.year-content:not(.hidden) {
    display: block;
}

/* Alternative approach - if you want to keep using .hidden */
.year-content.hidden {
    display: none;
}

.year-content:not(.hidden) {
    display: block;
}

.chevron {
    transition: transform 0.3s ease;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* ===== LOAN TYPE STYLES ===== */
.loan-type-integrated {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.loan-types-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.loan-type-card-integrated {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 0.5rem;
    border-radius: 0.5rem;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}

.loan-type-card-integrated:hover {
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(59, 130, 246, 0.15);
}

.loan-type-card-integrated.active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    box-shadow: 0 8px 15px -3px rgba(59, 130, 246, 0.2);
}

.loan-type-card-integrated.active::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 20px 20px 0;
    border-color: transparent #3b82f6 transparent transparent;
}

.loan-type-card-integrated.active::after {
    content: "✓";
    position: absolute;
    top: 2px;
    right: 2px;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
}

.loan-icon-integrated {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.loan-type-card-integrated.active .loan-icon-integrated {
    transform: scale(1.1);
}

.loan-icon-integrated.home {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.loan-icon-integrated.car {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.loan-icon-integrated.personal {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.loan-icon-integrated.education {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
}

.loan-icon-integrated.business {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
}

.loan-icon-integrated.custom {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
}

.loan-name-integrated {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.75rem;
    line-height: 1.2;
}

.loan-type-card-integrated.active .loan-name-integrated {
    color: #1e40af;
    font-weight: 700;
}

.loan-details-integrated {
    font-size: 0.6rem;
    color: #64748b;
    margin-top: 0.2rem;
    line-height: 1.2;
}

/* ===== NAVIGATION STYLES ===== */
.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    transition: all 0.3s;
    font-weight: 500;
    text-transform: none;
    letter-spacing: -0.01em;
}

.nav-link:hover {
    color: #3b82f6;
}

.nav-link.active {
    color: #3b82f6;
    font-weight: 600;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background-color: #3b82f6;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 50;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #4b5563;
    transition: all 0.2s;
    font-weight: 400;
    text-transform: none;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    color: #3b82f6;
}

/* ===== INPUT & FORM STYLES ===== */
.slider-input-container {
    position: relative;
    margin-bottom: 1rem;
}

.slider-input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.slider-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.slider-input {
    width: 100px;
    text-align: right;
    padding: 0.35rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    background: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.slider-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.slider-input-prefix {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}

.slider-input-suffix {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

.current-value-display {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #3b82f6;
}

/* ===== AFFORDABILITY COLOR CODING ===== */
.affordability-excellent {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #22c55e;
    color: #166534;
}

.affordability-comfortable {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-color: #3b82f6;
    color: #1e40af;
}

.affordability-moderate {
    background: linear-gradient(135deg, #fefce8, #fef9c3);
    border-color: #eab308;
    color: #854d0e;
}

.affordability-risky {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    border-color: #ef4444;
    color: #991b1b;
}

/* Affordability score display colors */
.score-excellent {
    color: #16a34a;
}

.score-comfortable {
    color: #2563eb;
}

.score-moderate {
    color: #d97706;
}

.score-risky {
    color: #dc2626;
}

/* ===== AFFORDABILITY PANEL BACKGROUNDS ===== */
.affordability-panel-excellent {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-left: 4px solid #22c55e;
}

.affordability-panel-comfortable {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-left: 4px solid #3b82f6;
}

.affordability-panel-moderate {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
}

.affordability-panel-risky {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    border-left: 4px solid #ef4444;
}

/* Smooth transitions for panel changes */
.affordability-section {
    transition: all 0.5s ease-in-out;
}

/* Status icon colors */
.affordability-status-excellent .fas {
    color: #16a34a;
}

.affordability-status-comfortable .fas {
    color: #2563eb;
}

.affordability-status-moderate .fas {
    color: #d97706;
}

.affordability-status-risky .fas {
    color: #dc2626;
}

/* Update the existing affordability-meter style */
.affordability-meter {
    transition: all 0.5s ease-in-out;
    height: 8px;
    border-radius: 4px;
}

.emi-ratio-bar,
.debt-ratio-bar {
    transition: all 0.3s ease;
}
/*-------------------*/
/* ===== AFFORDABILITY SCORE SECTION COLORS ===== */
#affordability-score-section.affordability-score-section-excellent {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border: 1px solid #bbf7d0 !important;
    border-left: 4px solid #22c55e !important;
}

#affordability-score-section.affordability-score-section-comfortable {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border: 1px solid #bae6fd !important;
    border-left: 4px solid #3b82f6 !important;
}

#affordability-score-section.affordability-score-section-moderate {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
    border: 1px solid #fde68a !important;
    border-left: 4px solid #f59e0b !important;
}

#affordability-score-section.affordability-score-section-risky {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%) !important;
    border: 1px solid #fca5a5 !important;
    border-left: 4px solid #ef4444 !important;
}

/* Meter colors */
.affordability-meter-excellent { background: #10b981 !important; }
.affordability-meter-comfortable { background: #3b82f6 !important; }
.affordability-meter-moderate { background: #f59e0b !important; }
.affordability-meter-risky { background: #ef4444 !important; }

/* Animation for score section changes */
.score-section-change {
    animation: score-section-pulse 2s ease-in-out;
}

@keyframes score-section-pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.01);
    }
}

.panel-score-change {
    animation: panel-pulse 2s ease-in-out;
}
@keyframes panel-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }
    50% {
        transform: scale(1.002);
        box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.15);
    }
}

/**********/
/* Optimization Impact Modal Styles */
.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Button Animation Styles */
.change-highlight {
    animation: pulse-change 2s ease-in-out;
}

.reset-highlight {
    animation: reset-glow 1s ease-in-out;
}

@keyframes reset-glow {
    0%,
    100% {
        background-color: white;
        border-color: #d1d5db;
    }
    50% {
        background-color: #f0f9ff;
        border-color: #3b82f6;
    }
}

/* Responsive affordability styles */
@media (max-width: 768px) {
    .affordability-panel {
        padding: 1rem;
    }

    .affordability-score-display {
        font-size: 1.5rem;
    }
}

.score-improvement {
    animation: score-bounce 0.6s ease-in-out;
}

@keyframes score-bounce {
    0%,
    20%,
    60%,
    100% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.2);
    }
    80% {
        transform: scale(1.1);
    }
}

.emi-improvement {
    animation: emi-drop 0.8s ease-out;
}

.emi-old-price {
    font-size: 0.9em;
}

.emi-new-price {
    font-size: 1.1em;
}

@keyframes emi-drop {
    0% {
        transform: translateY(-10px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.section-improvement {
    animation: section-pulse 2s ease-in-out;
}

@keyframes section-pulse {
    0%,
    100% {
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 20px 40px -5px rgba(34, 197, 94, 0.3);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Button hover effects */
#optimize-loan,
#reset-affordability {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#optimize-loan:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#reset-affordability:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* Loading state */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
/* ===== YEAR STATS STYLES ===== */
.year-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    margin-right: 1rem;
}

.year-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.year-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    font-weight: 400;
}

.compact-stats {
    display: flex;
    gap: 1.5rem;
}

.compact-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.compact-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
}

.compact-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.compact-percentage {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.1rem;
}

.year-summary {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.summary-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.75rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border-top: 3px solid #3b82f6;
}

.summary-item.principal {
    border-top-color: #10b981;
}

.summary-item.interest {
    border-top-color: #f59e0b;
}

.summary-item.balance {
    border-top-color: #8b5cf6;
}

.summary-item.opening-balance {
    border-top-color: #3b82f6;
}

.summary-item.principal-paid {
    border-top-color: #10b981;
}

.summary-item.interest-paid {
    border-top-color: #f59e0b;
}

.summary-item.closing-balance {
    border-top-color: #8b5cf6;
}

.summary-icon {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #64748b;
}

.summary-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.summary-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.summary-percentage {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* ===== AMORTIZATION TABLE HEADER REDESIGN ===== */
.amortization-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: separate;
    border-spacing: 0;
}

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

.amortization-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    position: relative;
    white-space: nowrap;
}

.amortization-table th:last-child {
    border-right: none;
}

/* Compact column headers with icons */
.amortization-table th:nth-child(1)::before { /* Month */
    content: "📅";
    margin-right: 4px;
    font-size: 0.6rem;
}

.amortization-table th:nth-child(2)::before { /* Opening */
    content: "🏦";
    margin-right: 4px;
    font-size: 0.6rem;
}

.amortization-table th:nth-child(3)::before { /* EMI */
    content: "💰";
    margin-right: 4px;
    font-size: 0.6rem;
}

.amortization-table th:nth-child(4)::before { /* Principal */
    content: "📈";
    margin-right: 4px;
    font-size: 0.6rem;
}

.amortization-table th:nth-child(5)::before { /* Interest */
    content: "📉";
    margin-right: 4px;
    font-size: 0.6rem;
}

.amortization-table th:nth-child(6)::before { /* Part Payment */
    content: "⚡";
    margin-right: 4px;
    font-size: 0.6rem;
}

.amortization-table th:nth-child(7)::before { /* Closing */
    content: "🎯";
    margin-right: 4px;
    font-size: 0.6rem;
}

.amortization-table th:nth-child(8)::before { /* Extra Payment */
    content: "✨";
    margin-right: 4px;
    font-size: 0.6rem;
}

.amortization-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    vertical-align: middle;
}

.amortization-table td:last-child {
    border-right: none;
}

.amortization-table tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f0f9ff 100%);
}

/* ===== PART PAYMENT COLUMN REDESIGN ===== */
.part-payment-cell {
    position: relative;
    min-width: 100px;
}

.part-payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    color: #1e40af;
    border: 1px solid #bfdbfe;
    transition: all 0.3s ease;
}

.part-payment-badge.has-payment {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border-color: #86efac;
    animation: payment-pulse 2s ease-in-out;
}

.part-payment-badge .payment-icon {
    font-size: 0.6rem;
}

.part-payment-date {
    font-size: 0.6rem;
    color: #6b7280;
    margin-top: 2px;
    display: block;
    font-style: italic;
}

@keyframes payment-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===== ACTION BUTTONS REDESIGN ===== */
.payment-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.part-payment-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
    background: white;
    color: #4b5563;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 60px;
    justify-content: center;
}

.part-payment-btn:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
    border-color: #3b82f6;
}

.part-payment-btn.has-payment {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #3b82f6;
}

.remove-part-payment-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid #fecaca;
    background: white;
    color: #dc2626;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 70px;
    justify-content: center;
}

.remove-part-payment-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* ===== COMPACT TABLE LAYOUT ===== */
.compact-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.header-tooltip {
    position: relative;
    cursor: help;
}

.header-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.header-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    margin-bottom: -5px;
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 1024px) {
    .amortization-table {
        font-size: 0.7rem;
    }
    
    .amortization-table th,
    .amortization-table td {
        padding: 0.5rem 0.35rem;
    }
    
    .amortization-table th::before {
        margin-right: 2px;
        font-size: 0.55rem;
    }
    
    .part-payment-btn,
    .remove-part-payment-btn {
        padding: 4px 6px;
        font-size: 0.6rem;
        min-width: 50px;
    }
}

@media (max-width: 768px) {
    .amortization-table-container {
        overflow-x: auto;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .amortization-table {
        min-width: 800px;
    }
    
    .payment-actions {
        flex-direction: column;
        gap: 2px;
    }
    
    .part-payment-btn,
    .remove-part-payment-btn {
        min-width: 45px;
        padding: 3px 5px;
        font-size: 0.55rem;
    }
}

/* ===== VISUAL ENHANCEMENTS ===== */
.month-highlight {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-left: 3px solid #3b82f6;
    position: relative;
}

.month-highlight::before {
    content: "📍";
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
}

/* Color coding for financial data */
.principal-amount {
    color: #059669;
    font-weight: 600;
}

.interest-amount {
    color: #dc2626;
    font-weight: 600;
}

.balance-amount {
    color: #7c3aed;
    font-weight: 600;
}

/* Hover effects for better interaction */
.amortization-table tr {
    transition: all 0.2s ease;
}

.amortization-table tr:hover {
    transform: translateX(2px);
    box-shadow: inset 4px 0 0 #3b82f6;
}

/* ===== YEAR HEADER IMPROVEMENTS ===== */
.year-header {
    cursor: pointer;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.year-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.year-header:hover::after {
    transform: scaleX(1);
}

.year-stats {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.year-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.year-stat-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
}

.year-stat-label {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 2px;
}

/* ===== PRINT OPTIMIZATIONS ===== */
@media print {
    .amortization-table th {
        background: #f8fafc !important;
        color: #000 !important;
    }
    
    .part-payment-btn,
    .remove-part-payment-btn {
        display: none !important;
    }
    
    .amortization-table {
        font-size: 8pt;
    }
}


/* Part Payment Modal Styles */
.animate-scale-in {
    animation: scaleIn 0.2s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}



/* Year card enhancements */


.year-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
}

.compact-stats {
    display: flex;
    gap: 1rem;
}

.compact-stat {
    text-align: center;
    padding: 0.5rem;
}

.compact-value {
    font-weight: 600;
    font-size: 0.875rem;
}

.compact-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.compact-percentage {
    font-size: 0.75rem;
    color: #059669;
    font-weight: 500;
}

/* Animation Styles */
.animate-bounce-in {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.3);
    }
    50% {
        opacity: 1;
        transform: translateY(0) scale(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Part Payment Impact Animation */
.part-payment-impact {
    animation: pulse-glow 2s ease-in-out;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* ===== GEARSKIT LOGO STYLES ===== */
.gearskit-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: "Inter", -apple-system, sans-serif;
    padding: 6px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modular-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 4px;
    width: 100%;
    height: 100%;
    padding: 3px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8),
        0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
}

.modular-grid:before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 11px;
    z-index: -1;
    opacity: 0.3;
}

.module {
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid transparent;
}

.module-icon {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
    line-height: 1;
}

.module-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 6px;
}

/* Module-specific colors */
.module-calc {
    border-color: rgba(59, 130, 246, 0.25);
}

.module-calc .module-glow {
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.08),
        rgba(59, 130, 246, 0.15)
    );
}

.module-money {
    border-color: rgba(34, 197, 94, 0.25);
}

.module-money .module-glow {
    background: linear-gradient(
        135deg,
        rgba(34, 197, 94, 0.08),
        rgba(34, 197, 94, 0.15)
    );
}

.module-chart {
    border-color: rgba(245, 158, 11, 0.25);
}

.module-chart .module-glow {
    background: linear-gradient(
        135deg,
        rgba(245, 158, 11, 0.08),
        rgba(245, 158, 11, 0.15)
    );
}

.module-time {
    border-color: rgba(168, 85, 247, 0.25);
}

.module-time .module-glow {
    background: linear-gradient(
        135deg,
        rgba(168, 85, 247, 0.08),
        rgba(168, 85, 247, 0.15)
    );
}

/* Logo Text */
.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
    position: relative;
    white-space: nowrap;
}

.logo-text:before {
    content: "GearsKit";
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Interactive Effects */
.gearskit-logo:hover .module {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.gearskit-logo:hover .module-icon {
    transform: scale(1.1);
}

.gearskit-logo:hover .module-glow {
    opacity: 1;
}

.gearskit-logo:hover .logo-text:before {
    opacity: 1;
}

/* Module-specific hover effects */
.gearskit-logo:hover .module-calc {
    border-color: rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
}

.gearskit-logo:hover .module-money {
    border-color: rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.gearskit-logo:hover .module-chart {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #fef7cd, #fef3c7);
}

.gearskit-logo:hover .module-time {
    border-color: rgba(168, 85, 247, 0.4);
    background: linear-gradient(135deg, #f3e8ff, #e9d5ff);
}

/* Animation for module connection */
@keyframes module-connect {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
    100% {
        transform: scale(1);
    }
}

.gearskit-logo:hover .module {
    animation: module-connect 0.4s ease;
}

.gearskit-logo:hover .module:nth-child(1) {
    animation-delay: 0s;
}
.gearskit-logo:hover .module:nth-child(2) {
    animation-delay: 0.05s;
}
.gearskit-logo:hover .module:nth-child(3) {
    animation-delay: 0.1s;
}
.gearskit-logo:hover .module:nth-child(4) {
    animation-delay: 0.15s;
}

/* ===== FOOTER STYLES ===== */
.footer-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.footer-icon:hover {
    transform: translateY(-3px) rotate(5deg);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.3);
}

.newsletter-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: white;
    transition: all 0.3s ease;
}

.newsletter-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #3b82f6;
    outline: none;
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
    .compact-stats {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .compact-stat {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .compact-value {
        font-size: 0.8rem;
    }

    .compact-label {
        margin-top: 0;
        font-size: 0.75rem;
    }

    .year-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .year-summary {
        flex-direction: column;
        gap: 0.75rem;
    }

    /* Compact Table Styles */

    .slider-input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .slider-input-wrapper {
        width: 100%;
        justify-content: flex-end;
    }

    .gearskit-logo {
        gap: 10px;
    }

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

    .module-icon {
        font-size: 10px;
    }

    .logo-text {
        font-size: 18px;
    }

    .modular-grid {
        gap: 3px;
        padding: 2px;
        border-radius: 8px;
    }
}

@media (min-width: 640px) {
    .loan-types-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Responsive Design */
@media (max-width: 768px) {
    .amortization-table {
        font-size: 0.7rem;
    }
    
    .amortization-table th,
    .amortization-table td {
        padding: 0.25rem;
    }
    
    .compact-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}
/* ===== PRINT STYLES ===== */
@media print {
    .no-print {
        display: none !important;
    }

    .card-shadow {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .year-content.open {
        display: block !important;
    }
}

/* ===== CHART TOGGLE BUTTONS ===== */
.chart-toggle-btn.active {
    background-color: #3b82f6;
    color: white;
}

/* ===== SMART SUGGESTIONS STYLE ===== */
.recommendation-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.recommendation-card .text-2xs {
    font-size: 0.5rem;
}

/* Priority badges */
.priority-high {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.priority-medium {
    background-color: #fffbeb;
    border-color: #fed7aa;
    color: #ea580c;
}

.priority-low {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #16a34a;
}

/* Smooth animations */
.recommendation-card {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for multiple cards */
.recommendation-card:nth-child(1) {
    animation-delay: 0.1s;
}
.recommendation-card:nth-child(2) {
    animation-delay: 0.2s;
}
.recommendation-card:nth-child(3) {
    animation-delay: 0.3s;
}
.recommendation-card:nth-child(4) {
    animation-delay: 0.4s;
}
.recommendation-card:nth-child(5) {
    animation-delay: 0.5s;
}
