/* =========================================
   MeritBoard Elite IBW Calculator - FINAL
   ========================================= */

:root {
    --mb-primary: #1A237E;
    --mb-accent: #3D5AFE;
    --mb-white: #ffffff;
    --mb-bg-light: #f8fafc;
    --mb-text-dark: #0f172a;
    --mb-text-muted: #64748b;
    --mb-border: #e2e8f0;
    --mb-success: #10b981;
    --mb-shadow: 0 20px 25px -5px rgba(26, 35, 126, 0.1), 0 10px 10px -5px rgba(26, 35, 126, 0.04);
}

body.dark-mode {
    --mb-bg-light: #0f172a; --mb-white: #1e293b; --mb-text-dark: #f8fafc;
    --mb-text-muted: #94a3b8; --mb-border: #334155;
}

/* --- 1. Hero & Navigation Fix --- */
.tools-hero {
    background: linear-gradient(135deg, var(--mb-primary) 0%, #283593 100%) !important;
    padding: 80px 0 70px !important;
    text-align: center;
    color: #ffffff !important;
    border-radius: 0 0 50px 50px;
}

.cat-nav-container {
    position: relative;
    z-index: 50;
    margin-top: -30px; /* Hero ke edge par align */
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.category-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--mb-white);
    color: var(--mb-primary) !important;
    text-decoration: none;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border: 1px solid var(--mb-border);
    transition: all 0.3s ease;
}

.category-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 20px -5px rgba(0,0,0,0.15);
}

/* --- 2. Main Calculator Card --- */
.calc-card {
    background: var(--mb-white) !important;
    border-radius: 32px !important;
    padding: 40px !important;
    box-shadow: var(--mb-shadow) !important;
    margin: 0 auto 50px !important; /* Overlap Fixed: No negative margin */
    max-width: 650px;
    box-sizing: border-box;
    position: relative;
}

/* --- 3. UI Elements (Tabs & Gender) --- */
.tab-switcher {
    display: flex; background: rgba(15, 23, 42, 0.05);
    padding: 6px; border-radius: 20px; margin-bottom: 30px; gap: 8px;
}

.tab-btn {
    flex: 1; border: none; padding: 14px; font-weight: 700;
    background: transparent; color: var(--mb-text-muted);
    cursor: pointer; border-radius: 16px; transition: 0.3s;
}

.tab-btn.active {
    background: var(--mb-white); color: var(--mb-primary) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.gender-toggle-wrapper { display: flex; gap: 15px; margin-bottom: 30px; }
.gender-btn {
    flex: 1; padding: 18px; border-radius: 20px; border: 2px solid var(--mb-border);
    cursor: pointer; font-weight: 700; display: flex; justify-content: center; gap: 10px;
    transition: 0.3s;
}

.gender-btn.active {
    border-color: var(--mb-accent); background: rgba(61, 90, 254, 0.05);
    color: var(--mb-primary); box-shadow: 0 0 0 4px rgba(61, 90, 254, 0.1);
}

/* --- 4. Form Controls --- */
.input-row { display: flex; gap: 20px; width: 100%; margin-bottom: 25px; }
.input-field { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.input-field label { font-size: 0.85rem; font-weight: 800; color: var(--mb-primary); text-transform: uppercase; }

input[type="number"], .custom-dropdown {
    width: 100%; padding: 16px; border: 2px solid var(--mb-border);
    border-radius: 16px; font-weight: 600; font-size: 1rem;
    box-sizing: border-box; background: #fff;
}

.calculate-btn {
    width: 100%; padding: 20px; border: none; border-radius: 20px;
    background: linear-gradient(135deg, var(--mb-primary), var(--mb-accent)) !important;
    color: white; font-size: 1.1rem; font-weight: 800; cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(61, 90, 254, 0.4); transition: 0.3s;
}

.calculate-btn:hover { transform: translateY(-3px); filter: brightness(1.1); }

/* --- 5. Advanced Professional Results Area --- */
.result-area {
    margin-top: 40px;
    padding: 30px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(26, 35, 126, 0.02) 0%, rgba(26, 35, 126, 0.05) 100%);
    border: 1px solid rgba(26, 35, 126, 0.1);
    text-align: center;
    animation: fadeIn 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.result-title { font-size: 0.9rem; font-weight: 700; color: var(--mb-text-muted); text-transform: uppercase; letter-spacing: 1px; }

#ibw-main-value {
    font-size: 4rem;
    font-weight: 900;
    color: var(--mb-primary);
    margin: 15px 0;
    line-height: 1;
}

#ibw-main-value span { font-size: 1.5rem; opacity: 0.7; }

/* Goal Pill Styling */
#goal-indicator {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Formula Grid */
.advanced-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.formula-card {
    background: var(--mb-white);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--mb-border);
    transition: 0.3s;
}

.formula-card:hover { border-color: var(--mb-accent); transform: scale(1.02); }

.f-title { font-size: 0.7rem; color: var(--mb-text-muted); font-weight: 800; text-transform: uppercase; }
.f-value { font-size: 1.25rem; color: var(--mb-primary); font-weight: 800; margin-top: 5px; }

/* WHO Info Section */
.who-range-container {
    margin-top: 30px;
    background: #e0f2f1;
    padding: 20px;
    border-radius: 22px;
    border: 1px solid #b2dfdb;
}

body.dark-mode .who-range-container { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); }

.who-header { color: #00695c; font-weight: 800; font-size: 0.85rem; margin-bottom: 8px; }
.who-value { font-size: 1.4rem; font-weight: 900; color: #004d40; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive Adjustments --- */
@media (max-width: 600px) {
    .calc-card { padding: 30px 20px !important; margin: 0 15px 30px !important; }
    .input-row { flex-direction: column; gap: 20px; }
    .advanced-grid { grid-template-columns: 1fr; }
    #ibw-main-value { font-size: 3rem; }
    .cat-nav-container { margin-top: -25px; }
}

/* =========================================
   NEW STYLES FOR UPDATED HTML CONTENT
   Append below existing CSS only
   ========================================= */

.page-meta {
    color: var(--mb-white);
    font-size: 0.92rem;
    opacity: 0.85;
    margin-top: 10px;
    font-weight: 500;
}

.ibw-content {
    margin-top: 40px;
    color: var(--mb-text-dark);
}

.ibw-content h2 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--mb-primary);
    margin: 0 0 14px;
    letter-spacing: -0.02em;
}

.ibw-content h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--mb-primary);
    margin: 0 0 10px;
}

.ibw-content p {
    color: var(--mb-text-muted);
    margin: 0 0 14px;
    line-height: 1.7;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 22px 0;
}

.info-box {
    background: var(--mb-white);
    padding: 22px;
    border-radius: 18px;
    border: 1px solid var(--mb-border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.info-box:hover {
    transform: translateY(-3px);
    border-color: rgba(61, 90, 254, 0.35);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.info-box h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 800;
}

.info-box p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--mb-text-muted);
}

.disclaimer {
    background: #e3f2fd;
    padding: 16px 18px;
    border-radius: 14px;
    border-left: 4px solid var(--mb-primary);
    color: #0d47a1;
    font-size: 0.92rem;
    line-height: 1.7;
    margin-top: 22px;
}

body.dark-mode .disclaimer {
    background: rgba(26, 35, 126, 0.12);
    color: #cfe3ff;
    border-left-color: var(--mb-accent);
}

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

.faq-section h2 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--mb-primary);
    margin-bottom: 18px;
}

.faq-item {
    background: var(--mb-white);
    padding: 18px 20px;
    border-radius: 16px;
    border: 1px solid var(--mb-border);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.faq-item:hover {
    border-color: rgba(61, 90, 254, 0.3);
    transform: translateY(-2px);
}

.faq-item h3 {
    margin: 0 0 8px;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--mb-text-dark);
}

.faq-item p {
    margin: 0;
    color: var(--mb-text-muted);
    line-height: 1.7;
}

body.dark-mode .info-box,
body.dark-mode .faq-item {
    background: #111827;
    border-color: var(--mb-border);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body.dark-mode .ibw-content h2,
body.dark-mode .ibw-content h3,
body.dark-mode .faq-section h2,
body.dark-mode .faq-item h3 {
    color: var(--mb-text-dark);
}

body.dark-mode .ibw-content p,
body.dark-mode .info-box p,
body.dark-mode .faq-item p {
    color: var(--mb-text-muted);
}

body.dark-mode .page-meta {
    opacity: 0.78;
}

@media (max-width: 600px) {
    .ibw-content h2,
    .faq-section h2 {
        font-size: 1.45rem;
    }

    .info-box,
    .faq-item {
        padding: 16px;
        border-radius: 14px;
    }

    .disclaimer {
        padding: 14px 15px;
        font-size: 0.9rem;
    }

    .page-meta {
        font-size: 0.85rem;
    }
}