/* Video Timeline Interactive Styles */

/* Make the timeline larger on hover for easier clicking */
#videoTimeline {
    transition: height 0.2s ease, background-color 0.1s ease;
    position: relative;
}

#videoTimeline:hover {
    height: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Always show seek handle when hovering timeline */
#videoTimeline:hover #seekHandle {
    opacity: 1 !important;
}

/* Seek handle styling */
#seekHandle {
    transition: opacity 0.2s ease, transform 0.1s ease;
    z-index: 10;
}

#videoTimeline:hover #seekHandle {
    transform: translateY(-50%) translateX(-50%) scale(1.2);
}

/* Progress bar should be pointer-events-none to allow clicking through */
#videoProgress {
    pointer-events: none;
    position: relative;
    z-index: 1;
}

/* Add a hover effect to show where the user will seek to */
#videoTimeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(96, 165, 250, 0.3);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 0;
}

#videoTimeline:hover::before {
    opacity: 1;
    width: var(--hover-position, 0%);
}

/* Make the controls more interactive */
.playback-controls button {
    position: relative;
    overflow: hidden;
}

.playback-controls button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.playback-controls button:active::after {
    width: 100%;
    height: 100%;
}

/* Timeline buffer/loading indicator */
#videoTimeline .buffer-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(156, 163, 175, 0.3);
    z-index: 0;
    pointer-events: none;
}

/* Time tooltip on hover */
.timeline-tooltip {
    position: absolute;
    bottom: 100%;
    left: var(--tooltip-position, 0%);
    transform: translateX(-50%) translateY(-4px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 20;
}

#videoTimeline:hover .timeline-tooltip {
    opacity: 1;
}

/* Add smooth animation when seeking */
#videoProgress.seeking {
    transition: none !important;
}

/* Visual feedback for playback speed */
.playback-controls button[onclick="changeSpeed()"].speed-changed {
    animation: speedPulse 0.5s ease;
}

@keyframes speedPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}