* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* html, body {
    height: 100%;
} */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 20px;

    display: flex;
    flex-direction: column;
}


.container {
    width: 90%;
    max-width: 900px;
    margin: 40px auto;
    background: #fff;
    border-radius: 20px;
    /* This creates the rounded corners */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* IMPORTANT: This traps the footer inside the corners */
    display: flex;
    flex-direction: column;
}


header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 50px 30px 40px;
    text-align: center;
    /* display: block; */
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
}

.content {
    padding: 40px 30px;
    flex: 1;
}

.intro {
    margin-bottom: 30px;
    line-height: 1.8;
    color: #555;
    text-align: center;
    font-size: 1.05rem;
}

.calculator-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="number"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
}

.unit-toggle {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.unit-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: #fff;
    color: #667eea;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.unit-btn.active {
    background: #667eea;
    color: #fff;
}

.unit-btn:hover:not(.active) {
    background: #f0f4ff;
}

.height-inputs {
    display: flex;
    gap: 10px;
}

.height-inputs input {
    flex: 1;
}

.calculate-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    margin: 10px 0 0 0;
    text-decoration: none;
    display: block;
}

.open-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    /* background-color: #667eea; */
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    margin: 20px 0px;
    text-decoration: none;

}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(0);
}

.result {
    visibility: hidden;

    background: #fff;
    border: 2px solid #667eea;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 10px;
}

.result.show {
    display: block;
    animation: fadeIn 0.5s;
    visibility: visible;
}

body.plain-page {
    background: #f5f7fa;
}


@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bmi-value {
    text-align: center;
    font-size: 3.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.bmi-category {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
}

.bmi-message {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    line-height: 1.8;
}

.info-section {
    padding: 0 30px 40px;
    /* Added horizontal padding to match .content */
    margin-bottom: 40px;
    cursor: text;
}

.info-section h2 {
    color: #667eea;
    font-size: 1.8rem;
    /* margin-bottom: 20px; */
    padding-bottom: 10px;
    /* border-bottom: 3px solid #2d3748; */
}


.info-section h3 {
    color: #667eea;
    /* font-size: 1.8rem; */
    /* margin-bottom: 20px; */
    padding-bottom: 10px;
    /* border-bottom: 3px solid #2d3748; */
}

.info-section p {
    color: #555;
    line-height: normal;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.bmi-table {
    width: 100%;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
    border-collapse: collapse;
}

.bmi-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.bmi-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.bmi-table tr:last-child td {
    border-bottom: none;
}

.bmi-table tr:nth-child(even) {
    background: #fff;
}

.faq-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
}

.faq-section h2 {
    color: #667eea;
    font-size: 1.8rem;
    margin-bottom: 25px;
    text-align: center;
}

.faq-section h3 {
    color: #667eea;
    /* font-size: 1.8rem; */
    margin-bottom: 25px;
    text-align: center;
}

.faq-item {
    background: #fff;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transform: translateX(5px);
}

.faq-question {
    font-weight: 700;
    color: #333;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-icon {
    font-size: 1.5rem;
    color: #667eea;
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    color: #555;
    line-height: 1.7;
    /* Use max-height instead of display:none for smooth sliding */
    max-height: 0;
    overflow: hidden;
    padding: 0 20px;
    /* Side padding */
    
    
    transition: max-height 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    /* Large enough to fit any answer */
    padding-top: 15px;
    padding-bottom: 20px;
    margin-top: 8px;
    border-top: 1px solid #eee;
    /* Optional: adds a nice separator when open */
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    margin-top: 8px;
}

.disclaimer-box {
    background: #fff9e6;
    border: 2px solid #ffc107;
    padding: 25px;
    margin: 40px 0;
    border-radius: 10px;
    line-height: 1.8;
}

.disclaimer-box strong {
    color: #f57c00;
    font-size: 1.1rem;
}

footer {
    background: #2d3748;
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    width: 100%;
    margin-top: auto;
}

.footer-disclaimer {
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: #cbd5e0 !important;
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #667eea !important;
}

.footer-disclaimer {
    font-size: 0.8rem;
    opacity: 0.7;
    max-width: 700px;
    margin: 20px auto 0;
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.future-tools {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 25px;
    justify-content: center;
}

.tool-card {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    padding: 20px;
    background: #3d4852;
    border-radius: 10px;
    text-align: center;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-card h3 {
    color: #ebefff;
    margin-bottom: 10px;
}


details {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    cursor: pointer;

}

footer a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    margin: 0 8px;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #667eea;
    text-decoration: underline;
}

.result {
    display: none;
    /* Keep this for JS toggle */
    background: #fff;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
    /* Added spacing from the calculator */
    border: 3px solid #667eea;
    text-align: center;
    /* Centers the result text */
}

.result.show {
    opacity: 1;
    visibility: visible;
}

/* .details-section {
    margin-top: 25px;
    padding: 25px;
    background: #f5f7ff;
    border-radius: 12px;
    display: none;
} */

.details-section {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.details-section.show {
    max-height: 300px;
}


.calculator-section {
    padding: 40px;
    /* increase from 30px */
}

.form-group {
    margin-bottom: 30px;
}


.detail-btn {
    display: inline-block;
    margin: 20px auto;
    padding: 12px 26px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    cursor: pointer;
}

.reset-btn {
    padding: 5px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    margin-top: 10px;
    /* padding: 12px; */
    background: transparent;
    color: #666;
    /* border: 2px solid #ddd; */
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.reset-btn:hover {
    background: #eee;
    color: #333;
}

.macro-section {
    margin-top: 25px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.macro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.macro-card {
    padding: 15px 10px;
    border-radius: 10px;
    text-align: center;
}

.macro-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.macro-value {
    font-size: 1.2rem;
    font-weight: 800;
}

/* Macro Colors */
.carbs {
    background: #e3f2fd;
    color: #1976d2;
}

.protein {
    background: #f1f8e9;
    color: #388e3c;
}

.fats {
    background: #fff3e0;
    color: #f57c00;
}



:root {
    --sidebar-width: 260px;
    --dark-bg: #2d3748;
    --accent-color: #667eea;
}



/* 1. Layout Structure */
.main-layout {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Horizontally centers the .container */
    min-height: 100vh;
    transition: padding-left 0.3s ease;
}

/* 2. Sidebar Styling */
.sidebar {
    position: fixed;
    left: -280px;
    /* Hidden */
    top: 0;
    width: 280px;
    height: 100%;
    background: #2d3748;
    z-index: 9999;
    /* Higher than the container */
    transition: 0.3s ease;

    /* --- Sidebar Styles --- */
    /* sidebar {
    position: fixed;
    left: -280px;
    /* Fully hidden to the left */
    top: 0;
    width: 280px;
    height: 100%;
    background: #2d3748;
    color: white;
    transition: 0.3s ease-in-out;
    z-index: 2000;
    /* Higher than everything else */
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
}

*/ .sidebar.active {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    background: #1a202c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    list-style: none;
    padding: 20px 0;
}

.nav-links li a {
    display: block;
    padding: 15px 25px;
    color: #cbd5e0;
    text-decoration: none;
    transition: 0.2s;
}

.nav-links li a:hover,
.nav-links li a.active {
    background: #4a5568;
    color: white;
    border-left: 4px solid #667eea;
}

/* --- Mobile Nav --- */
.mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.menu-btn,
.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #4a5568;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* --- Reset Button Styling --- */
.reset-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #764ba2;
    border: 2px solid #764ba2;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: #f0f2ff;
}

/* Macro Section Styling (Fixing missing styles) */
.macro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.macro-card {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    background: white;
    border: 1px solid #eee;
}

.macro-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
}

.macro-value {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #667eea;
}

.calculate-btn,
select {
    margin: 0 10px;
    width: calc(100% - 20px);
}

.seo-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.seo-content.show {
    max-height: 2000px;
    /* enough for content */
}

.trapped-footer {
    background: #f8f9fa;
    padding: 35px 20px;
    border-top: 1px solid #eef0f2;
    text-align: center;
    width: 100%;
    margin-top: auto;
}

/* Primary Tools Row */
.footer-row.main-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-row.main-tools a {
    color: #667eea !important;
    text-decoration: none;
    margin: 0 12px;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-block;
}

/* Secondary Site Links Row */
.footer-row.site-links {
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px dashed #d1d5db;
    /* Thin line between tool links and site links */
    display: inline-block;
    width: 80%;
}

.footer-row.site-links a {
    color: #718096 !important;
    text-decoration: none;
    margin: 0 8px;
    font-size: 0.85rem;
}

.footer-row.site-links .sep {
    color: #cbd5e0;
}

.footer-row.site-links a:hover {
    color: #2d3748 !important;
    text-decoration: underline;
}

/* .tools-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
} */

/* Disclaimer Styling */
.footer-disclaimer {
    color: #a0aec0;
    font-size: 0.75rem;
    line-height: 1.6;
    max-width: 550px;
    margin: 0 auto;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.faq-icon {
    font-size: 20px;
    font-weight: bold;
}


/* =========================
   MOBILE UI FIX (IMPORTANT)
========================= */
/* =========================
   MOBILE UI FIX (2 COLUMNS)
========================= */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        width: 100%;
        margin: 15px auto;
        border-radius: 16px;
    }

    /* Target the container for the cards */
    .future-tools {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* Forces exactly 2 columns */
        gap: 10px;
        /* Reduced gap to fit better on small screens */
        padding: 0 5px;
    }

    /* Adjust the cards to fit in the 2-column grid */
    .tool-card {
        min-width: 0;
        /* Allows cards to shrink smaller than the desktop 200px */
        max-width: 100%;
        padding: 15px 10px;
    }

    .tool-card h3 {
        font-size: 0.95rem;
        /* Slightly smaller title for narrow columns */
    }

    .tool-card p {
        font-size: 0.8rem;
        /* Keeps description text readable */
    }

    header {
        padding: 30px 20px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .content {
        padding: 20px 15px;
    }

    /* Standard mobile button/input adjustments */
    .calculate-btn,
    .open-btn,
    .detail-btn,
    .reset-btn {
        width: 100%;
        margin: 10px 0;
        padding: 12px;
        font-size: 0.9rem;
    }

    .bmi-value {
        font-size: 2.2rem;
    }

    footer {
        padding: 25px 15px;
    }
}

/* Internal SEO Links spacing fix */
.internal-links-box {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.internal-links-box p {
    margin-bottom: 12px;
    line-height: 1.7;
}

.internal-links-box a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.internal-links-box a:hover {
    text-decoration: underline;
}