/* EzPlayer shared styles */

.ez-player-wrapper {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
    aspect-ratio: 9 / 16;
}

/* The underlying HTMLVideoElement */
.ez-player-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background-color: #000;
    outline: none;
}

/* Controls overlay */
.ez-player-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: linear-gradient(to top, rgba(15, 27, 32, 0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ez-player-wrapper:hover .ez-player-controls,
.ez-player-wrapper.paused .ez-player-controls {
    opacity: 1;
    pointer-events: auto;
}

/* Progress bar */
.ez-progress-container {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.ez-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    background-color: var(--primary-color, #66F3DF);
    position: relative;
}

/* Scrubber handle */
.ez-progress-fill::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ez-progress-container:hover .ez-progress-fill::after {
    opacity: 1;
}

/* Controls row */
.ez-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    font-size: 12px;
}

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

/* Icon buttons */
.ez-btn {
    background: none;
    border: none;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.1s ease;
}

.ez-btn:hover {
    color: var(--primary-color, #66F3DF);
    transform: translateY(-1px);
}

.ez-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Time display */
.ez-time-display {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #ccc;
}

/* Volume bar (inline next to mute icon) */
.ez-volume-container {
    position: relative;
    width: 60px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    overflow: hidden;
}

.ez-volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%; /* default to full volume; JS will update */
    border-radius: 999px;
    background-color: var(--primary-color, #66F3DF);
    transition: width 0.15s ease;
}

/* Slight enlargement on hover for better affordance */
.ez-volume-container:hover .ez-volume-fill {
    filter: brightness(1.1);
}

/* Big center play button */
.ez-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(15, 27, 32, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.ez-player-wrapper.paused .ez-big-play {
    opacity: 1;
    pointer-events: auto;
}

.ez-big-play svg {
    width: 32px;
    height: 32px;
    fill: var(--primary-color, #66F3DF);
    margin-left: 4px; /* optical centering */
}

/* Ensure EzPlayer blends with existing wrappers like .video-wrapper and .video-frame */
.video-wrapper.ez-player-wrapper,
.video-frame.ez-player-wrapper {
    background-color: #000;
}