/* LP Video Player — frontend styles */

/* ------------------------------------------------------------------ */
/* Wrapper & base                                                       */
/* ------------------------------------------------------------------ */

.lpvp-wrapper {
    position: relative;
    background: #000;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 28px;
    border-radius: 10px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .45);
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 16/9) {
    .lpvp-wrapper::before {
        content: '';
        display: block;
        padding-top: 56.25%;
    }
    .lpvp-wrapper > * { position: absolute; }
}

/* ------------------------------------------------------------------ */
/* Loading spinner                                                      */
/* ------------------------------------------------------------------ */

.lpvp-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    z-index: 1;
}

.lpvp-spinner {
    width: 52px;
    height: 52px;
    border: 5px solid rgba(255, 255, 255, .12);
    border-top-color: #4a9eff;
    border-radius: 50%;
    animation: lpvp-spin .8s linear infinite;
}

@keyframes lpvp-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* Video element                                                        */
/* ------------------------------------------------------------------ */

.lpvp-wrapper video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* ------------------------------------------------------------------ */
/* Overlay — blocks right-click on video surface, handles click-to-play*/
/* ------------------------------------------------------------------ */

.lpvp-overlay {
    position: absolute;
    inset: 0;
    bottom: 60px; /* clear controls bar */
    z-index: 2;
    cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Resume banner                                                        */
/* ------------------------------------------------------------------ */

.lpvp-resume-banner {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 10, .88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    border-radius: 10px;
    padding: 12px 20px;
    gap: 12px;
    align-items: center;
    z-index: 10;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .5);
    border: 1px solid rgba(255, 255, 255, .1);
}

.lpvp-resume-banner strong { color: #4a9eff; }

.lpvp-resume-yes,
.lpvp-resume-no {
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s, transform .1s;
    line-height: 1;
}

.lpvp-resume-yes {
    background: #4a9eff;
    color: #fff;
}

.lpvp-resume-yes:hover  { background: #2a7fe0; transform: scale(1.03); }

.lpvp-resume-no {
    background: rgba(255, 255, 255, .15);
    color: rgba(255, 255, 255, .85);
}

.lpvp-resume-no:hover   { background: rgba(255, 255, 255, .25); }

/* ------------------------------------------------------------------ */
/* Controls bar                                                         */
/* ------------------------------------------------------------------ */

.lpvp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .80) 100%);
    padding: 24px 14px 12px;
    z-index: 5;
    opacity: 0;
    transition: opacity .25s ease;
}

/* Always visible when paused or on hover */
.lpvp-wrapper:not(.lpvp-playing) .lpvp-controls,
.lpvp-wrapper:hover .lpvp-controls,
.lpvp-controls.visible {
    opacity: 1;
}

/* ------------------------------------------------------------------ */
/* Progress bar                                                         */
/* ------------------------------------------------------------------ */

.lpvp-progress-wrap {
    padding: 6px 0 10px;
    cursor: pointer;
}

.lpvp-progress-bar {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, .22);
    border-radius: 2px;
    transition: height .15s;
}

.lpvp-progress-wrap:hover .lpvp-progress-bar { height: 6px; }

.lpvp-buffered {
    position: absolute;
    inset: 0;
    width: 0;
    background: rgba(255, 255, 255, .38);
    border-radius: 2px;
    transition: width .4s linear;
}

.lpvp-played {
    position: absolute;
    inset: 0;
    width: 0;
    background: #4a9eff;
    border-radius: 2px;
    z-index: 1;
}

.lpvp-seek-handle {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%) scale(0);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 4px rgba(0, 0, 0, .6);
    transition: transform .15s;
    pointer-events: none;
}

.lpvp-progress-wrap:hover .lpvp-seek-handle,
.lpvp-dragging .lpvp-seek-handle {
    transform: translate(-50%, -50%) scale(1);
}

.lpvp-time-tooltip {
    position: absolute;
    bottom: 16px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, .82);
    color: #fff;
    padding: 3px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
    display: none;
    white-space: nowrap;
    z-index: 3;
}

/* ------------------------------------------------------------------ */
/* Bottom row                                                           */
/* ------------------------------------------------------------------ */

.lpvp-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.lpvp-left-group,
.lpvp-right-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */

.lpvp-btn {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    transition: background .15s;
    flex-shrink: 0;
    line-height: 1;
}

.lpvp-btn:hover { background: rgba(255, 255, 255, .15); }

.lpvp-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    display: block;
}

/* ------------------------------------------------------------------ */
/* Time display                                                         */
/* ------------------------------------------------------------------ */

.lpvp-time {
    color: rgba(255, 255, 255, .85);
    font-size: 13px;
    white-space: nowrap;
    padding: 0 4px;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ */
/* Volume                                                               */
/* ------------------------------------------------------------------ */

.lpvp-volume-wrap {
    display: flex;
    align-items: center;
    width: 0;
    max-width: 0;
    overflow: hidden;
    transition: max-width .25s ease, width .25s ease;
}

.lpvp-left-group:hover .lpvp-volume-wrap {
    width: 76px;
    max-width: 76px;
}

.lpvp-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 72px;
    height: 4px;
    background: rgba(255, 255, 255, .35);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
}

.lpvp-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

.lpvp-volume-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}

/* ------------------------------------------------------------------ */
/* Speed selector                                                       */
/* ------------------------------------------------------------------ */

.lpvp-speed-wrap { position: relative; }

.lpvp-speed-btn {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: none;
    border: 1.5px solid rgba(255, 255, 255, .35);
    border-radius: 5px;
    padding: 3px 9px;
    cursor: pointer;
    min-width: 44px;
    text-align: center;
    transition: background .15s, border-color .15s;
    line-height: 1.4;
}

.lpvp-speed-btn:hover {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .65);
}

.lpvp-speed-dropdown {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: rgba(18, 18, 18, .96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: 6px 0;
    list-style: none;
    margin: 0;
    min-width: 84px;
    display: none;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
    z-index: 20;
}

.lpvp-speed-wrap.open .lpvp-speed-dropdown { display: block; }

.lpvp-speed-dropdown li {
    padding: 8px 18px;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: background .1s, color .1s;
}

.lpvp-speed-dropdown li:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.lpvp-speed-dropdown li.active {
    color: #4a9eff;
    font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* Error state                                                          */
/* ------------------------------------------------------------------ */

.lpvp-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
    padding: 24px;
}

.lpvp-error span {
    color: rgba(255, 255, 255, .65);
    font-size: 14px;
    text-align: center;
    max-width: 360px;
    line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/* Fullscreen                                                           */
/* ------------------------------------------------------------------ */

.lpvp-wrapper:fullscreen,
.lpvp-wrapper:-webkit-full-screen {
    border-radius: 0;
    width: 100vw;
    height: 100vh;
    aspect-ratio: unset;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */

@media (max-width: 520px) {
    .lpvp-time       { font-size: 11px; }
    .lpvp-btn svg    { width: 19px; height: 19px; }
    .lpvp-speed-btn  { font-size: 11px; padding: 2px 7px; min-width: 36px; }
    .lpvp-resume-banner {
        flex-direction: column;
        white-space: normal;
        text-align: center;
        width: 88%;
        font-size: 13px;
    }
}
