/* assets/css/player.css */

#video-player-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden; /* Ensures controls don't peek out */
}

/* Poster and Big Play Button */
#player-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 3;
    transition: opacity 0.3s ease;
}

#player-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 70px;
    transition: transform 0.2s ease, background-color 0.2s ease;
    border: 2px solid white;
}
.play-button-overlay:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(59, 130, 246, 0.8);
}
.play-button-overlay svg {
    width: 50%;
    height: 50%;
    fill: white;
    padding-left: 5px; /* Optical alignment */
}

/* Video element itself */
#main-video-player {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Custom Controls Container */
.custom-controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 4;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
#video-player-container:hover .custom-controls-container {
    opacity: 1;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.control-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}
.spacer {
    flex-grow: 1; /* Pushes fullscreen button to the right */
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    padding: 5px 0 10px;
    cursor: pointer;
}
.progress-bar {
    width: 100%;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 5px;
}
.progress-bar-filled {
    width: 0;
    height: 100%;
    background-color: #3b82f6; /* Accent color */
    border-radius: 5px;
}

/* Volume Control */
.volume-container {
    display: flex;
    align-items: center;
}
#volume-slider {
    width: 0;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
}
.volume-container:hover #volume-slider {
    width: 80px;
    opacity: 1;
}

/* Time Display */
.time-container {
    color: white;
    font-size: 0.9em;
}

/* Hide poster when video is playing */
.video-playing #player-poster {
    opacity: 0;
    pointer-events: none;
}

/* --- Loading Spinner Styles --- */
.loading-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; /* Initially hidden */
    justify-content: center;
    align-items: center;
    z-index: 5; /* Should be on top of everything */
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}