/* BMI Calculator Specific Styles */

/* Main layout grid - responsive for mobile */
.bmi-calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.unit-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.unit-toggle input[type="radio"] {
    display: none;
}

.unit-label {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    text-align: center;
    flex: 1;
}

.unit-toggle input[type="radio"]:checked + .unit-label {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
}

.unit-label:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-hover);
}

.unit-toggle input[type="radio"]:checked + .unit-label:hover {
    background: var(--primary-hover);
}

.unit-inputs {
    transition: var(--transition);
}

.input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
    pointer-events: none;
}

.form-group {
    position: relative;
}

.height-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group {
    position: relative;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* BMI Results */
.bmi-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.bmi-score {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.bmi-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.bmi-unit {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.5rem;
}

.bmi-category {
    text-align: center;
    margin-bottom: 2rem;
}

.category-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.category-badge.underweight {
    background: #e0f2fe;
    color: #0277bd;
    border: 1px solid #03a9f4;
}

.category-badge.normal {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.category-badge.overweight {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ff9800;
}

.category-badge.obese {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

[data-theme="dark"] .category-badge.underweight {
    background: rgba(3, 169, 244, 0.2);
    color: #4fc3f7;
}

[data-theme="dark"] .category-badge.normal {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

[data-theme="dark"] .category-badge.overweight {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

[data-theme="dark"] .category-badge.obese {
    background: rgba(244, 67, 54, 0.2);
    color: #e57373;
}

.category-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 400px;
    margin: 0 auto;
}

/* BMI Chart */
.bmi-chart {
    margin: 2rem 0;
}

.chart-bar {
    height: 40px;
    display: flex;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.chart-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.chart-segment.underweight {
    background: linear-gradient(135deg, #03a9f4, #0277bd);
    flex: 0.5;
}

.chart-segment.normal {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    flex: 1.3;
}

.chart-segment.overweight {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    flex: 1;
}

.chart-segment.obese {
    background: linear-gradient(135deg, #f44336, #c62828);
    flex: 2;
}

.chart-indicator {
    position: absolute;
    top: -5px;
    width: 3px;
    height: 50px;
    background: var(--text-primary);
    border-radius: 2px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Health Recommendations */
.health-recommendations {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.health-recommendations h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.health-recommendations ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.health-recommendations li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.health-recommendations li:last-child {
    border-bottom: none;
}

.health-recommendations li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* BMI Categories Grid */
.bmi-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.category-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.underweight-card::before {
    background: #03a9f4;
}

.normal-card::before {
    background: #4caf50;
}

.overweight-card::before {
    background: #ff9800;
}

.obese-card::before {
    background: #f44336;
}

.category-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.category-range {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.underweight-card .category-range {
    color: #0277bd;
}

.normal-card .category-range {
    color: #2e7d32;
}

.overweight-card .category-range {
    color: #f57c00;
}

.obese-card .category-range {
    color: #c62828;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Make the main grid single column on mobile */
    .bmi-calculator-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
    
    .unit-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .height-inputs {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .bmi-number {
        font-size: 2.5rem;
    }
    
    .bmi-categories-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-segment {
        font-size: 0.6875rem;
    }
}

@media (max-width: 576px) {
    /* Further mobile optimizations */
    .bmi-calculator-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .bmi-score {
        padding: 1.5rem;
    }
    
    .bmi-number {
        font-size: 2rem;
    }
    
    .category-badge {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .category-card {
        padding: 1rem;
    }
    
    .health-recommendations {
        padding: 1rem;
    }
}

/* Animation for BMI calculation */
.bmi-calculating {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* BMI score animation */
.bmi-score.result-animation {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
    70% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Print styles */
@media print {
    .btn,
    .form-actions {
        display: none;
    }
    
    .bmi-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-card {
        border: 1px solid #000;
        background: #f5f5f5;
    }
    
    .bmi-score {
        border: 2px solid #000;
        background: #f9f9f9;
    }
} 