/* Wavesurfer Player Component Styles */

.player-controls {
    margin-bottom: var(--lg);
}

.waveform-container {
    margin-bottom: var(--md);
}

.controls {
    display: flex;
    gap: var(--md);
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}

.controls > * {
    flex-shrink: 0;
}

.control-button {
    background: var(--dark-medium);
    color: var(--dark-light);
    border: none;
    padding: var(--xs) var(--md);
    border-radius: var(--radius);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 7rem;  /* Fixed width to prevent jumping between "Play" and "Pause" */
    text-align: center;
}

.control-button:hover {
    background: var(--dark-medium-lighter);
}

/* Paused state - more muted */
.control-button:not(.playing) {
    background: var(--accent-base);
    color: var(--dark-base);
}

.control-button:not(.playing):hover {
    background: var(--accent-hover);
    color: var(--dark-base);
}

.time-display {
    color: var(--dark-light);
    font-size: var(--font-sm);
    min-width: 10ch;  /* Fix width to prevent jumping */
    text-align: left;
    white-space: nowrap;
}

.quality-toggle {
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Show quality toggle on hover */
.wavesurfer-player:hover .quality-toggle {
    opacity: 1;
}

.quality-toggle-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.quality-toggle-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.quality-toggle-switch {
    position: relative;
    display: inline-block;
    width: 3.5rem;
    height: 2rem;
    background-color: var(--dark-medium);
    border-radius: 9999px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.quality-toggle-label input:checked + .quality-toggle-switch {
    background-color: var(--accent-base);
}

.quality-toggle-switch::before {
    content: '';
    position: absolute;
    width: 1.6rem;
    height: 1.6rem;
    left: 0.2rem;
    bottom: 0.2rem;
    background-color: var(--dark-light);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quality-toggle-label input:checked + .quality-toggle-switch::before {
    transform: translateX(1.5rem);
}

/* Icons */
.quality-toggle-switch::after {
    content: '✕';
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-medium-lightest);
    font-size: var(--font-sm);
    font-weight: bold;
    transition: all 0.3s ease;
}

.quality-toggle-label input:checked + .quality-toggle-switch::after {
    content: '✓';
    left: 0.7rem;
    right: auto;
    color: var(--dark-base);
}

.quality-toggle-label span:last-child {
    margin-left: 0.75rem;
    color: var(--dark-light);
    font-size: var(--font-sm);
}

.annotations-section {
    margin-top: none;
}

.annotations-section .annotation-list {
    list-style: none;
    padding: 0;
}

.annotation-item {
    margin: var(--md) 0;
    color: var(--dark-medium-lightest);
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 4px solid transparent;
}

.annotation-item:hover {
    border-right: 4px solid var(--accent-base);
}

.annotation-item.active {
    color: var(--dark-light);
    border-right: 4px solid var(--accent-base);
}

.annotation-item.active .annotation-timestamp {
    color: var(--accent-base);
    font-weight: bold;
}

.annotation-timestamp {
    display: inline-block;
    color: var(--accent-base);
    font-weight: bold;
    margin-right: var(--xs);
}
