/**
 * Ideal Weight Calculator - Custom Stylesheet
 * High-contrast Light & Dark Mode, Apple Glassmorphism, Responsive Mobile Ergonomics
 */

/* 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.78);
}

.apple-card {
    background: #ffffff;
    border: 1px solid #e4e4e7;
    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 .apple-card {
    background: rgba(24, 24, 27, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
}

.apple-card:hover {
    border-color: rgba(244, 63, 94, 0.3);
    box-shadow: 0 10px 30px -10px rgba(244, 63, 94, 0.12);
}

/* Formula Highlight Cards */
.formula-card {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.formula-card:hover {
    transform: translateY(-2px);
    border-color: rgba(244, 63, 94, 0.4);
}

/* Validation Hint */
.ht-hint {
    margin: 0.35rem 0 0;
    font-size: 11px;
    color: #d97706;
    font-weight: 500;
}

.dark .ht-hint {
    color: #fbbf24;
}

/* Weight Spectrum Bar & Pin Animations */
.spectrum-pointer {
    transition: left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.spectrum-zone-ideal {
    transition: left 0.35s cubic-bezier(0.25, 0.8, 0.25, 1), width 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 8px rgba(225, 29, 72, 0.4);
}

/* Gender & Frame Buttons */
.gender-btn,
.frame-btn {
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 44px;
}

/* Mobile & Touch Target Ergonomics */
@media (max-width: 640px) {
    .preset-btn,
    .chart-filter-btn,
    .chart-unit-btn {
        min-height: 44px;
    }
}

/* ==========================================================================
   Reference Table Sticky Column Fix
   Ensures solid opaque background, correct stacking context, and zero text bleed
   when scrolled horizontally on mobile & desktop viewports
   ========================================================================== */
#ideal-weight-chart-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.ideal-chart-sticky-col {
    position: sticky !important;
    left: 0 !important;
    z-index: 20 !important;
    background-color: #ffffff !important;
    background-clip: padding-box !important;
    box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.08) !important;
}

.dark .ideal-chart-sticky-col {
    background-color: #18181b !important;
    box-shadow: 3px 0 6px -2px rgba(0, 0, 0, 0.45) !important;
}

#ideal-weight-chart-table thead tr th.ideal-chart-sticky-col {
    background-color: #f4f4f5 !important;
    z-index: 25 !important;
}

.dark #ideal-weight-chart-table thead tr th.ideal-chart-sticky-col {
    background-color: #18181b !important;
}

/* Row hover state updates the sticky column background consistently */
#ideal-weight-chart-table tbody tr:hover td.ideal-chart-sticky-col {
    background-color: #f9fafb !important;
}

.dark #ideal-weight-chart-table tbody tr:hover td.ideal-chart-sticky-col {
    background-color: #27272a !important;
}

/* Mobile scroll hint animation */
@keyframes pulse-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.mobile-scroll-hint {
    animation: pulse-subtle 3s ease-in-out infinite;
}

