/* ==========================
   Player Overlay & Shell
   ========================== */
.player-overlay {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.player-shell {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.video-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    overflow: hidden;
}

#yt-player,
#yt-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    border: none;
}

#interactionShield {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: default;
}

/* ==========================
   Close Button — ALWAYS visible
   ========================== */
.player-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 60;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    pointer-events: auto;
}
.player-close-btn:hover {
    background: rgba(255,255,255,0.15);
}

/* ==========================
   Custom UI Transitions (header, center, bottom)
   ========================== */
.player-shell.show-controls #playerHeader,
.player-shell.show-controls #customControls {
    opacity: 1;
    pointer-events: auto;
}

.player-shell.show-controls #centerControls {
    opacity: 1;
    /* Keep pointer-events none on the container so it doesn't block the screen */
    pointer-events: none;
}

.player-shell.show-controls #centerControls > * {
    pointer-events: auto;
}

.player-shell:not(.show-controls) #playerHeader,
.player-shell:not(.show-controls) #customControls,
.player-shell:not(.show-controls) #centerControls {
    opacity: 0;
    pointer-events: none;
}

.player-shell:not(.show-controls) #centerControls > * {
    pointer-events: none;
}

/* ==========================
   Occlusion Gradients (Hide YT Native UI)
   ========================== */
/* The top bar covers YouTube's native title which appears on pause */
.player-top-bar {
    background: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 50px, rgba(0,0,0,0.8) 80px, rgba(0,0,0,0) 100%) !important;
}

/* The bottom bar covers YouTube's native thin progress bar and "More videos" which appear on pause */
.player-bottom-bar {
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 60px, rgba(0,0,0,0.9) 90px, rgba(0,0,0,0) 100%) !important;
}

/* ==========================
   Timeline / Progress Bar
   ========================== */
.timeline-wrapper {
    height: 20px;
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

/* The invisible range input covers the full wrapper for clicking */
.timeline-wrapper input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: pointer;
    margin: 0;
    z-index: 10;
}

.timeline-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0;
    height: 0;
    background: transparent;
}

.timeline-wrapper input[type="range"]::-moz-range-thumb {
    width: 0;
    height: 0;
    background: transparent;
    border: none;
}

/* The visible track */
.timeline-visual {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.2);
    position: relative;
    pointer-events: none;
    transition: height 0.15s;
    border-radius: 0;
}
.timeline-wrapper:hover .timeline-visual {
    height: 5px;
}

/* Progress fill — red bar */
.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #f00;
    pointer-events: none;
    width: 0%;
}

/* Scrubber dot */
.timeline-dot {
    position: absolute;
    top: 50%;
    width: 13px;
    height: 13px;
    background: #f00;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    left: 0%;
}
.timeline-wrapper:hover .timeline-dot {
    opacity: 1;
}

/* ==========================
   Volume Slider
   ========================== */
#volumeSlider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(to right, white 100%, rgba(255,255,255,.2) 100%);
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

#volumeSlider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
}
