/* BMI Calculator Styles - Complete Version */
#bmi-calculator-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.bmi-calc-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.bmi-title {
    background: linear-gradient(135deg, #00903B 0%, #00b847 100%);
    color: white;
    margin: 0;
    padding: 25px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

/* Form Styling with Reduced Spacing */
.bmi-form {
    padding: 20px;
    background: #f8f9fa;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    line-height: 1.4;
    height: auto;
    background: white;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    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='%2300903B' 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");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00903B;
    box-shadow: 0 0 0 3px rgba(0, 144, 59, 0.1);
}

/* Beautiful Radio Buttons */
.radio-group {
    display: flex;
    gap: 10px;
    padding: 0;
}

.radio-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-group label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: 2px solid #ddd;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    font-weight: 500;
    position: relative;
    flex: 1;
    text-align: center;
}

.radio-group label:hover {
    border-color: #00903B;
    background: #f0f9f4;
}

.radio-group input[type="radio"]:checked + label {
    background: #00903B;
    border-color: #00903B;
    color: white;
}

.radio-group input[type="radio"]:checked + label:before {
    content: '✓';
    position: absolute;
    left: 12px;
    color: white;
    font-weight: bold;
}

/* Submit Button */
.bmi-submit-btn {
    background: linear-gradient(135deg, #00903B 0%, #00b847 100%);
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    margin: 20px auto 0;
}

.bmi-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 144, 59, 0.3);
}

/* Results Section */
.bmi-results {
    padding: 20px;
}

.result-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.result-card h3 {
    color: #333;
    font-size: 20px;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* BMI Display */
.bmi-display {
    text-align: center;
    padding: 20px;
}

.bmi-value-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.bmi-value {
    font-size: 48px;
    font-weight: bold;
    color: #00903B;
}

.bmi-unit {
    font-size: 18px;
    color: #666;
}

.bmi-status {
    font-size: 24px;
    font-weight: 600;
    margin-top: 10px;
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
}

.bmi-status.underweight {
    background: #ffeaa7;
    color: #fdcb6e;
}

.bmi-status.normal {
    background: #d1f2eb;
    color: #00b894;
}

.bmi-status.overweight {
    background: #fab1a0;
    color: #e17055;
}

.bmi-status.obese {
    background: #ff7675;
    color: white;
}

/* BMI Chart */
.bmi-chart {
    margin-top: 30px;
    position: relative;
}

.bmi-scale {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    margin-bottom: 10px;
}

.scale-item {
    padding: 15px 10px;
    text-align: center;
    border-radius: 8px;
}

.scale-item.underweight {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
}

.scale-item.normal {
    background: linear-gradient(135deg, #55efc4, #00b894);
}

.scale-item.overweight {
    background: linear-gradient(135deg, #fab1a0, #e17055);
}

.scale-item.obese {
    background: linear-gradient(135deg, #ff7675, #d63031);
}

.scale-label {
    display: block;
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
}

.scale-value {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
}

.bmi-indicator {
    position: absolute;
    bottom: -20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 15px solid #333;
    transition: left 0.5s ease;
}

/* Calorie Information */
.calorie-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.calorie-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.calorie-label {
    font-weight: 500;
    color: #555;
}

.calorie-value {
    font-size: 20px;
    font-weight: bold;
    color: #00903B;
}

.calorie-recommendation {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-left: 4px solid #00903B;
    border-radius: 4px;
    color: #00903B;
    font-weight: 500;
    line-height: 1.6;
}

/* Food Recommendations */
.food-recommendations {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.food-column {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.food-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
}

.food-title.should-eat {
    color: #00b894;
}

.food-title.should-avoid {
    color: #e17055;
}

.food-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.food-list li {
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

.food-list li:last-child {
    border-bottom: none;
}

/* Related Posts */
.related-posts {
    display: grid;
    gap: 12px;
}

.related-post-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #00903B;
    transition: transform 0.2s ease;
}

.related-post-item:hover {
    transform: translateX(5px);
    background: #f0f1f3;
}

.related-post-item a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.related-post-item a:before {
    content: "📄";
    margin-right: 10px;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .food-recommendations {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bmi-scale {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #bmi-calculator-wrapper {
        padding: 10px;
    }
    
    .bmi-form,
    .bmi-results {
        padding: 15px;
    }
    
    .bmi-value {
        font-size: 36px;
    }
    
    .radio-group {
        flex-direction: row;
    }
    
    .radio-group label {
        padding: 8px 16px;
        font-size: 14px;
    }
}

/* Loading State */
.bmi-loading {
    text-align: center;
    padding: 20px;
}

.bmi-loading:after {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #00903B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.bmi-success-message {
    background: #d1f2eb;
    color: #00b894;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 500;
}

/* Fix for Flatsome theme compatibility */
#bmi-calculator-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
}

#bmi-calculator-wrapper input,
#bmi-calculator-wrapper select {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

/* Additional compact adjustments */
.bmi-calc-container h2,
.bmi-calc-container h3,
.bmi-calc-container h4 {
    margin-top: 0;
}

/* Ensure proper spacing in form */
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 40px;
}