/* Container with semi-transparent background */
.player-container {
    background: rgba(0, 0, 0, 0.2); /* 20% semi-transparent black */
    border-radius: 24px; /* Slightly larger than player's border-radius */
    padding: 12px; /* Creates margin between container and player */
    width: 100%;
    overflow: visible;
    margin-top: 3rem;
    max-width: 1200px;
    position: relative;
    margin-left: auto;
    margin-right: auto;
}

/* Video player styles */
article.video {
    position: relative;
    display: block;
    width: 100%;
    background: transparent; /* No background color */
    font-size: 13px;
    border-radius: 20px; /* Rounded corners for the player itself */
    overflow: hidden;
    font-family: Arial, sans-serif;
    /* Use padding-bottom technique to maintain aspect ratio */
    padding-top: 56.25%; /* 16:9 aspect ratio (9/16 * 100%) */
}

article.video video {
    cursor: pointer;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

article.video video.visible {
    opacity: 1;
    transition: opacity 1s ease-out 0.8s;
}

.control-bar {
    width: 100%;
    height: 2.2em;
    padding-bottom: 1px;
    position: absolute;
    bottom: -2.2em;
    left: 0;
    transition: bottom 0.3s ease-out;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.button-bar {
    width: 100%;
    height: 100%;
    position: absolute;
    background: linear-gradient(to bottom, 
        rgba(52,59,74,0.8) 0%,
        rgba(34,41,58,0.8) 100%);
    border-radius: 3px;
    z-index: 2;
}

.button-bar .icon-btn {
    position: absolute;
    width: 2em;
    height: 1.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    margin-top: -0.8em;
    opacity: 0.6;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
    z-index: 2;
    color: white;
}

.button-bar .icon-btn:hover {
    opacity: 1;
}

.button-bar .icon-btn.hidden {
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

.button-bar .play-btn,
.button-bar .pause-btn,
.button-bar .replay-btn {
    width: 2.5em;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.button-bar .fullscreen-btn {
    left: auto;
    right: 0.3em;
}

.volume-container {
    position: absolute;
    width: 2em;
    height: 1.6em;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 50%;
    margin-top: -0.8em;
    opacity: 0.6;
    cursor: pointer;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
    z-index: 2;
    overflow: hidden;
    left: 2.3em;
    font-size: 1.2em;
    transition: all 0.8s ease-out;
}

.volume-container.shift {
    width: 7.5em;
    transition: all 0.2s ease-in;
}

.volume-toggle {
    position: absolute;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 100%;
}

.volume-rail {
    position: absolute;
    left: 2.5em;
    top: 0;
    width: 3em;
    height: 100%;
    margin-top: 0;
    overflow: hidden;
}

.volume-rail .grip {
    position: absolute;
    width: 0.4em;
    height: 1em;
    margin-left: -0.2em;
    left: 100%;
    top: 50%;
    margin-top: -0.5em;
    background: white;
}

.volume-rail .audible,
.volume-rail .inaudible {
    position: absolute;
    width: 100%;
    height: 0.3em;
    left: 0;
    top: 50%;
    margin-top: -0.15em;
    background: #e68739;
}

.volume-rail .inaudible {
    background: #ccc;
}

.time-display {
    color: #eee;
    font-size: 0.8em;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
    position: absolute;
    left: 7em;
    height: 2.2em;
    line-height: 2.8em;
    opacity: 0.9;
    transition: all 0.7s ease-in 0.2s;
}

.time-display.shift {
    left: 13em;
    transition: all 0.2s ease-out;
}

.seek-bar {
    position: absolute;
    width: 100%;
    height: 3px;
    background-color: rgba(255,255,255,0.2);
    top: -2px;
    opacity: 0.5;
    transition: all 0.2s ease;
    cursor: pointer;
    z-index: 7;
}

.seek-bar .buffer {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    z-index: 8;
}

.seek-bar .watched {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    z-index: 8;
    background: #e68739;
    overflow: visible !important;
}

.seek-bar .watched:before,
.seek-bar .watched:after {
    content: "";
    position: absolute;
    right: 10px;
    height: 100%;
    width: 10px;
    background: #e68739;
    border-radius: 6px/3px;
    box-shadow: 0 0 2px #ff9e00;
}

.seek-bar .watched:after {
    right: 0px;
    box-shadow: 0px 0 3px 0px #e68739;
    background: #e68739;
}

.seek-bar .watched .handle {
    position: absolute;
    display: block;
    right: -2px;
    top: -1px;
    width: 0px;
    height: 0px;
    border: 2px solid white;
    z-index: 9;
    background: transparent;
    border-radius: 100%;
    transition: all 0.3s ease;
    box-shadow: 
        inset 0 0 1px rgba(0,0,0,0.8),
        0 0 4px 1px #ff9e00;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.seek-bar .watched .handle.active {
    background: #666;
}

.seek-bar .watched .handle:after {
    content: "";
    width: 26px;
    height: 22px;
    position: absolute;
    left: 50%;
    margin-left: -13px;
    top: 50%;
    margin-top: -15px;
}

.seek-bar:after {
    content: "";
    position: absolute;
    height: 20px;
    width: 100%;
    bottom: -5px;
    left: 0;
    z-index: 6;
}

.seek-bar:hover {
    height: 6px;
    top: -6px;
}

article.video.active .control-bar {
    bottom: 0;
    transition: bottom 0.05s ease-out;
}

article.video.active .control-bar.active .seek-bar:hover .handle {
    top: -3px;
}

article.video.active .control-bar.active .seek-bar .handle {
    width: 4px;
    height: 4px;
    right: -5px;
    top: -6px;
    border-width: 5px;
    transition: all 0.1s ease;
    box-shadow: 
        inset 0 0 1px rgba(0,0,0,0.8),
        0 0 4px 0px #ff9e00;
}

article.video.active .seek-bar {
    opacity: 1;
}



.large-play {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0px;
    height: 0px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-top: -25px;
    margin-left: -25px;
    cursor: pointer;
    opacity: 0.8;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    transition: 0.3s ease;
    color: rgba(255, 255, 255, 0);
}

.large-play.hidden {
    top: 45%;
    opacity: 0;
}



/* Responsive adjustments */
@media screen and (max-width: 800px) {
    article.video {
        font-size: 12px;
    }
    
    .player-container {
        padding: 10px;
        border-radius: 22px;
    }
}

@media screen and (max-width: 768px) {
    /* Specific mobile styles for video player */
    article.video {
        padding-top: 56.25%; /* Maintain 16:9 aspect ratio */
    }
    
    article.video video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

@media screen and (max-width: 500px) {
    .time-display {
        display: none;
    }
    
    .volume-container {
        left: 4em;
    }
    
    .player-container {
        padding: 8px;
        border-radius: 20px;
    }
    
    /* Increase touch targets for mobile */
    .icon-btn, .volume-container, .seek-bar {
        min-height: 44px; /* Minimum recommended touch target size */
    }
    
    .button-bar .icon-btn {
        width: 3em;
        height: 2.5em;
        margin-top: -1.25em;
    }
    
    .volume-container {
        width: 2.5em;
        height: 2.5em;
        margin-top: -1.25em;
    }
    
    .control-bar {
        height: 3em;
        bottom: -3em;
    }
    
    .control-bar.active {
        bottom: 0;
    }
}

/* Additional mobile-specific styles for better touch interaction */
@media screen and (max-width: 768px) {
    .control-bar {
        transition: bottom 0.5s ease-out;
    }
    
    article.video.active .control-bar {
        bottom: 0;
        transition: bottom 0.3s ease-out;
    }
    
    /* Ensure proper z-index for mobile controls */
    .control-bar, .large-play {
        z-index: 100 !important;
    }
}

/* SVG icon styling */
.icon-btn svg, .volume-toggle svg, .large-play svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}