/* Modern, Premium, Vibrant Design System */
:root {
    /* Color Palette */
    --primary: #10B981;
    /* Emerald 500 */
    --primary-dark: #059669;
    /* Emerald 600 */
    --secondary: #3B82F6;
    /* Blue 500 */
    --accent: #F59E0B;
    /* Amber 500 */
    --background: #F9FAFB;
    /* Gray 50 */
    --surface: #FFFFFF;
    --text-main: #111827;
    /* Gray 900 */
    --text-muted: #6B7280;
    /* Gray 500 */
    --border: #E5E7EB;
    /* Gray 200 */

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #ECFDF5 0%, #F0F9FF 100%);
    --gradient-primary: linear-gradient(135deg, #10B981 0%, #34D399 100%);

    /* Spacing & Radius */
    --radius-lg: 16px;
    --radius-md: 8px;
    --container-width: 1200px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5em;
    color: var(--text-main);
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Layout Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 2rem;
    width: 280px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    gap: 0.5rem;
    z-index: 1001;
}

.nav-links.active {
    display: flex;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: #ECFDF5;
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.plan-meta {
    background: rgba(16, 185, 129, 0.05);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 0.95rem;
}

.plan-meta p {
    margin-bottom: 0;
    color: var(--text-main);
}

.plan-meta strong {
    color: var(--primary-dark);
}

.plan-meta ul {
    list-style-type: disc;
    padding-left: 1.25rem;
    margin-top: 0.5rem;
}

/* Interactive Elements */
.tab-mobile-select {
    display: none;
    /* Hidden on desktop, shown on mobile */
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--surface);
}

.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    /* Overlap border */
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Specifics */
/* Hero */
.hero {
    background: var(--gradient-hero);
    padding: 6rem 0;
    text-align: center;
}

.hero-small {
    background: var(--gradient-hero);
    padding: 4rem 0 6rem;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--primary-dark), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #F3F4F6;
    font-weight: 600;
    color: var(--text-main);
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    background-color: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.results-card {
    background: var(--gradient-hero);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 2rem;
    display: none;
    /* Shown after calculation */
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.result-item:last-child {
    border-bottom: none;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.bmi-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.bmi-normal {
    background: #D1FAE5;
    color: #065F46;
}

.bmi-warning {
    background: #FEF3C7;
    color: #92400E;
}

.bmi-danger {
    background: #FEE2E2;
    color: #991B1B;
}

@media (max-width: 768px) {
    .tabs {
        display: none;
        /* Hide button tabs on mobile */
    }

    .tab-mobile-select {
        display: block;
        /* Show dropdown on mobile */
    }

    h1 {
        font-size: 2.25rem;
    }

    /* Results styling already handled */
    .results-card {
        padding: 1.5rem;
    }

    /* Simplified mobile nav for now */
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

.mobile-menu-toggle {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--primary);
    background: none;
    border: none;
    transition: transform 0.2s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .nav-links {
        right: 0;
        left: 0;
        width: auto;
        border-radius: 0;
        border-right: none;
        border-left: none;
        border-bottom: 2px solid var(--primary);
    }
}

/* Enhanced dropdown for mobile tabs */
.tab-mobile-select {
    appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 1.5em !important;
    padding-right: 3rem !important;
    font-weight: 600;
    color: var(--primary);
    border: 2px solid var(--primary);
    cursor: pointer;
}