.track-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
    height: 40px;
}

.speaker-name {
    width: 120px;
    padding: 5px 10px;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 3;
    background: white;
    border-right: 2px solid #eee;
}

.waveform-container {
    position: relative;
    height: 40px;
    flex-grow: 1;
    overflow: visible;
    margin-left: 10px;
}

.timeline-container {
    height: 30px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    margin-bottom: 10px;
}

.waveform-container {
    position: relative;
    height: 40px;
    margin-bottom: 25px;
    overflow: visible;
}

.speaker-name {
    position: sticky;
    left: 0;
    padding: 2px 10px;
    z-index: 2;
    min-width: 120px;
    display: inline-block;
    font-weight: bold;
}

.waveform-item {
    position: absolute;
    top: 25px;
    height: 40px;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 0;
    background-color: #dee2e6;
}

.start-time,
.duration, 
.endtime{
    position: absolute;
    font-size: 11px;
    color: #333;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 3;
}

.start-time {
    top: -22px;
    left: 0;
}
.duration {
    top: -22px;
    left: 50%;
}
.endtime {
    top: -22px;
    right: 0;
}

.waveform-item.marked {
    border: 2px solid #006600;
    box-shadow: 0 0 10px rgba(0, 200, 0, 0.5);
}

.waveform-item.playing {
    box-shadow: 0 0 10px rgba(0, 200, 0, 0.5);
}

.waveform-item {
    /* ... existing styles ... */
    cursor: grab;
    user-select: none;
    /* Prevent text selection while dragging */
    transition: transform 0.1s;
    /* Smooth dragging */
    will-change: transform;
    /* Optimize performance */
    transition: left 0.2s ease;
}

.waveform-item.dragging {
    cursor: grabbing;
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    z-index: 10;
    /* Bring to front during drag */
}

.waveform-item.dragging .start-time {
    color: #0066ff;
    font-weight: bold;
}

.waveform-container {
    /* ... existing styles ... */
    position: relative;
    min-height: 80px;
    /* Ensure container has space for drops */
}

.waveform-item[draggable="true"] {
    user-select: none;
    -webkit-user-drag: element;
    cursor: grab;
}

.waveform-item[draggable="true"]:active {
    cursor: grabbing;
}

.phantom {
    background-color: rgba(200, 200, 255, 0.7);
    border: 2px dashed #666;
    transition: transform 0.1s;
}

.drag-phantom {
    pointer-events: none;
    opacity: 0.8;
    transform: translate(-50%, -50%); /* Centers on cursor */
    transition: none; /* Remove if you want smooth movement */
}

.waveform-container {
    position: relative;
    overflow: visible; /* Ensure items can move freely */
}