/* --- GLOBAL STYLES --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f4f8;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column; /* Changed for Footer */
    align-items: center;    /* Center everything */
    min-height: 100vh;
    color: #333;
}

.page-layout {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
    align-items: flex-start;
    margin-top: 40px;
    flex: 1; /* Pushes footer down */
}

/* Main Center Content */
.main-wrapper { flex: 1; max-width: 800px; width: 100%; }

/* Ad Sidebars */
.ad-sidebar { 
    width: 180px; 
    flex-shrink: 0; 
    min-height: 1px; 
}

/* --- CONTAINER & TABS --- */
.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.container h1 { margin-top: 30px; margin-bottom: 10px; color: #1e293b; text-align: center; font-weight: 800; letter-spacing: -1px;}
.container p { color: #64748b; text-align: center; margin-bottom: 25px; }

/* Tabs Design */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 0 20px;
}

.mode-btn {
    padding: 10px 20px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover { background: #e2e8f0; color: #333; }
.mode-btn.active {
    background: #2563eb; /* Pro Blue */
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* --- VIEW STYLES --- */
.calc-view { padding: 0 30px; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 1. BASIC VIEW */
.simple-box { max-width: 400px; margin: 0 auto; text-align: center; }
.simple-box input { 
    text-align: center; font-size: 1.2rem; padding: 15px; margin-bottom: 20px;
    border: 2px solid #e2e8f0; border-radius: 12px; width: 100%; box-sizing: border-box;
}
.simple-box label { display: block; margin-bottom: 8px; font-weight: bold; color: #475569; }
.big-result { background: #eff6ff; padding: 20px; border-radius: 12px; margin-bottom: 15px; border: 1px solid #bfdbfe; }
.big-result strong { display: block; font-size: 2rem; color: #2563eb; margin-top: 5px; }
.mini-results { display: flex; justify-content: space-between; font-size: 0.9rem; color: #64748b; }

/* 2. ADVANCED & PRO COMMON */
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; text-align: left; }
.input-group label { display: block; font-weight: 600; font-size: 0.9rem; color: #475569; margin-bottom: 5px; }
.input-group input, .input-group select {
    width: 100%; padding: 12px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1rem; box-sizing: border-box;
}
.calculate-btn {
    width: 100%; background: #0f172a; color: white; padding: 15px; border: none;
    border-radius: 8px; font-weight: bold; font-size: 16px; cursor: pointer; margin-top: 25px;
}
.results-list { margin-top: 25px; background: #f8fafc; padding: 20px; border-radius: 10px; border: 1px solid #e2e8f0; }
.res-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #e2e8f0; }
.res-row:last-child { border-bottom: none; }

/* 3. PRO SPECIFIC */
.calculator-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid #e2e8f0; margin-top: 20px; }
.inputs-section { padding: 20px 0; padding-right: 20px; }
.results-section { padding: 20px 0; padding-left: 20px; border-left: 1px solid #e2e8f0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pro-btn { background: #2563eb; } /* Blue button for Pro */
.res-row.net strong { color: #16a34a; font-size: 1.3rem; }
.red { color: #dc2626; }
h3 { font-size: 0.8rem; text-transform: uppercase; color: #94a3b8; letter-spacing: 1px; margin-top: 20px; border-bottom: 1px solid #e2e8f0; padding-bottom: 5px; }

/* SEO Content */
.content-section { background: white; padding: 40px; border-radius: 16px; text-align: left; line-height: 1.7; color: #334155; }
.content-section h2 { color: #1e293b; margin-top: 30px; }
.content-section li { margin-bottom: 10px; }

/* Mobile Optimization */
@media (max-width: 850px) {
    .page-layout { flex-direction: column; align-items: center; }
    .calculator-grid { grid-template-columns: 1fr; }
    .results-section { border-left: none; border-top: 1px solid #e2e8f0; padding-left: 0; padding-top: 30px; }
    .inputs-section { padding-right: 0; }
    .ad-sidebar { width: 100%; display: flex; justify-content: center; margin-bottom: 10px; }
}

/* Dark Mode */
body.dark-mode { background: #0f172a; color: #cbd5e1; }
body.dark-mode .container, body.dark-mode .content-section { background: #1e293b; }
body.dark-mode h1, body.dark-mode h2 { color: #f1f5f9; }
body.dark-mode .mode-btn { background: #334155; color: #cbd5e1; }
body.dark-mode .mode-btn.active { background: #3b82f6; color: white; }
body.dark-mode input, body.dark-mode select { background: #334155; border-color: #475569; color: white; }
body.dark-mode .big-result, body.dark-mode .results-list { background: #0f172a; border-color: #334155; }
#themeBtn { position: absolute; top: 20px; left: 20px; z-index: 100; padding: 8px 15px; border-radius: 20px; border: none; background: #334155; color: white; cursor: pointer; }

/* --- FOOTER STYLES (NEW) --- */
.site-footer {
    width: 100%;
    background-color: #1e293b;
    color: #94a3b8;
    padding: 30px 20px;
    margin-top: auto; /* Pushes to bottom */
    text-align: center;
    border-top: 4px solid #2563eb;
    box-sizing: border-box;
}

.footer-content p {
    color: #cbd5e1;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    margin: 0 10px;
    font-size: 0.85rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
}