/* BMI Calculator Styles */
#bmi-calculator-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    overflow: hidden;
}

/* Allow scrolling */
body {
    overflow-x: hidden;
    overflow-y: auto;
}

html, body {
    margin: 0;
    padding: 0;
    background: transparent;
}

.bmi-calculator-wrapper {
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    border: 1px solid #e1e8ed;
}
button#calculate-again-btn {
    margin: 10px auto;
    width: 200px;
    display: block;
}
.bmi-calculator-wrapper h3 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

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

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

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

.form-group label {
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #ffffff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.form-group input:invalid {
    border-color: #e74c3c;
}

.submit-group {
    text-align: center;
    margin-top: 30px;
}

.bmi-submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    min-width: 200px;
}

.bmi-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

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

.bmi-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Result Styles */
.bmi-result {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    border: 1px solid #dee2e6;
}

.result-header h4 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 600;
}

.result-content {
    text-align: center;
    margin-bottom: 30px;
}

.bmi-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.bmi-number {
    font-size: 48px;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.bmi-unit {
    font-size: 18px;
    color: #7f8c8d;
    font-weight: 500;
}

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

.bmi-description {
    font-size: 16px;
    color: #5a6c7d;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* BMI Category Colors */
.bmi-result .bmi-category {
    background: #ecf0f1;
    color: #2c3e50;
}

/* Chart Container */
.bmi-chart-container {
    margin: 30px 0;
    text-align: center;
}

.bmi-chart-container h5 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

#bmi-chart {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* BMI Reference Table */
.bmi-table {
    margin: 30px 0;
}

.bmi-table h5 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.bmi-reference-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.bmi-reference-table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.bmi-reference-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

.bmi-reference-table tbody tr {
    background: #ffffff;
    transition: all 0.3s ease;
}

.bmi-reference-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.02);
}

.bmi-reference-table tbody tr.highlighted {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.bmi-reference-table .underweight {
    border-left: 4px solid #3498db;
}

.bmi-reference-table .normal {
    border-left: 4px solid #2ecc71;
}

.bmi-reference-table .overweight {
    border-left: 4px solid #f39c12;
}

.bmi-reference-table .obese {
    border-left: 4px solid #e74c3c;
}

/* Water Intake Recommendation */
.water-intake-recommendation {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
    text-align: center;
}

.water-intake-recommendation h5 {
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.water-intake-recommendation p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* Error Styles */
.bmi-error {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Loading Animation */
.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loader::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    #bmi-calculator-container {
        padding: 10px;
    }
    
    .bmi-calculator-wrapper {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .bmi-calculator-wrapper h3 {
        font-size: 24px;
    }
    
    .bmi-number {
        font-size: 36px;
    }
    
    .bmi-category {
        font-size: 20px;
    }
    
    .bmi-reference-table {
        font-size: 14px;
    }
    
    .bmi-reference-table th,
    .bmi-reference-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .bmi-calculator-wrapper {
        padding: 15px;
    }
    
    .bmi-submit-btn {
        padding: 12px 30px;
        font-size: 16px;
        min-width: 180px;
    }
    
    .bmi-number {
        font-size: 32px;
    }
    
    .bmi-reference-table {
        font-size: 12px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-up {
    animation: slideUp 0.6s ease-out;
}

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

/* Pulse animation for highlighted table row */
.bmi-reference-table tbody tr.highlighted {
    animation: pulse 2s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1.02); }
}

/* BMI Result Overlay */
#bmi-result {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

#bmi-result.show {
    opacity: 1 !important;
    transform: scale(1) !important;
    visibility: visible !important;
}

#bmi-result.hidden {
    opacity: 0;
    transform: scale(0.9);
    visibility: hidden;
}

/* Speedometer needle pulse animation */
@keyframes needlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.needle-pulse {
    animation: needlePulse 2s infinite;
}

/* BMI Speedometer Container Styling */
.bmi-speedometer {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
    max-width: 100%;
    margin: 0 auto;
}

.speedometer-svg {
    display: block;
    overflow: visible;
    width: 100%;
    height: auto;
    max-width: 400px;
    margin: 0 auto;
}

/* Arc styling for crisp boundaries */
.underweight-arc,
.normal-arc,
.overweight-arc,
.obese-arc {
    stroke-linecap: butt;
    stroke-linejoin: miter;
    vector-effect: non-scaling-stroke;
}

/* Prevent color bleeding */
.bmi-speedometer svg {
    shape-rendering: geometricPrecision;
    text-rendering: geometricPrecision;
}