.video-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background-color: #000;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 0 20px var(--shadow);
    font-family: "Roboto", sans-serif;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 5;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-overlay-icon {
    width: 80px;
    height: 80px;
    filter: invert(100%);
    opacity: 0.9;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.play-overlay:hover .play-overlay-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Controls Overlay */
.controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0) 100%);
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 10;
}

/* Make controls visible when hovered or when video is paused/playing (more user-friendly) */
.video-container:hover .controls-overlay,
.video-container.paused .controls-overlay,
.video-container.playing.show-controls .controls-overlay {
    opacity: 1;
}

/* Hide controls completely when video is playing and not hovered after a short delay */
.video-container.playing.hide-controls .controls-overlay {
    opacity: 0;
}

.controls-bar {
    display: flex;
    align-items: center;
    gap: 25px;
    color: #fff;
}

/* Buttons */
.controls-bar button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease-in-out, transform 0.2s ease-in-out;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
}

.controls-bar button:hover {
    color: var(--primary-color);
    transform: scale(1.15);
}

.controls-bar img {
    width: 28px;
    height: 28px;
    filter: invert(100%);
}

/* Progress Bar */
.progress-bar-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 15px;
    height: 28px;
}

.progress-bar {
    padding: 0;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    background: #ffffffa4;
    border-radius: var(--border-radius);
    cursor: pointer;
    outline: none;
    transition: height 0.2s ease-in-out;
    position: relative;
}

.progress-bar::-webkit-slider-thumb {
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: grab;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease-in-out;
    border: 2px solid #fff;
}

.progress-bar::-moz-range-thumb {
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: grab;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    border: 2px solid #fff;
}

/* Time Display */
.time-display {
    font-size: 1.05em;
    white-space: nowrap;
    color: #fff;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.volume-slider {
    padding: 0;
    width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 10px;
    background: #fff;
    border-radius: var(--border-radius);
    cursor: pointer;
    outline: none;
    transition: width 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 0;
}

.volume-container:hover .volume-slider {
    width: 120px;
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: grab;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease-in-out;
    border: 2px solid #fff;
}

.volume-slider::-moz-range-thumb {
    padding: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: grab;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    border: 2px solid #fff;
}

/* Playback Speed Selector */
.playback-speed-selector {
    position: relative;
}

.speed-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--button-radius);
    transition: background-color 0.2s;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.speed-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.speed-options {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 50%;
    transform: translateX(50%);
    background-color: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--primary-color);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    border-radius: var(--button-radius);
    display: none;
    z-index: 10;
    min-width: 90px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.speed-options.active {
    display: block;
}

.speed-options li {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1em;
    color: #fff;
    transition: background-color 0.2s, color 0.2s;
}

.speed-options li:hover {
    background-color: rgba(0, 255, 0, 0.15);
    color: var(--primary-color);
}

.speed-options li.active {
    color: var(--primary-color);
    font-weight: bold;
    background-color: rgba(0, 255, 0, 0.25);
}

/* Quality Selector */
.quality-selector-container {
    position: relative;
}

.quality-options {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 50%;
    transform: translateX(50%);
    background-color: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--primary-color);
    list-style: none;
    padding: 8px 0;
    margin: 0;
    border-radius: var(--button-radius);
    display: none;
    z-index: 10;
    min-width: 110px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.quality-options.active {
    display: block;
}

.quality-options li {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 1em;
    color: #fff;
    transition: background-color 0.2s, color 0.2s;
}

.quality-options li:hover {
    background-color: rgba(0, 255, 0, 0.15);
    color: var(--primary-color);
}

.quality-options li.active {
    color: var(--primary-color);
    font-weight: bold;
    background-color: rgba(0, 255, 0, 0.25);
}

/* Fullscreen mode */
.video-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-width: unset;
    z-index: 9999;
    border-radius: 0;
    background-color: #000;
}

.video-container.fullscreen video {
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}