:root {
        --primary-color: #3498db;
        --primary-hover: #2980b9;
        --text-color: #2c3e50;
        --light-text: #34495e;
        --background: #f5f5f5;
        --card-bg: white;
        --error-bg: #ffebee;
        --error-text: #c62828;
        --underweight: #ffcc80;
        --normal: #a5d6a7;
        --overweight: #ffab91;
        --obesity: #ef9a9a;
        --info-bg: #f8f9fa;
        --indicator-color: #2c3e50;
        --female-accent: #ff9ff3;
        --male-accent: #48dbfb;
        --low-risk: #4CAF50;
        --moderate-risk: #FFC107;
        --high-risk: #F44336;
    }

    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }

    bodybmi {
        font-family: 'Arial', sans-serif;
        background-color: var(--background);
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        padding: 2px;
        line-height: 1.6;
    }

    .calculator-container {
        background-color: var(--card-bg);
        padding: 2rem;
        border-radius: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        width: 100%;
        max-width: 600px;
    }

    h1 {
        color: var(--text-color);
        margin-bottom: 1.5rem;
        text-align: center;
        font-size: clamp(1.5rem, 4vw, 2rem);
    }

    h2, h3, h4 {
        color: var(--text-color);
        margin-bottom: 0.5rem;
    }

    .toggle-group {
        display: flex;
        justify-content: center;
        margin-bottom: 1.5rem;
        gap: 0.5rem;
    }

    .toggle-btn {
        padding: 0.5rem 1rem;
        border: 2px solid var(--primary-color);
        background: white;
        cursor: pointer;
        transition: all 0.3s;
        font-weight: bold;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        border-radius: 5px;
    }

    .toggle-btn.active {
        background-color: var(--primary-color);
        color: white;
    }

    .input-group {
        margin-bottom: 1.25rem;
        position: relative;
    }
    
    .input-message {
        font-size: 0.75rem;
        color: var(--light-text);
        margin-top: 0.25rem;
        display: block;
    }
	
	.bmi-group {
        display: flex;
        justify-content: center;
		text-align: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
	
	.bmi-group span {
		font-weight: bold;
		font-size: 10px;
		text-align: center;
		border-left: 4px solid blue;
		background-color: white;
		padding: 7px;
		border-radius: 10px;
	}

    label {
        display: block;
        margin-bottom: 0.5rem;
        color: var(--light-text);
        font-weight: bold;
    }

    .input-with-unit {
        display: flex;
        gap: 0.75rem;
    }
.select {
	padding: 2px 10px 2px 10px !important;
}

    button {
        background-color: var(--primary-color);
        color: white;
        border: none;
        padding: 0.75rem;
        border-radius: 5px;
        cursor: pointer;
        font-size: 1.1rem;
        width: 100%;
        margin-top: 0.5rem;
        transition: background-color 0.3s;
        font-weight: bold;
    }

    button:hover {
        background-color: var(--primary-hover);
    }

    .result-container {
        margin-top: 1.5rem;
        display: none;
    }

    .bmi-result {
        padding: 1rem;
        border-radius: 5px;
        font-size: 1.2rem;
        font-weight: bold;
        text-align: center;
        margin-bottom: 0.1rem;
        color: white;
    }

    .advanced-metrics {
        padding: 1rem;
        border-radius: 5px;
        margin-top: 1rem;
    }

    .metric-result {
        margin-bottom: 1rem;
		padding: 1rem;
		background-color: var(--info-bg);
        border-radius: 5px;
        position: relative;
    }

    .metric-result strong {
        display: block;
        margin-bottom: 0.3rem;
    }

    .risk-indicator {
        height: 10px;
        border-radius: 5px;
        background: linear-gradient(to right, var(--low-risk), var(--moderate-risk), var(--high-risk));
        margin: 0.5rem 0;
        position: relative;
    }

    .risk-marker {
        position: absolute;
        top: -5px;
        width: 2px;
        height: 20px;
        background-color: black;
    }

    .bmi-scale-container {
        margin: 1.5rem 0;
		padding: 1rem;
		background-color: var(--info-bg);
        border-radius: 5px;
    }

    .bmi-scale {
        display: flex;
        height: 25px;
        border-radius: 10px;
        overflow: hidden;
        position: relative;
		border-top: 3px solid black;
    }

    .scale-segment {
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: bold;
        font-size: 11px;
        text-align: center;
    }

    .scale-labels {
        display: flex;
        justify-content: space-between;
        font-size: 0.7rem;
        color: var(--light-text);
        margin-bottom: 0.5rem;
    }
	
	.scale-markers {
        display: flex;
        justify-content: space-between;
        position: relative;
        margin-top: -0.1rem;
		margin-bottom: 1rem;
        font-size: 0.7rem;
        color: var(--light-text);
    }

    .scale-markers span {
        position: absolute;
        transform: translateX(-50%);
    }
	
    .bmi-indicator {
        position: absolute;
        top: 0px;
        left: 0;
        width: 0;
        height: 0;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 12px solid var(--indicator-color);
        transform: translateX(-50%);
        transition: left 0.5s ease;
        display: none;
    }
	
	.bmi-categories {
        margin-top: 1rem;
        text-align: left;
        background-color: var(--info-bg);
        padding: 1rem;
        border-radius: 5px;
    }
	
	.bmi-scale-container h3 {
        text-align: center;
		padding: 10px;
        color: var(--error-text);
        font-size: clamp(1rem, 3vw, 1.2rem);
        margin-bottom: 0.5rem;
    }

    .bmi-categories h3 {
        text-align: center;
		margin-top: 0;
        color: var(--text-color);
        font-size: clamp(1rem, 3vw, 1.2rem);
        margin-bottom: 0.5rem;
    }

    .hidden {
        display: none;
    }

    .female-mode {
        --primary-color: var(--female-accent);
        --primary-hover: #f368e0;
    }

    .male-mode {
        --primary-color: var(--male-accent);
        --primary-hover: #0abde3;
    }

    .interpretation {
        font-size: 1rem;
        color: var(--light-text);
        margin-top: 0.5rem;
    }

    .health-tips {
        margin-top: 1.5rem;
        background-color: var(--info-bg);
        padding: 1rem;
        border-radius: 5px;
    }

    .health-tips h3 {
        margin-bottom: 0.5rem;
    }

    .health-tips ul {
        padding-left: 1.2rem;
    }

    .health-tips li {
        margin-bottom: 0.5rem;
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .health-tips li i {
        margin-top: 0.2rem;
        flex-shrink: 0;
    }

    .metric-title {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .metric-icon {
        font-size: 1.2rem;
    }

    .good { color: var(--low-risk); }
    .warning { color: var(--moderate-risk); }
    .danger { color: var(--high-risk); }

    @media (max-width: 480px) {
        .calculator-container {
            padding: .5rem;
        }
        
        .bmi-group span {
            font-size: 8px;
            padding: 5px;
        }
    }