/* BMI Calculator Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --underweight: #3b82f6;
    --normal: #10b981;
    --overweight: #f59e0b;
    --obese: #ef4444;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

/* Calculator Card */
.calculator-card {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

/* Unit Toggle */
.unit-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-input);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.unit-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.unit-btn.active {
    background: var(--primary);
    color: white;
}

.unit-btn:hover:not(.active) {
    color: var(--text);
}

/* Input Section */
.input-section {
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    gap: 1rem;
}

.input-field {
    flex: 1;
}

.input-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.input-with-unit {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.input-with-unit input {
    flex: 1;
    padding: 0.875rem;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1.1rem;
    outline: none;
    min-width: 0;
}

.input-with-unit input::placeholder {
    color: var(--text-muted);
}

.input-with-unit .unit {
    padding: 0.875rem;
    background: var(--border);
    color: var(--text-muted);
    font-weight: 500;
    min-width: 45px;
    text-align: center;
}

.input-with-unit:focus-within {
    border-color: var(--primary);
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

.input-row .input-with-unit {
    flex: 1;
}

/* Calculate Button */
.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Results Section */
.results-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.bmi-result {
    text-align: center;
    margin-bottom: 1.5rem;
}

.bmi-value {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.bmi-category {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.bmi-category.underweight { color: var(--underweight); }
.bmi-category.normal { color: var(--normal); }
.bmi-category.overweight { color: var(--overweight); }
.bmi-category.obese { color: var(--obese); }

/* BMI Scale */
.bmi-scale {
    position: relative;
    margin: 2rem 0;
}

.scale-bar {
    display: flex;
    height: 40px;
    border-radius: 0.5rem;
    overflow: hidden;
}

.scale-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
}

.scale-segment.underweight { background: var(--underweight); }
.scale-segment.normal { background: var(--normal); }
.scale-segment.overweight { background: var(--overweight); }
.scale-segment.obese { background: var(--obese); }

.scale-marker {
    position: absolute;
    top: -8px;
    width: 4px;
    height: 56px;
    background: white;
    border-radius: 2px;
    transform: translateX(-50%);
    display: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.scale-marker::after {
    content: '▼';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 12px;
}

/* BMI Info & Weight Ranges */
.bmi-info {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.bmi-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.weight-ranges {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.weight-ranges h4 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.weight-ranges p {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
}

/* BMI Table Section */
.bmi-table-section {
    margin-bottom: 2rem;
}

.bmi-table-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.bmi-table {
    background: var(--bg-card);
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.table-row {
    display: flex;
}

.table-row.header {
    background: var(--bg-input);
    font-weight: 600;
}

.table-cell {
    flex: 1;
    padding: 1rem;
    text-align: center;
}

.table-row:not(.header) {
    border-top: 1px solid var(--border);
}

.table-row.underweight .table-cell:first-child { color: var(--underweight); }
.table-row.normal .table-cell:first-child { color: var(--normal); }
.table-row.overweight .table-cell:first-child { color: var(--overweight); }
.table-row.obese .table-cell:first-child { color: var(--obese); }

/* Features Section */
.features {
    margin-bottom: 2rem;
}

.features h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.feature {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    text-align: center;
    transition: transform 0.2s;
}

.feature:hover {
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature h3 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* FAQ Section */
.faq {
    margin-bottom: 2rem;
}

.faq h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.faq-category {
    margin-bottom: 1.5rem;
}

.faq-category-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
}

.faq-item {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
}

.faq-item h4 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

footer p:first-child {
    color: var(--text);
    margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }
    
    .calculator-card {
        padding: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .bmi-value {
        font-size: 3rem;
    }
    
    .scale-segment {
        font-size: 0.65rem;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-input);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
