* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 50%, #f0fdf4 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation Bar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: bold;
    color: #1f2937;
}

.nav-logo {
    font-size: 1.75rem;
    animation: pulse 2s infinite;
}

.nav-title {
    font-size: 1.5rem;
    background: linear-gradient(to right, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #3b82f6, #10b981);
    opacity: 0.1;
    transition: left 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before {
    left: 0;
}

.nav-link.active::before {
    left: 0;
}

.nav-link:hover {
    color: #1f2937;
    transform: translateY(-2px);
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.bar {
    width: 25px;
    height: 3px;
    background: linear-gradient(to right, #3b82f6, #10b981);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 2rem;
        gap: 1rem;
        transition: left 0.3s ease;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.25rem;
        padding: 1rem 2rem;
        width: 80%;
        text-align: center;
        border: 1px solid rgba(59, 130, 246, 0.2);
        background: rgba(255, 255, 255, 0.8);
    }

    .nav-link:hover {
        background: linear-gradient(to right, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
        border-color: rgba(59, 130, 246, 0.5);
    }
}

/* Header - add padding top for fixed navbar */
.header {
    background: linear-gradient(to right, #2563eb, #16a34a);
    color: white;
    padding: 8rem 0 4rem 0;
    text-align: center;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.heart-icon {
    font-size: 3rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.header h1 {
    font-size: 3.5rem;
    font-weight: bold;
    margin: 0;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin: 0;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent);
    transition: left 0.6s ease;
}

.feature-item:hover::before {
    left: 100%;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
}

.feature-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.feature-item p {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}


.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
}


/* Cards */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1.5rem;
    color: white;
}

.calculator-card .card-header {
    background: linear-gradient(to right, #3b82f6, #2563eb);
}

.result-card .card-header {
    background: linear-gradient(to right, #10b981, #059669);
}

.diet-header {
    background: linear-gradient(to right, #f97316, #ea580c);
}

.exercise-header {
    background: linear-gradient(to right, #a855f7, #9333ea);
}

.lifestyle-header {
    background: linear-gradient(to right, #06b6d4, #0891b2);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.card-content {
    padding: 1.5rem;
}

/* Container card responsiveness */
.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.8rem;
    flex-wrap: wrap; /* allow wrapping on small screens */
}

.input-group label {
    width: 120px;
    min-width: 120px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0;
}

.input-group input,
.input-group select {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    width: 100%;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.calculate-btn {
    width: 100%;
    background: linear-gradient(to right, #3b82f6, #2563eb);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.calculate-btn:hover {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

/* Responsive behavior for small screens */
@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-group label {
        width: 100%;
        margin-bottom: 0.3rem;
    }

    .card-header .card-title {
        font-size: 1.25rem;
        align-items: flex-start;
    }
}


/* Results */
.result-display {
    text-align: center;
}

.bmi-value {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
}

.bmi-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    /*margin-bottom: 1.5rem;*/
    margin-top: 1rem;
}

.category-underweight { background-color: #3b82f6; }
.category-normal { background-color: #10b981; }
.category-overweight { background-color: #f59e0b; }
.category-obese { background-color: #ef4444; }

.bmi-ranges {
    margin-top: 1.5rem;
}

.range-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.placeholder {
    text-align: center;
    color: #6b7280;
    /*padding: 3rem 0;*/
}

.placeholder-icon {
    font-size: 4rem;
    opacity: 0.5;
    display: block;
    margin-bottom: 1rem;
}

.placeholder-svg-wrapper {
    width: 100%;
    max-width: 400px;  /* Adjust max width as needed */
    margin: 0 auto;
    aspect-ratio: 300 / 163; /* Matches SVG viewBox */
}

.placeholder-svg-wrapper svg {
    width: 100%;
    height: 100%;
    display: block;
}


/* Recommendations */
.recommendations {
    margin: 4rem 0;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.recommendations-header {
    text-align: center;
    margin-bottom: 2rem;
}

.recommendations-header h2 {
    font-size: 2rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1rem;
}

.recommendations-header p {
    color: #6b7280;
    max-width: 600px;
    margin: 0 auto;
}

.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.recommendation-card {
    transition: all 0.3s ease;
}

.recommendation-card:hover {
    transform: translateY(-4px);
}

/* Health Tips */
.health-tips {
    margin: 4rem 0;
    background: linear-gradient(to right, #f0f9ff, #f0fdf4);
    padding: 2rem;
    border-radius: 0.75rem;
}

.health-tips h3 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tip-item {
    text-align: center;
}

.tip-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}

.tip-item h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.tip-item p {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Disclaimer */
.disclaimer {
    margin: 3rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.disclaimer p {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .recommendations-grid {
        grid-template-columns: 1fr;
    }

    .tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .tips-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #1f2937 100%);
    color: white;
    padding: 4rem 0 0 0;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(59, 130, 246, 0.5), rgba(16, 185, 129, 0.5), transparent);
}

.footer-content {
    display: grid;
    grid-template-columns: 4fr 4fr;
    gap: 2rem;
    margin-bottom:3rem;
}

.footer-section {
    display: block;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.footer-logo {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

.footer-title {
    font-size: 1.75rem;
    font-weight: bold;
    background: linear-gradient(to right, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-description {
    color: #d1d5db;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link:hover {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.3));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

.footer-heading {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: white;
    position: relative;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(to right, #3b82f6, #10b981);
    border-radius: 1px;
}

/* Make footer quick links horizontal */
.footer-section .footer-links {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin: 0;
}

.footer-link {
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 1rem;
}

.footer-link::before {
    content: '→';
    position: absolute;
    left: 0;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: #3b82f6;
}

.footer-link:hover {
    color: #3b82f6;
    padding-left: 1.5rem;
}

.footer-link:hover::before {
    opacity: 1;
    transform: translateX(0);
}


.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #d1d5db;
    margin: 0;
}

.contact-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    background: rgba(0, 0, 0, 0.2);
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright {
    color: #9ca3af;
    margin: 0;
    font-size: 0.875rem;
}

.footer-bottom-links {
    display: flex;
    gap: 2rem;
}

.footer-bottom-link {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-bottom-link:hover {
    color: #3b82f6;
}

a{
    text-decoration:none;
}

.bmi-charts-row {
    display: flex;
    flex-wrap: wrap; /* responsive */
    gap: 20px;
    justify-content: space-between;
    align-items: flex-start;
}

.bmi-chart {
    flex: 1 1 48%; /* roughly half-width, adjusts on smaller screens */
}

.bmi-chart h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}
.bmi-chart img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Wrapper for scroll on small screens */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    margin-top: 1rem;
}

/* Table styling */
.bmi-ranges-horizontal {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    text-align: center;
    min-width: 500px; /* minimum width to prevent squishing */
}

.bmi-ranges-horizontal th,
.bmi-ranges-horizontal td {
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
}

.bmi-ranges-horizontal thead {
    background-color: #f3f4f6;
}


.text-sm{
    font-size: 0.875rem;
}

li {
    list-style: none;
}

.charts-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.charts-row canvas {
    max-width: 100%;
    width: 150px;
    height: 150px;
}

.chart-wrapper {
    width:30%;
    text-align: center;
    min-width:30% !important;
}
.chart-label {
    font-size: 0.9rem;
    margin-top: 5px;
}

/* 👇 On mobile (screen ≤ 768px), stack charts vertically */
@media (max-width: 768px) {
    .chart-wrapper {
        width:60%;
        text-align: center;
    }
    .charts-row {
        flex-direction: column;
        align-items: center;
    }
}

/* Dropdown Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    width:100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}
.dropdown-item:hover {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.1), rgba(16, 185, 129, 0.1));
    color: #1f2937;
    transform: translateX(5px);
}

.dropdown-icon {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .dropdown{
        width:80%;
        text-align:center;
    }
    .dropdown .nav-link{
        width:100%;
        text-align:center;
    }
    .dropdown-trigger {
        justify-content: center;
    }
}
