/* ═══════════════════════════════════════════════════════════════════════════════
   Level Queue Selector - SRS Level Range Filter
   A minimalist volume-bar style component for filtering review queue by level
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   Container
   ═══════════════════════════════════════════════════════════════════════════════ */

.lqs-container {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    user-select: none;
    -webkit-user-select: none;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Bars Container - The volume bar visualizer
   ═══════════════════════════════════════════════════════════════════════════════ */

.lqs-bars {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 4px 0;
    cursor: pointer;
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Individual Bars - Height increases with level (0-8)
   ═══════════════════════════════════════════════════════════════════════════════ */

.lqs-bar {
    /* Reset button styles */
    appearance: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    /* Component styles */
    width: 6px;
    border-radius: 2px;
    background: var(--text-muted, rgba(255, 255, 255, 0.25));
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, outline 0.15s ease;
    position: relative;
}

/* Focus styles for keyboard navigation */
.lqs-bar:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
    z-index: 5;
}

.lqs-bar:focus:not(:focus-visible) {
    outline: none;
}

.lqs-bar:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
    z-index: 5;
}

/* Mode-specific focus colors */
[data-mode="kanji"] .lqs-bar:focus-visible { outline-color: #3B82F6; }
[data-mode="vocab"] .lqs-bar:focus-visible { outline-color: #10B981; }
[data-mode="grammar"] .lqs-bar:focus-visible { outline-color: #FACC15; }
[data-mode="names"] .lqs-bar:focus-visible { outline-color: #EC4899; }
[data-mode="numbers"] .lqs-bar:focus-visible { outline-color: #06B6D4; }
[data-mode="sentences"] .lqs-bar:focus-visible { outline-color: #2DD4BF; }
[data-mode="radicals"] .lqs-bar:focus-visible { outline-color: #C084FC; }

/* Bar heights - linear progression from level 0 (shortest) to level 8 (tallest) */
.lqs-bar[data-level="0"] { height: 6px; }
.lqs-bar[data-level="1"] { height: 9px; }
.lqs-bar[data-level="2"] { height: 12px; }
.lqs-bar[data-level="3"] { height: 15px; }
.lqs-bar[data-level="4"] { height: 18px; }
.lqs-bar[data-level="5"] { height: 21px; }
.lqs-bar[data-level="6"] { height: 24px; }
.lqs-bar[data-level="7"] { height: 27px; }
.lqs-bar[data-level="8"] { height: 32px; }

/* ═══════════════════════════════════════════════════════════════════════════════
   Active State - Bars within selected range
   Mode-based colors using CSS custom properties
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Default/Global mode - white */
.lqs-bar.active {
    --lqs-color: rgba(255, 255, 255, 0.9);
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

/* Mode-specific colors - applied via data-mode on parent modal */
[data-mode="kanji"] .lqs-bar.active {
    --lqs-color: #3B82F6;
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
}

[data-mode="vocab"] .lqs-bar.active {
    --lqs-color: #10B981;
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

[data-mode="grammar"] .lqs-bar.active {
    --lqs-color: #FACC15;
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.5);
}

[data-mode="names"] .lqs-bar.active {
    --lqs-color: #EC4899;
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(236, 72, 153, 0.5);
}

[data-mode="numbers"] .lqs-bar.active {
    --lqs-color: #06B6D4;
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(6, 182, 212, 0.5);
}

[data-mode="sentences"] .lqs-bar.active {
    --lqs-color: #2DD4BF;
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(45, 212, 191, 0.5);
}

[data-mode="radicals"] .lqs-bar.active {
    --lqs-color: #C084FC;
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(192, 132, 252, 0.5);
}

/* Global mode explicitly - bright white */
[data-mode="global"] .lqs-bar.active {
    --lqs-color: rgba(255, 255, 255, 0.95);
    background: var(--lqs-color);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5);
}

/* Dimmed state for bars outside range */
.lqs-bar.inactive {
    background: var(--text-muted, rgba(255, 255, 255, 0.15));
    opacity: 0.35;
}

/* Hover effect on individual bars */
.lqs-bar:hover {
    transform: scaleY(1.08);
}

.lqs-bar.active:hover {
    filter: brightness(1.15);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Edge Markers - Visual indication of range bounds (removed for cleaner look)
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   Label - Shows current range (e.g., "Lvl 0-8" or "Lvl 3")
   ═══════════════════════════════════════════════════════════════════════════════ */

.lqs-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    letter-spacing: 0.03em;
    white-space: nowrap;
    min-width: 52px;
    text-align: center;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
}

/* Highlight label when not at default (0-8) - uses mode color */
.lqs-label.filtered {
    color: rgba(255, 255, 255, 0.9);
}

[data-mode="kanji"] .lqs-label.filtered { color: #3B82F6; }
[data-mode="vocab"] .lqs-label.filtered { color: #10B981; }
[data-mode="grammar"] .lqs-label.filtered { color: #FACC15; }
[data-mode="names"] .lqs-label.filtered { color: #EC4899; }
[data-mode="numbers"] .lqs-label.filtered { color: #06B6D4; }
[data-mode="sentences"] .lqs-label.filtered { color: #2DD4BF; }
[data-mode="radicals"] .lqs-label.filtered { color: #C084FC; }
[data-mode="global"] .lqs-label.filtered { color: rgba(255, 255, 255, 0.9); }

/* ═══════════════════════════════════════════════════════════════════════════════
   Tooltip - Shows level name on hover
   ═══════════════════════════════════════════════════════════════════════════════ */

.lqs-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary, #1a1a2e);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lqs-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--border, rgba(255, 255, 255, 0.15));
}

.lqs-bar:hover .lqs-tooltip {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Selection State - During drag selection
   ═══════════════════════════════════════════════════════════════════════════════ */

.lqs-bars.selecting .lqs-bar.in-selection {
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Reset Indicator - Removed for cleaner look
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   Empty State - Warning when no items in selected range
   ═══════════════════════════════════════════════════════════════════════════════ */

.lqs-container.empty .lqs-bar.active {
    --lqs-color: rgba(239, 68, 68, 0.7) !important;
    background: var(--lqs-color) !important;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4) !important;
}

.lqs-container.empty .lqs-label {
    color: rgba(239, 68, 68, 0.8) !important;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Responsive / Compact Mode
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .lqs-bars {
        gap: 3px;
    }
    
    .lqs-bar {
        width: 5px;
    }
    
    .lqs-bar[data-level="0"] { height: 5px; }
    .lqs-bar[data-level="1"] { height: 8px; }
    .lqs-bar[data-level="2"] { height: 10px; }
    .lqs-bar[data-level="3"] { height: 13px; }
    .lqs-bar[data-level="4"] { height: 15px; }
    .lqs-bar[data-level="5"] { height: 18px; }
    .lqs-bar[data-level="6"] { height: 20px; }
    .lqs-bar[data-level="7"] { height: 23px; }
    .lqs-bar[data-level="8"] { height: 26px; }
    
    .lqs-label {
        font-size: 10px;
        min-width: 44px;
    }
}
