/* ===================================== */
/*           PROGRESS BAR                */
/* ===================================== */

/* Контейнер прогресса */
.slider-wrapper {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.slider-base {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: height 0.2s ease;
}

.slider-wrapper:hover .slider-base {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
}

.slider-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    width: 0%;
    position: absolute;
    left: 0;
    top: 0;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    transition: width 0.1s ease;
}

/* Время */
.time-info-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    height: 30px;
    margin-top: 10px;
}

#currentTime, #timeLeft,
#expandedCurrentTime, #expandedTimeLeft {
    font-size: 12px;
    font-family: 'SF Mono', 'Menlo', monospace;
    color: var(--text-dim);
    min-width: 45px;
    text-align: center;
    transition: color 0.2s ease;
}

.slider-wrapper:hover ~ #currentTime,
.slider-wrapper:hover ~ #timeLeft {
    color: var(--text-main);
}

/* Буфер (preload) */
.slider-buffer {
    position: absolute;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transition: width 0.2s ease;
}

/* Тултип с временем */
.slider-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    border: 1px solid rgba(255,215,0,0.3);
    z-index: 10;
}

.slider-wrapper:hover .slider-tooltip {
    opacity: 1;
}

/* Маркеры (например, для разделения треков) */
.slider-marker {
    position: absolute;
    width: 2px;
    height: 100%;
    background: rgba(255, 215, 0, 0.3);
    transform: translateX(-50%);
    pointer-events: none;
}

/* Анимация пульсации при загрузке */
@keyframes progress-pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.player-bar.loading .slider-fill {
    animation: progress-pulse 1s ease infinite;
    background: linear-gradient(90deg, var(--accent), #ffaa00, var(--accent));
    background-size: 200% 100%;
}

/* Расширенный плеер */
.expanded-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 20px 0;
}

.expanded-time {
    font-size: 14px;
    color: var(--text-dim);
    min-width: 45px;
    text-align: center;
}

.expanded-slider-wrapper {
    flex: 1;
    height: 40px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.expanded-slider-base {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.expanded-slider-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    width: 0%;
    position: absolute;
    left: 0;
    top: 0;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Для мобилок */
@media (max-width: 768px) {
    .time-info-wrapper {
        height: 20px;
        margin-top: 4px;
        gap: 6px;
    }
    
    #currentTime, #timeLeft {
        font-size: 10px;
        min-width: 32px;
    }
    
    .slider-base {
        height: 3px;
    }
    
    .slider-wrapper:hover .slider-base {
        height: 4px;
    }
    
    .expanded-time {
        font-size: 12px;
        min-width: 40px;
    }
    
    .expanded-slider-wrapper {
        height: 30px;
    }
}

/* Анимация при перемотке */
@keyframes seek-pulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
    }
}

.seeking .slider-fill {
    animation: seek-pulse 0.5s ease infinite;
}

/* Темная тема (уже в variables) */
@media (prefers-color-scheme: dark) {
    .slider-base {
        background: rgba(255, 255, 255, 0.15);
    }
}