/**
 * Souper Samplr — Frontend CSS
 * Design: clean B&W sketch layout matching the Souper Samplr drawing
 * 7 vertical faders + footer bar (branding | pills | waveform | master | M)
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=DM+Sans:wght@300;400;500&display=swap');

/* ── Container ─────────────────────────────────────────────────────────── */
.souper-samplr-container {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: #ffffff;
    border: 1.5px solid #1a1a1a;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 2px 0 rgba(0,0,0,0.06), 0 6px 32px rgba(0,0,0,0.08);
    width: 100%;
    /* height driven by content */
    min-height: 340px;
}

/* ── Fader row ─────────────────────────────────────────────────────────── */
.ss-fader-row {
    flex: 1;
    display: flex;
    align-items: stretch;
    padding: 24px 28px 16px;
    gap: 0;
    min-height: 260px;
}

/* ── Individual channel ────────────────────────────────────────────────── */
.ss-channel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    padding: 0 4px;
}

.ss-channel + .ss-channel {
    border-left: 1px solid #ebebeb;
}

/* play dot */
.ss-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid #1a1a1a;
    background: transparent;
    margin-bottom: 8px;
    flex-shrink: 0;
    transition: background 0.1s;
}

.ss-dot.on {
    background: #1a1a1a;
}

/* channel label */
.ss-label {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.04em;
    color: #1a1a1a;
    margin-bottom: 12px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

/* fader track */
.ss-fader-track-wrap {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    align-items: stretch;
}

.ss-fader-line {
    position: absolute;
    left: 50%;
    top: 0; bottom: 0;
    width: 1px;
    background: #1a1a1a;
    transform: translateX(-50%);
    pointer-events: none;
}

/* fader cap (the draggable rectangle) */
.ss-fader-cap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 24px;
    border: 1.5px solid #1a1a1a;
    border-radius: 3px;
    cursor: ns-resize;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.1s;
    user-select: none;
    /* top set inline by PHP */
}

.ss-fader-cap:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.ss-fader-cap.dragging {
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}

/* percentage label inside cap (shows on hover) */
.ss-cap-val {
    font-family: 'DM Mono', monospace;
    font-size: 7px;
    color: rgba(0,0,0,0.45);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.ss-fader-cap:hover .ss-cap-val,
.ss-fader-cap.dragging .ss-cap-val {
    opacity: 1;
}

/* "no audio" hint */
.ss-no-audio {
    font-family: 'DM Mono', monospace;
    font-size: 7.5px;
    color: #bbb;
    text-align: center;
    letter-spacing: 0.05em;
    line-height: 1.5;
    position: absolute;
    bottom: 12%;
    pointer-events: none;
}

/* playing state: dot on + subtle channel highlight */
.ss-channel.playing .ss-dot {
    background: #1a1a1a;
}

/* ── Footer bar ────────────────────────────────────────────────────────── */
.ss-footer {
    height: 60px;
    border-top: 1.5px solid #1a1a1a;
    display: flex;
    align-items: center;
    padding: 0 20px 0 22px;
    gap: 14px;
    flex-shrink: 0;
}

/* Branding */
.ss-brand {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: #1a1a1a;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mode pills */
.ss-pills {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ss-pill {
    height: 26px;
    min-width: 34px;
    border: 1.5px solid #1a1a1a;
    border-radius: 100px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    transition: background 0.12s, color 0.12s;
    color: #1a1a1a;
}

.ss-pill svg {
    width: 14px;
    height: 14px;
    display: block;
    stroke: currentColor;
}

.ss-pill:hover,
.ss-pill.active {
    background: #1a1a1a;
    color: #fff;
}

/* Waveform canvas */
.ss-wave-wrap {
    flex: 1;
    min-width: 0;
    height: 36px;
    display: flex;
    align-items: center;
}

.ss-wave-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Master fader (horizontal) */
.ss-master-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.ss-master-track {
    position: relative;
    width: 88px;
    height: 1px;
    background: #1a1a1a;
    cursor: pointer;
}

.ss-master-cap {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 28px;
    background: #1a1a1a;
    border-radius: 2px;
    cursor: ew-resize;
    transition: opacity 0.1s;
}

.ss-master-cap:hover {
    opacity: 0.65;
}

/* Dice / randomise button — plain square, not a toggle */
.ss-dice-btn {
    width: 28px;
    height: 28px;
    border: 1.5px solid #1a1a1a;
    border-radius: 5px;
    background: transparent;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

.ss-dice-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

.ss-dice-btn:hover {
    background: #1a1a1a;
    color: #fff;
}

/* M button */
.ss-m-btn {
    width: 28px;
    height: 28px;
    border: 1.5px solid #1a1a1a;
    border-radius: 3px;
    background: transparent;
    color: #1a1a1a;
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

.ss-m-btn:hover,
.ss-m-btn.muted {
    background: #1a1a1a;
    color: #fff;
}


/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .ss-fader-row {
        padding: 16px 12px 10px;
    }

    .ss-fader-cap {
        width: 36px;
        height: 20px;
    }

    .ss-brand {
        font-size: 11px;
    }

    .ss-footer {
        gap: 8px;
        padding: 0 12px;
    }

    .ss-master-track {
        width: 60px;
    }
}

/* ── Accessibility ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ss-fader-cap,
    .ss-pill,
    .ss-m-btn,
    .ss-dot {
        transition: none;
    }
}
