/**
 * Blood Sugar & Diabetes Risk Calculator - Custom Stylesheet
 * High-contrast Light & Dark Mode, Apple Glassmorphism, ADA Glycemic Metrics & Mobile Touch Ergonomics
 */

/* Theme Variables */
:root {
    --bs-brand: #f43f5e;
    --bs-brand-hover: #e11d48;
    --bs-brand-light: rgba(244, 63, 94, 0.12);
    --tdee-brand-primary: #f43f5e;
    --tdee-brand-primary-hover: #e11d48;
    --tdee-brand-primary-light: rgba(244, 63, 94, 0.12);
}

/* Apple-style Glassmorphism & Elevation */
.apple-glass {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark .apple-glass {
    background: rgba(18, 18, 20, 0.85);
}

.tdee-glass-card {
    background: #ffffff;
    border: 1px solid rgba(228, 228, 231, 0.9);
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dark .tdee-glass-card {
    background: rgba(24, 24, 27, 0.75);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
}

.tdee-glass-card:hover {
    border-color: rgba(244, 63, 94, 0.3);
}

/* Primary Result Hero Card */
.tdee-result-card {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.06) 0%, rgba(244, 63, 94, 0.02) 100%), #ffffff;
    border: 1px solid rgba(244, 63, 94, 0.22);
    border-radius: 1.25rem;
    position: relative;
    overflow: hidden;
}

.dark .tdee-result-card {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.12) 0%, rgba(244, 63, 94, 0.04) 100%), #121215;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Typography & Hero Values */
.tdee-hero-value,
.tdee-compact-value {
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

.tdee-stat-chip {
    min-width: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.tdee-stat-chip:hover {
    transform: translateY(-1px);
}

/* Input Fields & Wrappers */
.tdee-input-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e4e4e7;
    background: #f8fafc;
    border-radius: 0.625rem;
    padding: 0.35rem 0.6rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .tdee-input-wrapper {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(24, 24, 27, 0.8);
}

.tdee-input-wrapper:focus-within {
    border-color: #f43f5e;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18);
}

.tdee-input-field {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.875rem;
    color: #18181b;
    outline: none;
    text-align: right;
    -moz-appearance: textfield;
}

.dark .tdee-input-field {
    color: #f4f4f5;
}

.tdee-input-field::-webkit-inner-spin-button,
.tdee-input-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Sliders */
.tdee-range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #e4e4e7;
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
    margin-top: 0.35rem;
}

.dark .tdee-range-slider {
    background: rgba(255, 255, 255, 0.12);
}

.tdee-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f43f5e;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(244, 63, 94, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.dark .tdee-range-slider::-webkit-slider-thumb {
    border-color: #18181b;
}

.tdee-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: #e11d48;
}

/* Visual Gauge Bar */
.indicator-arrow {
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.gauge-bar-segment {
    transition: opacity 0.2s ease;
}

.gauge-bar-segment:hover {
    opacity: 0.9;
}

/* Preset Buttons */
.preset-btn {
    min-height: 48px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.preset-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(244, 63, 94, 0.35);
}

.preset-btn:active {
    transform: scale(0.98);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
}

.dark .custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(161, 161, 170, 0.4);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(161, 161, 170, 0.7);
}

/* Touch Targets on Mobile */
@media (max-width: 640px) {
    .unit-btn,
    .system-btn,
    .fam-btn,
    .act-btn,
    .preset-btn {
        min-height: 44px;
    }
}
