:root {
    --iht-primary: #2563eb;
    --iht-bg: #ffffff;
    --iht-card-bg: #f8fafc;
    --iht-border: #e2e8f0;
    --iht-text: #1e293b;
    --iht-text-light: #64748b;
    --iht-error: #ef4444;
    
    --iht-underweight: #3b82f6;
    --iht-normal: #22c55e;
    --iht-overweight: #eab308;
    --iht-obese: #ef4444;
    --iht-obese-2: #dc2626;
    --iht-obese-3: #991b1b;
}

.iht-bmi-container {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--iht-text);
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    line-height: 1.5;
}

.iht-bmi-card {
    background: var(--iht-bg);
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    border: 1px solid var(--iht-border);
}

.iht-bmi-title {
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--iht-primary);
}

/* Tabs */
.iht-bmi-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--iht-border);
    padding-bottom: 2px;
}

.iht-bmi-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--iht-text-light);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.95rem;
}

.iht-bmi-tab:hover {
    color: var(--iht-primary);
    background: rgba(37, 99, 235, 0.05);
}

.iht-bmi-tab.active {
    color: var(--iht-primary);
    border-bottom: 3px solid var(--iht-primary);
    margin-bottom: -2px;
}

/* Form Layout */
.iht-bmi-tab-content {
    display: none;
}

.iht-bmi-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.iht-bmi-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
    .iht-bmi-row {
        grid-template-columns: 1fr;
    }
}

.iht-bmi-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.iht-bmi-field label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--iht-text);
}

.iht-bmi-field input[type="number"] {
    padding: 0.75rem;
    border: 1px solid var(--iht-border);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.iht-bmi-field input[type="number"]:focus {
    outline: none;
    border-color: var(--iht-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.iht-bmi-multi-input {
    display: flex;
    gap: 0.5rem;
}

.iht-bmi-multi-input input {
    flex: 1;
}

.iht-bmi-radio-group {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 0;
}

.iht-bmi-radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
}

/* Toggle Buttons */
.iht-bmi-toggle {
    display: flex;
    background: var(--iht-card-bg);
    padding: 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--iht-border);
}

.iht-bmi-toggle button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: none;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.35rem;
    color: var(--iht-text-light);
    transition: all 0.2s;
}

.iht-bmi-toggle button.active {
    background: var(--iht-bg);
    color: var(--iht-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Buttons */
.iht-bmi-actions {
    margin-top: 2rem;
    text-align: center;
}

.iht-bmi-calculate-btn {
    background: var(--iht-primary);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.iht-bmi-calculate-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.iht-bmi-calculate-btn:disabled {
    background: var(--iht-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.iht-bmi-reset-btn {
    background: none;
    border: 2px solid var(--iht-border);
    color: var(--iht-text-light);
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.2s;
}

.iht-bmi-reset-btn:hover {
    border-color: var(--iht-text-light);
    color: var(--iht-text);
}

/* Errors */
.iht-error {
    color: var(--iht-error);
    font-size: 0.8rem;
    height: 1rem;
}

/* Results */
.iht-bmi-results {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px dashed var(--iht-border);
    animation: fadeIn 0.5s ease;
}

.iht-bmi-result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.iht-bmi-main-val {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.iht-bmi-main-val small {
    font-size: 1rem;
    font-weight: 600;
    color: var(--iht-text-light);
}

.iht-bmi-category {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Gauge */
.iht-bmi-gauge-container {
    margin: 3rem 0;
}

.iht-bmi-gauge-bar {
    height: 20px;
    background: #eee;
    border-radius: 10px;
    display: flex;
    position: relative;
    overflow: visible;
}

.iht-bmi-gauge-segment {
    height: 100%;
}

.iht-bmi-gauge-segment.underweight { flex: 18.5; background: var(--iht-underweight); border-radius: 10px 0 0 10px; }
.iht-bmi-gauge-segment.normal { flex: 6.5; background: var(--iht-normal); }
.iht-bmi-gauge-segment.overweight { flex: 5; background: var(--iht-overweight); }
.iht-bmi-gauge-segment.obese { flex: 10; background: var(--iht-obese); border-radius: 0 10px 10px 0; }

.iht-bmi-gauge-pointer {
    position: absolute;
    top: -10px;
    width: 4px;
    height: 40px;
    background: var(--iht-text);
    left: 0;
    transition: left 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateX(-50%);
    border-radius: 2px;
    z-index: 2;
}

.iht-bmi-gauge-pointer::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--iht-text);
}

.iht-bmi-gauge-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--iht-text-light);
    padding: 0 5px;
}

/* Details Grid */
.iht-bmi-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 500px) {
    .iht-bmi-details-grid {
        grid-template-columns: 1fr;
    }
}

.iht-bmi-detail-item {
    background: var(--iht-card-bg);
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
}

.iht-bmi-detail-item .label {
    font-size: 0.8rem;
    color: var(--iht-text-light);
    margin-bottom: 0.25rem;
}

.iht-bmi-detail-item .value {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Tables */
.iht-bmi-tables {
    margin-top: 3rem;
}

.iht-bmi-tables h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--iht-primary);
    padding-left: 0.75rem;
}

.iht-bmi-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.iht-bmi-table th, .iht-bmi-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--iht-border);
}

.iht-bmi-table th {
    background: var(--iht-card-bg);
    font-weight: 700;
}

.iht-bmi-table tr.highlight-normal {
    background: rgba(34, 197, 94, 0.1);
    font-weight: 600;
}

/* Print Actions */
.iht-bmi-footer-actions {
    text-align: center;
    margin-top: 2rem;
}

.iht-bmi-print-btn {
    background: var(--iht-text);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.iht-bmi-print-btn:hover {
    opacity: 0.9;
}

@media print {
    .iht-bmi-actions, .iht-bmi-tabs, .iht-bmi-footer-actions, .iht-bmi-form-section {
        display: none !important;
    }
    .iht-bmi-card {
        box-shadow: none;
        border: none;
    }
}
