/* BMI Calculator Styles - Farsi Optimized */

.bmi-calculator-wrapper {
    font-family: 'Vazir', 'IRANSans', 'Tahoma', sans-serif;
    direction: rtl;
    text-align: right;
    max-width: 600px;
    margin: 30px auto;
    padding: 0 15px;
}

.bmi-calculator-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #eee;
}

/* Form Styles */
.bmi-form {
    margin-bottom: 30px;
}

.bmi-form-row {
    margin-bottom: 25px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.bmi-form-group {
    flex: 1;
    min-width: 200px;
}

.bmi-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.bmi-label-icon { display:none; }

.bmi-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.bmi-input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.bmi-input::placeholder {
    color: #999;
    font-size: 14px;
}

/* Gender Selection */
.bmi-gender-select {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.bmi-radio-label {
    flex: 1;
    cursor: pointer;
}

.bmi-radio-label input[type="radio"] {
    display: none;
}

.bmi-radio-custom {
    display: block;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #555;
}

.bmi-radio-label input[type="radio"]:checked + .bmi-radio-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Submit Button */
.bmi-submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.bmi-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.bmi-submit-btn:active {
    transform: translateY(0);
}

.bmi-btn-icon {
    font-size: 22px;
}

/* Result Section */
.bmi-result {
    margin-top: 24px;
    padding: 20px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #eee;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bmi-result-header {
    text-align: center;
    margin-bottom: 20px;
}

.bmi-result-title { font-size:18px; font-weight:700; color:#333; margin:0; }

.bmi-result-body {
    background: #ffffff;
    padding: 25px;
    border-radius: 15px;
}

.bmi-value-display { display:flex; justify-content:space-between; align-items:center; padding:14px 16px; border-radius:10px; margin-bottom:14px; border:1px solid #eee; }
.bmi-value-display.is-underweight { background:#ffe7e7; color:#d32f2f; border-color:#ffcdd2; }
.bmi-value-display.is-normal { background:#edf7ed; color:#2e7d32; border-color:#c8e6c9; }
.bmi-value-display.is-overweight { background:#fff7e0; color:#8d6e00; border-color:#ffecb3; }
.bmi-value-display.is-obese { background:#ffe5e5; color:#b71c1c; border-color:#ffcdd2; }

.bmi-value-label {
    font-size: 16px;
    font-weight: 600;
}

.bmi-value-number {
    font-size: 32px;
    font-weight: 700;
}

.bmi-category-display {
    text-align: center;
    margin-bottom: 20px;
}

.bmi-category-badge {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}


.bmi-category-badge.underweight { background:#42a5f5; }

.bmi-category-badge.normal { background:#81c784; }

.bmi-category-badge.overweight { background:#ffd54f; color:#333; }

.bmi-category-badge.obese { background:#ef5350; }

.bmi-description {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    text-align: center;
    margin-bottom: 20px;
    border-right: 4px solid #667eea;
}

/* BMI Chart */
.bmi-chart {
    margin-top: 25px;
}

.bmi-chart-bar { height:12px; border-radius:10px; position:relative; margin-bottom:10px;
    background: linear-gradient(to right,
        #42a5f5 0%, #42a5f5 25%, /* underweight = blue */
        #81c784 25%, #81c784 50%, /* normal = green */
        #ffd54f 50%, #ffd54f 75%, /* overweight = yellow */
        #ef5350 75%, #ef5350 100%  /* obese = red */);
}

.bmi-chart-indicator {
    position: absolute;
    top: -6px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 3px solid #667eea;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: inset-inline-start 0.5s ease;
}

/* Numeric ticks on bar */
.bmi-chart { position: relative; }
.bmi-chart-ticks { position: relative; height: 0; }
.bmi-chart-ticks .tick { position: absolute; top: -22px; transform: translateX(-50%); font-size: 12px; color:#777; }

/* Context color sync for value strip */
.bmi-value-display.is-underweight { background:#e3f2fd; color:#1565c0; border-color:#bbdefb; }

.bmi-chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    padding: 0 5px;
}

.bmi-chart-labels span {
    flex: 1;
    text-align: center;
}

/* Loading State */
.bmi-submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.bmi-submit-btn.loading::after {
    content: "...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .bmi-calculator-container {
        padding: 25px;
    }
    
    .bmi-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .bmi-form-group {
        min-width: 100%;
    }
    
    .bmi-value-display {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .bmi-chart-labels {
        font-size: 10px;
    }
}

/* RTL Support */
[dir="rtl"] .bmi-calculator-wrapper {
    direction: rtl;
}

/* Number Input - Remove Arrows */
.bmi-input::-webkit-outer-spin-button,
.bmi-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.bmi-input[type=number] {
    -moz-appearance: textfield;
}

