/* ========== GENERAL PREVIEW ========== */

.preview-box {
    border: 1px solid #ddd;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 4px;
}

/* ========== SONG WRAPPER ========== */

#songWrapper {
    position: relative;
    height: 260px;
    overflow-x: auto;
    border: 1px solid #ccc;
    background: #fafafa;
}

/* ========== BACKGROUND GRID (60s) ========== */

#songGrid {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            to right,
            #e0e0e0 0px,
            #e0e0e0 1px,
            transparent 1px,
            transparent 20px
        ),
        repeating-linear-gradient(
            to bottom,
            #f0f0f0 0px,
            #f0f0f0 1px,
            transparent 1px,
            transparent 40px
        );
    pointer-events: none;
    z-index: 0;
}

/* ========== TRACK STACK ========== */

#songTracks {
    position: relative;
    min-width: 1200px; /* 60s × 20px */
    z-index: 1;
}

.song-track {
    position: relative;
    height: 40px;
    border-bottom: 1px solid #ddd;
}

#playhead {
    position: absolute;
    top: 0;
    height: 100%;
    width: 2px;
    background: red;
    z-index: 20;
    pointer-events: none;
}

/* ========== CLIP ========== */

.clip {
    position: absolute;
    top: 10px;
    height: 20px;

    display: flex;
    align-items: center;
    gap: 4px;

    cursor: grab;
}

.clip:active {
    cursor: grabbing;
}

/* ========== CLIP ICON ========== */

.clip-icon {
    height: 100%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-icon img {
    height: 100%;
    width: auto;
    object-fit: contain;
    opacity: 0.8;
}
.thick-hr {
  border: none;
  border-top: 5px solid #343537; /* Bootstrap primary blue */
  margin: 2rem 0;
  border-radius: 2px;
}
/* ========== WAVEFORM ========== */

.clip img {
    height: 100%;
    display: block;
    pointer-events: none;
}

.clip-waveform {
    background-color: #57f011; /* or category color */
    
    -webkit-mask-image: url('data:image/png;base64,${waveformData.timeseries}');
    mask-image: url('data:image/png;base64,${waveformData.timeseries}');

    -webkit-mask-repeat: repeat-x; /* repeat single loop */
    mask-repeat: repeat-x;

    -webkit-mask-size: ${singleLoopWidthPx}px 100%; /* size of one loop */
    mask-size: ${singleLoopWidthPx}px 100%;

    width: ${containerWidthPx}px; /* total width = loops × PX_PER_SECOND */
    height: 100%;
}



/* category colors */
.clip.biological {
    --waveform-color: orange;
}

.clip.anthropogenic {
    --waveform-color: green;
}

.clip.environmental {
    --waveform-color: blue;
}
/* Highlight selected clip */
.clip.selected {
    border: 2px solid #0d6efd; /* bootstrap primary blue */
    box-shadow: 0 0 6px #0d6efd88;
    z-index: 10; /* above others */
}

/* ========== SONG CONTROLS ========== */

.song-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.song-controls button {
    padding: 6px 10px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Waveform / Spectrogram corner clippies */
.clippy-helper {
    position: absolute;
    bottom: 4px;
    right: 4px;

    width: 60px !important;
    height: 60px !important;

    max-width: 60px !important;
    max-height: 60px !important;

    object-fit: contain;
    cursor: pointer;
    z-index: 10;
}

/* Slider/control clippies */
.control-clippy {
    width: 48px !important;
    height: 48px !important;

    max-width: 48px !important;
    max-height: 48px !important;

    object-fit: contain;
    cursor: pointer;
    flex-shrink: 0;
}



