/**
 * Waist-to-Height Ratio (WHtR) Calculator - Custom Stylesheet
 * High-contrast Light & Dark Mode, Apple Glassmorphism, Anthropometric Gauge & Mobile Touch Ergonomics
 */

/* Background Grid & Ambient Glows */
.whtr-grid-bg {
    background-image: radial-gradient(rgba(16, 185, 129, 0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}

.dark .whtr-grid-bg {
    background-image: radial-gradient(rgba(16, 185, 129, 0.09) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Glass Surface Container & Apple Cards */
.whtr-glass-card,
.apple-card {
    background: rgba(255, 255, 255, 0.95);
    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);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.whtr-glass-card:hover,
.apple-card:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 10px 30px -10px rgba(16, 185, 129, 0.12);
}

.apple-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.dark .apple-glass {
    background: rgba(24, 24, 27, 0.65);
}

/* Segmented Preset Toolbar Buttons */
.whtr-preset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.75rem;
    color: rgb(113, 113, 122);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    user-select: none;
    white-space: nowrap;
}

.whtr-preset-btn:hover {
    color: rgb(24, 24, 27);
    background: rgba(0, 0, 0, 0.05);
}

.dark .whtr-preset-btn {
    color: rgb(161, 161, 170);
}

.dark .whtr-preset-btn:hover {
    color: rgb(255, 255, 255);
    background: rgba(255, 255, 255, 0.05);
}

.whtr-preset-btn.active {
    background: rgb(255, 255, 255);
    color: rgb(5, 150, 105);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.dark .whtr-preset-btn.active {
    background: rgb(39, 39, 42);
    color: rgb(52, 211, 153);
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Unit Switcher Pills */
.unit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.875rem;
    min-height: 40px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.625rem;
    color: rgb(113, 113, 122);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.unit-btn:hover {
    color: rgb(24, 24, 27);
}

.dark .unit-btn {
    color: rgb(161, 161, 170);
}

.dark .unit-btn:hover {
    color: rgb(255, 255, 255);
}

.unit-btn.active {
    background: rgb(255, 255, 255);
    color: rgb(5, 150, 105);
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dark .unit-btn.active {
    background: rgb(39, 39, 42);
    color: rgb(52, 211, 153);
    border-color: rgba(52, 211, 153, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Anthropometric Spectrum Gauge Visualizer (Matching BMI Standard) */
.whtr-gauge-container {
    position: relative;
    padding-top: 1.85rem;
}

.whtr-indicator-arrow {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    transition: left 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
    pointer-events: none;
}

.whtr-value-bubble {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 10px;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 0.375rem;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    transition: background-color 0.25s ease;
}

.whtr-caret {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: color 0.25s ease;
}

.whtr-gauge-track {
    height: 0.75rem;
    border-radius: 9999px;
    display: flex;
    overflow: hidden;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.whtr-gauge-segment {
    height: 100%;
    transition: all 0.3s ease;
}

.whtr-gauge-segment.is-active {
    filter: brightness(1.2) drop-shadow(0 0 6px currentColor);
    transform: scaleY(1.15);
}

/* Tier Matrix Row Active Styles */
.whtr-tier-row {
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.whtr-tier-row.is-active-tier {
    box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.08);
}
.whtr-tier-row.tier-active-sky {
    background: rgba(14, 165, 233, 0.08) !important;
    border-color: rgba(14, 165, 233, 0.45) !important;
}
.dark .whtr-tier-row.tier-active-sky {
    background: rgba(14, 165, 233, 0.15) !important;
    border-color: rgba(14, 165, 233, 0.55) !important;
}
.whtr-tier-row.tier-active-emerald {
    background: rgba(16, 185, 129, 0.08) !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
}
.dark .whtr-tier-row.tier-active-emerald {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.55) !important;
}
.whtr-tier-row.tier-active-amber {
    background: rgba(245, 158, 11, 0.08) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
}
.dark .whtr-tier-row.tier-active-amber {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: rgba(245, 158, 11, 0.55) !important;
}
.whtr-tier-row.tier-active-rose {
    background: rgba(244, 63, 94, 0.08) !important;
    border-color: rgba(244, 63, 94, 0.45) !important;
}
.dark .whtr-tier-row.tier-active-rose {
    background: rgba(244, 63, 94, 0.15) !important;
    border-color: rgba(244, 63, 94, 0.55) !important;
}

/* Benchmark Presets Chips in Card */
.whtr-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: rgba(241, 245, 249, 0.9);
    color: rgb(51, 65, 85);
    border: 1px solid rgba(203, 213, 225, 0.8);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dark .whtr-chip {
    background: rgba(30, 41, 59, 0.8);
    color: rgb(226, 232, 240);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.whtr-chip:hover {
    background: rgba(16, 185, 129, 0.12);
    color: rgb(5, 150, 105);
    border-color: rgba(16, 185, 129, 0.35);
}

.dark .whtr-chip:hover {
    background: rgba(16, 185, 129, 0.2);
    color: rgb(52, 211, 153);
    border-color: rgba(16, 185, 129, 0.45);
}

/* Canonical FAQ Accordion styles */
.tool-guide .tg-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgb(113, 113, 122);
}
.tool-guide .tg-eyebrow::before {
    content: "— ";
}

