:root {
    --primary: #4F46E5;
    --primary-light: #6366F1;
    --primary-dark: #3730A3;
    --accent: #10B981;
    --text-main: #111827;
    --text-muted: #4B5563;
    --bg-body: #F9FAFB;
    --border-color: #E5E7EB;
    --card-bg: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-main);
}

.logo-icon {
    background: var(--text-main);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
}

.search-form {
    flex: 0 1 400px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-size: 14px;
    background: #F3F4F6;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    gap: 8px;
    padding: 1.5rem 0;
    font-size: 14px;
    color: var(--text-muted);
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

/* Main Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

/* EMI Card */
.emi-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 2.5rem;
    margin-bottom: 2rem;
}

.emi-card h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 2rem;
}

.emi-section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.calc-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-box {
    position: relative;
}

.input-box label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-light);
    font-size: 18px;
}

.emi-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

.btn-emi {
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
    width: 100%;
    margin-top: 1.5rem;
}

.btn-emi:active {
    transform: scale(0.98);
}

/* EMI Results */
.emi-results {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.res-main {
    flex: 1;
}

.res-label {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-dark);
}

.res-sub {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.res-chart {
    width: 150px;
    height: 150px;
    position: relative;
}

/* Sidebar */
.sidebar-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.sidebar-list {
    list-style: none;
    margin-bottom: 3rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

.sidebar-item:hover {
    color: var(--primary);
}

.item-icon {
    width: 32px;
    height: 32px;
    background: #EEF2FF;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
}

/* Amazon Card */
.affiliate-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.aff-label {
    font-size: 12px;
    font-weight: 800;
    display: block;
    margin-bottom: 1rem;
    text-align: left;
}

.aff-img {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
}

.aff-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.aff-rating {
    color: #FBBF24;
    margin-bottom: 1rem;
}

.aff-btn {
    display: block;
    border: 1px solid #E5E7EB;
    padding: 8px;
    border-radius: 99px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 600;
}

/* Content */
.content-area h2 {
    font-size: 28px;
    font-weight: 800;
    margin: 2rem 0 1rem;
}

.content-area p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    background: #111827;
    color: #9CA3AF;
    padding: 4rem 0;
    margin-top: 6rem;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 1rem;
}

.footer-links a {
    color: inherit;
    text-decoration: none;
    font-size: 14px;
}

@media (max-width: 900px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .calc-inputs {
        grid-template-columns: 1fr;
    }
}
/* --- Rich Calculator Styles (Restored) --- */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.calculator-card {
    background: #f5f5f5;
    border: 1px solid #000;
    padding: 32px;
}

.input-group {
    margin-bottom: 24px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #000;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
}

.result-card {
    background: #fff;
    border: 1px solid #000;
    padding: 32px;
}

.result-main {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 24px;
}

.result-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 8px;
}

.result-value {
    font-size: 42px;
    font-weight: 700;
    color: #000;
    line-height: 1;
}

.result-breakdown {
    display: grid;
    gap: 16px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.result-row-label {
    font-weight: 500;
    color: #666;
}

.result-row-value {
    font-weight: 600;
    color: #000;
}

.wealth-gain {
    color: #00af89;
}

.interest-color {
    color: #d33;
}

.formula-box {
    background: #f5f5f5;
    border: 1px solid #000;
    padding: 40px 32px;
    margin: 32px 0;
    text-align: center;
}

.faq-section {
    margin-top: 48px;
}

.faq-item {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.faq-question {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.amazon-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 32px;
    margin: 48px 0;
    border-radius: 4px;
}

.amazon-link {
    display: inline-block;
    background: #ff9900;
    color: #000;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 16px;
}

/* Performance Polish */
.perf-wrapper {
    content-visibility: auto;
    contain-intrinsic-size: 1px 1000px;
}

main { display: block; }

@media (max-width: 768px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
    .result-value {
        font-size: 32px;
    }
}
