/* --- MASTER STYLESHEET (LCP OPTIMIZED) --- */
:root {
    --primary: #2563eb;       /* Professional Blue */
    --primary-dark: #1e40af;
    --bg-color: #f9fafb;      /* Slightly lighter for modern feel */
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

/* LCP OPTIMIZATION: Expanded font stack ensures text paints immediately */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

body { background-color: var(--bg-color); color: var(--text-main); display: flex; flex-direction: column; min-height: 100vh; }

/* --- NAVIGATION --- */
header { background: var(--primary-dark); padding: 0 20px; height: 60px; display: flex; align-items: center; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 5px rgba(0,0,0,0.15); content-visibility: auto; }
.nav-container { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.2rem; font-weight: 700; color: white; text-decoration: none; letter-spacing: 0.5px; }
.nav-link { color: #e0e7ff; text-decoration: none; font-size: 0.9rem; font-weight: 500; margin-left: 20px; transition: color 0.2s; } 
.nav-link:hover { color: #ffffff; text-decoration: underline; }

/* --- MAIN LAYOUT --- */
main { flex: 1; max-width: 1000px; margin: 20px auto; padding: 0 20px; width: 100%; }

/* --- CALCULATOR GRID LAYOUT --- */
.calculator-grid { display: flex; gap: 2rem; align-items: flex-start; margin-top: 20px; }
.input-section { flex: 1; background: var(--card-bg); padding: 25px; border-radius: 12px; border: 1px solid #e5e7eb; }

/* --- INPUT FIELDS --- */
.input-group { margin-bottom: 20px; }
label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-main); }
input, select { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 1rem; box-sizing: border-box; background: white; transition: border 0.2s; }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

/* Buttons */
.btn-calc { width: 100%; background: var(--primary); color: white; padding: 12px; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-calc:hover { background: var(--primary-dark); }

/* --- RESULT SECTION (Standardized) --- */
.result-section {
    flex: 1; 
    display: none; /* Hidden by default */
    background: var(--card-bg); 
    border-radius: 12px; 
    overflow: hidden;
    box-shadow: var(--shadow-lg); 
    position: relative;
}

.result-sidebar { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background-color: var(--primary); } 

.result-header { background-color: #eff6ff; padding: 25px 30px; border-bottom: 1px solid #dbeafe; }
.result-title { font-size: 0.95rem; font-weight: 600; color: var(--primary-dark); margin-bottom: 5px; }
.big-value { font-size: 2.5rem; font-weight: 800; color: var(--primary); line-height: 1; }

.result-body { padding: 30px; }

/* Charts */
.chart-wrapper { position: relative; height: 200px; width: 100%; display: flex; justify-content: center; margin-bottom: 20px; }

/* Summary Grid (for Key/Value pairs in results) */
.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.summary-item label { font-size: 0.8rem; color: var(--text-muted); display: block; margin-bottom: 5px; }
.summary-item span { font-weight: bold; font-size: 1rem; color: var(--text-main); }

/* --- AFFILIATE / SUGGESTION CARDS (Fixed Alignment) --- */
.affiliate-grid { 
    width: 100%; 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
    margin-top: 15px; 
    padding-top: 15px; 
    border-top: 1px dashed #bfdbfe; 
}

.affiliate-card { 
    background: #f8fafc; 
    padding: 15px; 
    border-radius: 8px; 
    border: 1px solid #e2e8f0; 
    font-size: 0.9rem; 
    text-align: center;
    /* Flexbox Magic for Alignment */
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    align-items: center;
    height: 100%; 
}

.affiliate-btn { 
    display: inline-block; 
    margin-top: 10px; 
    padding: 8px 12px; 
    background: var(--primary); 
    color: white; 
    text-decoration: none; 
    border-radius: 4px; 
    font-size: 0.8rem; 
    font-weight: 500;
    width: 100%; 
    box-sizing: border-box;
    transition: background 0.2s;
}
.affiliate-btn:hover { background: var(--primary-dark); }

/* --- CONTENT SECTION (SEO) --- */
.content-section { 
    margin-top: 3rem; 
    background: var(--card-bg); 
    padding: 30px; 
    border-radius: 12px; 
    border: 1px solid #e5e7eb; 
    line-height: 1.7; 
    color: var(--text-main); 
    content-visibility: auto; 
    contain-intrinsic-size: 800px;
}
.content-section h2 { color: #111827; font-size: 1.5rem; margin-top: 0; margin-bottom: 1rem; border-bottom: 2px solid #f3f4f6; padding-bottom: 10px; }
.content-section p, .content-section ul { margin-bottom: 1rem; }
.content-section ul { padding-left: 20px; }
.faq-item { background: #f9fafb; padding: 20px; border-radius: 8px; margin-bottom: 1rem; border: 1px solid #e5e7eb; }
.faq-question { font-weight: 700; color: #111827; display: block; margin-bottom: 5px; }

/* --- AD BANNER --- */
.ad-banner { 
    width: 100%; margin: 30px 0; text-align: center; min-height: 90px; 
    background-color: #f3f4f6; display: flex; justify-content: center; align-items: center; 
    color: #9ca3af; font-size: 0.8rem; border-radius: 8px; border: 1px dashed #d1d5db; 
}

/* --- FOOTER --- */
footer { text-align: center; padding: 30px; background: #1f2937; color: #9ca3af; font-size: 0.9rem; margin-top: 50px; content-visibility: auto; }
footer a { color: #d1d5db; text-decoration: none; margin: 0 10px; }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .calculator-grid { flex-direction: column; }
    .result-section { width: 100%; margin-top: 20px; }
    .nav-link { margin-left: 10px; font-size: 0.8rem; }
}