/**
 * EDU Streaming - Custom Player Styles
 * Modern, clean interface with #2FB61B accent color.
 */

.edu-player-wrapper {
    position: relative;
    width: 100%;
    /* 16:9 Aspect Ratio */
    padding-top: 56.25%;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    font-family: 'Inter', sans-serif;
    color: #fff;
}

.edu-player-wrapper.is-fullscreen {
    padding-top: 0;
    border-radius: 0;
    z-index: 9999;
}

.edu-player-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.edu-player-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    outline: none;
}

/* -------------------------------------------------------------------------- */
/* Loading Spinner                                                            */
/* -------------------------------------------------------------------------- */
.edu-player-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: opacity 0.3s;
    pointer-events: none;
}

.edu-player-loading.is-hidden {
    opacity: 0;
}

.edu-player-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #2FB61B;
    animation: edu-spin 1s ease-in-out infinite;
}

@keyframes edu-spin {
    to {
        transform: rotate(360deg);
    }
}

/* -------------------------------------------------------------------------- */
/* Big Play Button Overlay                                                   */
/* -------------------------------------------------------------------------- */
.edu-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: opacity 0.3s;
}

.edu-player-overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.edu-player-overlay__play {
    background: #2FB61B;
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 4px 20px rgba(47, 182, 27, 0.4);
    transition: transform 0.2s, background 0.2s;
}

.edu-player-overlay__play svg {
    width: 40px;
    height: 40px;
    margin-left: 4px;
    /* Optical center adjustment */
    fill: currentColor;
}

.edu-player-overlay__play:hover {
    transform: scale(1.1);
    background: #269e16;
}

/* -------------------------------------------------------------------------- */
/* Controls Bar                                                               */
/* -------------------------------------------------------------------------- */
.edu-player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
    padding: 40px 20px 20px;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Show controls when paused, hovered, or visible class added */
.edu-player-wrapper:not(.is-playing) .edu-player-controls,
.edu-player-wrapper.is-controls-visible .edu-player-controls {
    opacity: 1;
}

/* -------------------------------------------------------------------------- */
/* Progress Bar                                                               */
/* -------------------------------------------------------------------------- */
.edu-player-controls__progress {
    width: 100%;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    /* group: progress; - removed unknown property */
}

.edu-player-controls__progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: relative;
    transition: height 0.1s;
}

.edu-player-controls__progress:hover .edu-player-controls__progress-bar {
    height: 6px;
}

.edu-player-controls__progress-filled {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #2FB61B;
    border-radius: 2px;
    width: 0%;
}

.edu-player-controls__progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    width: 0%;
    z-index: -1;
}

.edu-player-controls__progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.1s;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.edu-player-controls__progress:hover .edu-player-controls__progress-handle {
    transform: translate(-50%, -50%) scale(1);
}

.edu-player-controls__progress-tooltip {
    position: absolute;
    bottom: 25px;
    left: 0;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.2s;
}

/* -------------------------------------------------------------------------- */
/* Bottom Controls Row                                                        */
/* -------------------------------------------------------------------------- */
.edu-player-controls__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edu-player-controls__left,
.edu-player-controls__right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.edu-player-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.2s, color 0.2s, transform 0.1s;
}

.edu-player-btn:hover,
.edu-player-btn:focus {
    opacity: 1;
    color: #2FB61B !important;
    background: transparent !important;
    box-shadow: none !important;
}

.edu-player-btn:active {
    transform: scale(0.95);
    background: transparent !important;
}

.edu-player-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    pointer-events: none;
}

/* Volume Slider */
.edu-player-volume {
    display: flex;
    align-items: center;
    gap: 0px;
    position: relative;
    /* Hover area for slider expansion */
}

.edu-player-volume__slider {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    margin-left: 5px;
}

.edu-player-volume:hover .edu-player-volume__slider,
.edu-player-volume__slider:hover {
    width: 80px;
}

.edu-player-volume__input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.edu-player-volume__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: transform 0.1s;
}

.edu-player-volume__input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Time */
.edu-player-time {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    min-width: 80px;
}

/* Speed Menu */
.edu-player-speed {
    position: relative;
}

.edu-player-btn--speed {
    font-weight: 700;
    font-size: 14px;
    width: 35px;
    /* Fixed width to prevent jumping */
}

.edu-player-speed__menu {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    border-radius: 8px;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    min-width: 80px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, bottom 0.2s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.edu-player-speed.is-open .edu-player-speed__menu {
    opacity: 1;
    visibility: visible;
    bottom: 50px;
}

.edu-player-speed__menu button {
    background: none;
    border: none;
    color: #ccc;
    padding: 6px 15px;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    width: 100%;
}

.edu-player-speed__menu button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.edu-player-speed__menu button.active {
    color: #2FB61B;
    font-weight: 700;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .edu-player-controls {
        padding: 20px 10px 10px;
    }

    .edu-player-overlay__play {
        width: 60px;
        height: 60px;
    }

    .edu-player-overlay__play svg {
        width: 30px;
        height: 30px;
    }

    .edu-player-time {
        font-size: 11px;
    }

    .edu-player-volume {
        display: none;
        /* Hide volume on mobile to save space */
    }
}