.advanced-bmi-calculator {
    max-width: 500px;
    margin: 20px auto;
    padding: 25px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.bmi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bmi-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.5em;
}

.unit-switch {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color, #0073aa);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

.unit-label {
    font-size: 0.9em;
    color: #666;
}

.unit-label.imperial {
    display: none;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.height-input {
    display: flex;
    gap: 10px;
}

.height-input input {
    flex: 1;
}

button#calculate-bmi {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color, #0073aa);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

button#calculate-bmi:hover {
    background-color: var(--primary-hover, #005177);
}

#bmi-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    background: #f8f9fa;
    display: none;
}

#bmi-result.has-result {
    display: block;
}

.result-value {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

#bmi-score {
    color: var(--primary-color, #0073aa);
}

.result-category {
    font-size: 1.1em;
    font-weight: 500;
    margin-bottom: 10px;
}

.result-message {
    margin-bottom: 15px;
    line-height: 1.4;
}

.result-chart {
    margin-top: 15px;
}

.chart-bar {
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    margin-bottom: 5px;
}

.chart-segment {
    height: 100%;
    display: inline-block;
    position: relative;
}

.underweight {
    width: 17.5%;
    background: #5bc0de;
}

.normal {
    width: 32.5%;
    background: #5cb85c;
}

.overweight {
    width: 25%;
    background: #f0ad4e;
}

.obese {
    width: 25%;
    background: #d9534f;
}

.chart-marker {
    position: absolute;
    top: -5px;
    width: 4px;
    height: 30px;
    background: #333;
    transform: translateX(-50%);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
}

@media (max-width: 600px) {
    .advanced-bmi-calculator {
        padding: 15px;
    }
    
    .bmi-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .unit-switch {
        margin-top: 10px;
    }
}