/**
 * Waterfall Renderer Component Styles
 * Falling notes visualization with WebGL canvas
 */

.waterfall-container {
    position: relative;
    flex: 1;
    background: #111;
    border-bottom: 1px solid #333;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    contain: layout paint style;
}

#waterfall-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #111;
    cursor: crosshair;
}

/* Loading state */
.waterfall-container.loading {
    background: #111;
}

.waterfall-container.loading::before {
    content: 'Loading notes...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 14px;
    font-family: monospace;
    z-index: 1;
}

/* Error state */
.waterfall-container.error {
    background: #1a0a0a;
    border-color: #633;
}

.waterfall-container.error::before {
    content: 'WebGL Error - Check console';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #c66;
    font-size: 14px;
    font-family: monospace;
    z-index: 1;
}

/* Performance overlay (optional) */
.waterfall-stats {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #0f0;
    font-family: monospace;
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 3px;
    z-index: 2;
    display: none; /* Hidden by default */
}

.waterfall-stats.visible {
    display: block;
}

.waterfall-scrub-rail {
    position: fixed;
    top: 0;
    right: 28px;
    width: 36px;
    height: 190px;
    z-index: 8;
    cursor: ns-resize;
    pointer-events: auto;
    touch-action: none;
    overscroll-behavior: contain;
    opacity: var(--shortcuts-hud-active-opacity, 1);
    border: 1px solid var(--shortcuts-hud-border, rgba(255, 255, 255, 0.14));
    border-radius: 10px;
    background: var(--shortcuts-hud-bg, rgba(18, 18, 22, 0.92));
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.2) inset;
    transition: opacity 140ms ease;
}

.waterfall-scrub-rail::before {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    bottom: 3px;
    left: 3px;
    border-radius: 8px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.02) 34%,
        rgba(255, 255, 255, 0.00)
    );
    opacity: 0.62;
}

.waterfall-scrub-rail::after {
    content: '';
    position: absolute;
    top: var(--waterfall-scrub-track-top, 42px);
    bottom: var(--waterfall-scrub-track-bottom, 42px);
    left: 50%;
    width: 1px;
    border-radius: 1px;
    background: rgba(230, 238, 246, 0.10);
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 140ms ease, background 140ms ease;
}

.waterfall-scrub-rail__ticks {
    position: absolute;
    top: var(--waterfall-scrub-track-top, 42px);
    right: 0;
    bottom: var(--waterfall-scrub-track-bottom, 42px);
    left: 0;
}

.waterfall-scrub-rail__ticks span {
    position: absolute;
    left: 50%;
    width: var(--tick-width, 7px);
    height: var(--tick-height, 1px);
    border-radius: 3px;
    background: rgba(232, 239, 246, 0.74);
    opacity: var(--tick-opacity, 0.24);
    transform: translate(-50%, -50%);
    transition:
        background 140ms ease,
        opacity 140ms ease,
        width 140ms ease,
        height 140ms ease;
}

.waterfall-scrub-rail__position {
    position: absolute;
    left: 50%;
    top: 0;
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.88),
        rgba(240, 245, 252, 0.62)
    );
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.35),
        0 0 14px rgba(180, 210, 245, 0.2);
    transform: translate(-50%, -50%);
    transition:
        background 140ms ease,
        box-shadow 140ms ease,
        height 140ms ease,
        width 140ms ease;
}

.waterfall-scrub-rail__arrow {
    position: absolute;
    left: 50%;
    width: 14px;
    height: 14px;
    border-top: 3px solid rgba(232, 239, 246, 0.58);
    border-left: 3px solid rgba(232, 239, 246, 0.58);
    opacity: 0.62;
    transform-origin: center;
    transition:
        border-color 140ms ease,
        opacity 140ms ease,
        transform 140ms ease;
}

.waterfall-scrub-rail__arrow--up {
    top: 10px;
    transform: translateX(-50%) rotate(45deg);
}

.waterfall-scrub-rail__arrow--down {
    bottom: 10px;
    transform: translateX(-50%) rotate(225deg);
}

.waterfall-scrub-rail:hover::after,
.waterfall-scrub-rail.is-hovered::after,
.waterfall-scrub-rail.is-active::after {
    opacity: 0.7;
    background: rgba(230, 238, 246, 0.20);
}

.waterfall-scrub-rail:hover .waterfall-scrub-rail__ticks span,
.waterfall-scrub-rail.is-hovered .waterfall-scrub-rail__ticks span,
.waterfall-scrub-rail.is-active .waterfall-scrub-rail__ticks span {
    background: rgba(245, 249, 253, 0.90);
}

.waterfall-scrub-rail:hover .waterfall-scrub-rail__arrow,
.waterfall-scrub-rail.is-hovered .waterfall-scrub-rail__arrow,
.waterfall-scrub-rail.is-active .waterfall-scrub-rail__arrow {
    border-color: rgba(245, 249, 253, 0.86);
    opacity: 0.92;
}

.waterfall-scrub-rail:hover .waterfall-scrub-rail__arrow--up,
.waterfall-scrub-rail.is-hovered .waterfall-scrub-rail__arrow--up,
.waterfall-scrub-rail.is-active .waterfall-scrub-rail__arrow--up {
    transform: translateX(-50%) rotate(45deg) scale(1.04);
}

.waterfall-scrub-rail:hover .waterfall-scrub-rail__arrow--down,
.waterfall-scrub-rail.is-hovered .waterfall-scrub-rail__arrow--down,
.waterfall-scrub-rail.is-active .waterfall-scrub-rail__arrow--down {
    transform: translateX(-50%) rotate(225deg) scale(1.04);
}

.waterfall-scrub-rail:hover .waterfall-scrub-rail__position,
.waterfall-scrub-rail.is-hovered .waterfall-scrub-rail__position,
.waterfall-scrub-rail.is-active .waterfall-scrub-rail__position {
    width: 30px;
    height: 3px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.98),
        rgba(248, 250, 255, 0.78)
    );
    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.38),
        0 0 18px rgba(205, 225, 255, 0.28);
}

.waterfall-scrub-rail.is-disabled {
    opacity: 0;
    pointer-events: none;
}
