/**
 * ================================================================
 * TPLAYER v3.0.0
 * Стили профессионального видеоплеера
 * Разработано TStudios
 * ================================================================
 */

/* Основной контейнер */
.tplayer {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    line-height: 1.5;
}

/* Видео элемент */
.tplayer__video {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

/* Контроллы */
.tplayer__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    padding: 20px 16px 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 10;
}

.tplayer__controls--visible {
    opacity: 1;
    visibility: visible;
}

/* Прогресс бар */
.tplayer__progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tplayer__progress-bar {
    flex: 1;
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.24);
    border-radius: 2px;
    cursor: pointer;
    transition: height 0.2s ease;
}

.tplayer__progress-bar:hover {
    height: 6px;
}

.tplayer__progress-buffered {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.32);
    border-radius: 2px;
    width: 0%;
}

.tplayer__progress-filled {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #ff0000;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.tplayer__progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #ff0000;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    box-shadow: 0 0 0 2px #ff0000;
}

.tplayer__progress-bar:hover .tplayer__progress-handle {
    opacity: 1;
}

/* Время */
.tplayer__time {
    font-size: 12px;
    color: #fff;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Нижняя панель */
.tplayer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tplayer__controls-left,
.tplayer__controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Кнопки */
.tplayer__btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 6px;
    opacity: 0.85;
}

.tplayer__btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

.tplayer__btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Управление громкостью */
.tplayer__volume {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tplayer__volume-slider {
    width: 70px;
    height: 4px;
    background: rgba(255, 255, 255, 0.24);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: width 0.2s ease;
}

@media (min-width: 768px) {
    .tplayer__volume-slider {
        width: 80px;
    }
}

.tplayer__volume-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #ff0000;
    border-radius: 2px;
    width: 100%;
}

/* Меню настроек */
.tplayer__menu {
    position: absolute;
    bottom: 70px;
    right: 16px;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    min-width: 160px;
    z-index: 20;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tplayer__menu--hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
}

.tplayer__menu-inner {
    padding: 8px 0;
}

.tplayer__menu-item {
    display: block;
    width: 100%;
    padding: 8px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
}

.tplayer__menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tplayer__menu-item--active {
    color: #ffffff;  /* ← ТОЛЬКО ЭТО ИЗМЕНИЛОСЬ */
    font-weight: 500;
}

.tplayer__menu-footer {
    padding: 10px 20px 8px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 4px;
}

/* Индикатор загрузки */
.tplayer__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 15;
}

.tplayer__loading--visible {
    opacity: 1;
    visibility: visible;
}

.tplayer__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tplayer-spin 0.8s linear infinite;
}

@keyframes tplayer-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Мобильная адаптация */
@media (max-width: 640px) {
    .tplayer__controls {
        padding: 16px 12px 10px;
    }
    
    .tplayer__btn svg {
        width: 18px;
        height: 18px;
    }
    
    .tplayer__time {
        font-size: 11px;
    }
}
