/* BMI Calculator Styles */
.bmi-calculator-wrapper {
    max-width: 500px;
    margin: 20px auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.bmi-calculator {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e1e5e9;
}

.bmi-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
}

.bmi-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.bmi-header i {
    margin-right: 10px;
    font-size: 1.2em;
}

.bmi-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95em;
}

.form-group i {
    margin-right: 8px;
    color: #667eea;
    width: 16px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.height-input-group {
    display: flex;
    gap: 10px;
}

.height-input-group input {
    flex: 1;
}

.height-input-group select {
    width: 80px;
    flex-shrink: 0;
}

.bmi-calculate-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.bmi-calculate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.bmi-calculate-button:active {
    transform: translateY(0);
}

.bmi-calculate-button i {
    margin-right: 8px;
}

.bmi-result {
    padding: 0 30px 30px;
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
}

.result-header h4 {
    color: #2d3748;
    margin: 0;
    font-size: 1.3em;
}

.result-header i {
    color: #667eea;
    margin-right: 8px;
}

.result-content {
    text-align: center;
}

.bmi-value {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.bmi-value::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

#bmi-score {
    display: block;
    font-size: 3em;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    position: relative;
}

.bmi-label {
    font-size: 1.1em;
    opacity: 0.9;
    position: relative;
}

.bmi-category {
    margin-bottom: 15px;
}

#bmi-category-text {
    font-size: 1.4em;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 25px;
    display: inline-block;
}

.bmi-message {
    margin-bottom: 25px;
}

#bmi-message-text {
    color: #4a5568;
    font-size: 1em;
    line-height: 1.5;
    margin: 0;
    padding: 0 10px;
}

.bmi-chart {
    position: relative;
    margin-top: 30px;
}

.chart-bar {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-segment {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.7em;
    font-weight: 600;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.chart-segment span {
    display: block;
    line-height: 1.2;
}

.chart-segment.underweight {
    background: #63b3ed;
}

.chart-segment.normal {
    background: #68d391;
}

.chart-segment.overweight {
    background: #faf089;
    color: #744210;
}

.chart-segment.obese {
    background: #fc8181;
}

.chart-indicator {
    position: absolute;
    top: -15px;
    width: 4px;
    height: 70px;
    background: #2d3748;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: left 0.5s ease;
    z-index: 10;
}

.chart-indicator::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #2d3748;
}

/* Category Colors */
.category-underweight {
    color: #3182ce;
    background: #bee3f8;
}

.category-normal {
    color: #38a169;
    background: #c6f6d5;
}

.category-overweight {
    color: #d69e2e;
    background: #fefcbf;
}

.category-obese {
    color: #e53e3e;
    background: #fed7d7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bmi-calculator-wrapper {
        margin: 10px;
        max-width: none;
    }
    
    .bmi-form {
        padding: 20px;
    }
    
    .bmi-result {
        padding: 0 20px 20px;
    }
    
    .height-input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .height-input-group select {
        width: 100%;
    }
    
    .chart-segment {
        font-size: 0.6em;
    }
    
    #bmi-score {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .bmi-header {
        padding: 20px 15px;
    }
    
    .bmi-header h3 {
        font-size: 1.3em;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .bmi-calculate-button {
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .chart-segment span {
        display: none;
    }
    
    .chart-segment span:first-child {
        display: block;
        font-size: 0.8em;
    }
}

/* Loading State */
.bmi-calculate-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.bmi-calculate-button.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.form-group input.error {
    border-color: #fc8181;
    background-color: #fed7d7;
}

.error-message {
    color: #e53e3e;
    font-size: 0.85em;
    margin-top: 5px;
    display: none;
}