/**
 * assets/lms/slovo-player.css
 *
 * Slovo Player (задача 6.2) — единый HTML5 MP4-плеер.
 * Селекторы с префиксом html body.slovo-lms-body, свойства с !important.
 *
 * Блоки:
 *   1. Обёртка плеера (.slovo-player / -video);
 *   2. Панель управления (.slovo-player-controls);
 *   3. Кнопки (.slovo-player-btn + состояния);
 *   4. Полоса прогресса;
 *   5. Полоса громкости + mute;
 *   6. Таймер;
 *   7. Меню скорости;
 *   8. Режим :fullscreen и автоскрытие панели.
 */

/* ---------- 1. Обёртка плеера ---------- */

html body.slovo-lms-body .slovo-player {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #000 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin: 0 0 16px !important;
    line-height: 0 !important;
}

html body.slovo-lms-body .slovo-player-video {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    background: #000 !important;
    cursor: pointer !important;
}

/* ---------- 2. Панель управления ---------- */

html body.slovo-lms-body .slovo-player-controls {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.75) 100%) !important;
    opacity: 1 !important;
    transition: opacity 0.25s ease !important;
    line-height: 1.2 !important;
}

html body.slovo-lms-body .slovo-player.is-controls-hidden .slovo-player-controls {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ---------- 3. Кнопки ---------- */

html body.slovo-lms-body .slovo-player-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 32px !important;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    transition: background 0.15s ease !important;
}

html body.slovo-lms-body .slovo-player-btn:hover {
    background: rgba(255, 255, 255, 0.28) !important;
}

html body.slovo-lms-body .slovo-player-btn:focus-visible {
    outline: 2px solid #90caf9 !important;
    outline-offset: 1px !important;
}

html body.slovo-lms-body .slovo-player-ico-pause {
    display: none !important;
}

html body.slovo-lms-body .slovo-player.is-playing .slovo-player-ico-play {
    display: none !important;
}

html body.slovo-lms-body .slovo-player.is-playing .slovo-player-ico-pause {
    display: inline !important;
}

/* ---------- 4. Полоса прогресса ---------- */

html body.slovo-lms-body .slovo-player-progress {
    position: relative !important;
    flex: 1 1 120px !important;
    height: 8px !important;
    min-width: 80px !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    cursor: pointer !important;
}

html body.slovo-lms-body .slovo-player-progress-loaded {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 0 !important;
    border-radius: 4px !important;
    background: rgba(255, 255, 255, 0.35) !important;
}

html body.slovo-lms-body .slovo-player-progress-played {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 0 !important;
    border-radius: 4px !important;
    background: #1976d2 !important;
}

html body.slovo-lms-body .slovo-player-progress-handle {
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    width: 14px !important;
    height: 14px !important;
    margin-left: -7px !important;
    border-radius: 50% !important;
    background: #fff !important;
    transform: translateY(-50%) !important;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.6) !important;
    pointer-events: none !important;
}

/* ---------- 5. Полоса громкости + mute ---------- */

html body.slovo-lms-body .slovo-player-volume-wrap {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

html body.slovo-lms-body .slovo-player-volume {
    position: relative !important;
    width: 70px !important;
    height: 6px !important;
    border-radius: 3px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    cursor: pointer !important;
}

html body.slovo-lms-body .slovo-player-volume-level {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    height: 100% !important;
    width: 100% !important;
    border-radius: 3px !important;
    background: #1976d2 !important;
}

html body.slovo-lms-body .slovo-player-volume-handle {
    position: absolute !important;
    top: 50% !important;
    left: 100% !important;
    width: 12px !important;
    height: 12px !important;
    margin-left: -6px !important;
    border-radius: 50% !important;
    background: #fff !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}

html body.slovo-lms-body .slovo-player.is-muted .slovo-player-volume-level {
    background: rgba(255, 255, 255, 0.4) !important;
}

/* ---------- 6. Таймер ---------- */

html body.slovo-lms-body .slovo-player-time {
    color: #fff !important;
    font-size: 12px !important;
    font-variant-numeric: tabular-nums !important;
    white-space: nowrap !important;
    user-select: none !important;
}


/* ---------- 7. Меню скорости ---------- */

html body.slovo-lms-body .slovo-player-speed-wrap {
    position: relative !important;
}

html body.slovo-lms-body .slovo-player-speed-menu {
    position: absolute !important;
    right: 0 !important;
    bottom: calc(100% + 6px) !important;
    display: none !important;
    flex-direction: column !important;
    min-width: 68px !important;
    padding: 4px !important;
    border-radius: 6px !important;
    background: rgba(20, 20, 20, 0.95) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
    z-index: 5 !important;
}

html body.slovo-lms-body .slovo-player.is-speed-open .slovo-player-speed-menu {
    display: flex !important;
}

html body.slovo-lms-body .slovo-player-speed-item {
    padding: 6px 10px !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 13px !important;
    text-align: left !important;
    cursor: pointer !important;
}

html body.slovo-lms-body .slovo-player-speed-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

html body.slovo-lms-body .slovo-player-speed-item.is-active {
    background: #1976d2 !important;
}

/* ---------- 8. Режим :fullscreen и автоскрытие ---------- */

html body.slovo-lms-body .slovo-player:fullscreen {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

html body.slovo-lms-body .slovo-player:fullscreen .slovo-player-video {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
}

html body.slovo-lms-body .slovo-player.is-fullscreen {
    border-radius: 0 !important;
}

