.owu-player-container {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    outline: none;
    user-select: none;
    aspect-ratio: 16 / 9;
}

.owu-player-container video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Custom Controls Bar Overlay */
.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%);
    padding: 10px 15px 5px 15px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.owu-player-container:hover .player-controls,
.owu-player-container.paused .player-controls,
.owu-player-container.controls-active .player-controls {
    opacity: 1;
    pointer-events: auto;
}

/* Cursor hiding when inactive */
.owu-player-container.hide-cursor {
    cursor: none;
}

/* Timeline / Progress Bar */
.timeline-container {
    height: 4px;
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
    position: relative;
    padding: 4px 0; /* Expanded hit area */
}

.timeline-container:hover {
    height: 6px;
}

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

.timeline-container:hover .timeline {
    height: 6px;
}

.buffered-bar, .hover-bar, .play-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    border-radius: 2px;
    transform-origin: left;
}

.buffered-bar {
    background: rgba(255, 255, 255, 0.4);
    width: 0%;
}

.hover-bar {
    background: rgba(255, 255, 255, 0.25);
    width: 0%;
    opacity: 0;
    transition: opacity 0.1s ease;
}

.timeline-container:hover .hover-bar {
    opacity: 1;
}

.play-bar {
    background: #ff0000;
    width: 0%;
}

.scrubber-head {
    position: absolute;
    height: 12px;
    width: 12px;
    background: #ff0000;
    border-radius: 50%;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.1s ease;
    z-index: 5;
    pointer-events: none;
}

.timeline-container:hover .scrubber-head,
.timeline-container.dragging .scrubber-head {
    transform: translate(-50%, -50%) scale(1);
}

.timeline-tooltip {
    position: absolute;
    bottom: 20px;
    left: 0;
    transform: translateX(-50%);
    background: rgba(28, 28, 28, 0.9);
    color: white;
    padding: 3px 6px;
    font-size: 11px;
    border-radius: 3px;
    font-family: monospace;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 15;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-container:hover .timeline-tooltip {
    opacity: 1;
}

/* Control buttons row */
.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

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

.control-btn {
    background: none;
    border: none;
    color: inherit;
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.15s, transform 0.1s;
    outline: none;
}

.control-btn:hover {
    opacity: 1;
    transform: scale(1.08);
}

.control-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 0;
    height: 3px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    margin-left: 0;
    opacity: 0;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s, margin-left 0.2s;
    border-radius: 2px;
    cursor: pointer;
}

.volume-container:hover .volume-slider,
.volume-slider:focus {
    width: 60px;
    opacity: 1;
    margin-left: 8px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
}

/* Time display */
.time-display {
    font-size: 13px;
    font-family: Arial, sans-serif;
    color: #ddd;
}

/* Settings and drop-downs */
.settings-menu-container {
    position: relative;
}

.settings-dropdown {
    position: absolute;
    bottom: 35px;
    right: 50%;
    transform: translateX(50%);
    background: rgba(28, 28, 28, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    min-width: 100px;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    padding: 6px 0;
    z-index: 20;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
}

.settings-dropdown.active {
    display: flex;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 13px;
    color: #eee;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    text-align: center;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.dropdown-item.active {
    color: #ff0000;
    font-weight: bold;
}

.speed-btn {
    font-size: 13px;
    font-weight: 600;
    min-width: 35px;
}

/* Custom Context Menu */
.player-context-menu {
    position: absolute;
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    min-width: 220px;
    display: none;
    flex-direction: column;
    padding: 6px 0;
    z-index: 100;
    box-shadow: 0 10px 20px rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
}

.player-context-menu .menu-item {
    padding: 8px 16px;
    font-size: 13px;
    color: #ddd;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-context-menu .menu-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.player-context-menu .menu-item.checked::after {
    content: "✓";
    color: #ff0000;
    font-weight: bold;
}

.player-context-menu .menu-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Stats for Nerds Panel */
.stats-for-nerds-panel {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(15, 15, 15, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: white;
    width: 290px;
    padding: 12px;
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
    line-height: 1.4;
    display: none;
    flex-direction: column;
    z-index: 50;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.stats-for-nerds-panel.active {
    display: flex;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 6px;
    margin-bottom: 8px;
    font-weight: bold;
    color: #aaa;
}

.stats-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
}

.stats-close-btn:hover {
    color: white;
}

.stats-content > div {
    margin-bottom: 4px;
    word-break: break-all;
}

.stats-content strong {
    color: #888;
}

.stats-chart-container {
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-chart-container canvas {
    display: block;
    width: 100%;
    height: 40px;
}

/* Loading/Buffering Spinner */
.player-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 8;
    pointer-events: none;
}

.player-loader.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ff0000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Touch responsiveness helper overlays for Android/mobile */
.mobile-touch-feedback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    pointer-events: none;
    z-index: 6;
}

.mobile-touch-left, .mobile-touch-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    background: rgba(255, 255, 255, 0.08);
    transition: opacity 0.25s ease;
}

.mobile-touch-left.active, .mobile-touch-right.active {
    opacity: 1;
}

.mobile-touch-icon {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: bold;
}

/* Big play button overlay */
.player-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 7;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.player-play-overlay.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    animation: playFade 0.6s ease-out forwards;
}

@keyframes playFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

.owu-player-container.is-offline .player-controls {
    display: none !important;
}

.owu-player-container.is-offline .player-loader {
    display: none !important;
}
