/* =====================================================================
   StreamVault Player — Frontend Stylesheet
   Compatible: WordPress 4.9+, PHP 7.4+
   ===================================================================== */

/* Utility */
.svp-hidden {
    display: none !important;
}

/* ----- Card / Thumbnail -------------------------------------------- */
.svp-card {
    display: block;
    position: relative;
    width: 100%;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .25);
    font-family: inherit;
}

.svp-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #1a1a2e;
    background-size: cover;
    background-position: center;
}

.svp-source-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 2;
}

.svp-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    transition: transform .18s ease;
    z-index: 3;
}

.svp-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.12);
}

.svp-play-btn svg {
    width: 44px;
    height: 44px;
}

/* ----- Lightbox Overlay -------------------------------------------- */
#svp-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgb(0 0 0);
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 16px;
    padding: 0 8px;
}

#svp-lightbox.svp-open {
    display: flex;
}

/* Wrapper that sizes the video column and anchors close + title outside */
#svp-video-wrapper {
    flex: 1;
    max-width: 1140px;
    min-width: 0;
    position: relative;
    padding: 42px 0 30px 0;
}

#svp-lightbox-inner {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
}

/* Header bar — hidden */
#svp-lightbox-bar {
    display: none;
}

/* ----- Prev / Next navigation buttons ------------------------------ */
.svp-nav-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s, transform .15s;
    z-index: 10;
}

.svp-nav-btn:hover {
    background: rgba(255, 255, 255, .25);
    transform: scale(1.08);
}

.svp-nav-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    pointer-events: none;
}

/* UI auto-hide — buttons fade out after inactivity */
#svp-lightbox-close,
#svp-prev-btn,
#svp-next-btn {
    transition: opacity .4s ease, background .15s, color .15s, transform .15s;
}

#svp-lightbox.svp-controls-hidden #svp-lightbox-close,
#svp-lightbox.svp-controls-hidden #svp-prev-btn,
#svp-lightbox.svp-controls-hidden #svp-next-btn {
    opacity: 0;
    pointer-events: none;
}

/* Close button — top-right corner outside the video box */
#svp-lightbox-close {
    position: absolute;
    top: 20px;
    right: -24px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #ccc;
    font-size: 20px;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background .15s, color .15s;
    z-index: 20;
}

#svp-lightbox-close:hover {
    background: rgba(255, 80, 80, .7);
    color: #fff;
}

/* Title — bottom-left corner outside the video box */
#svp-lightbox-title {
    position: absolute;
    bottom: 4px;
    left: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: calc(100% - 48px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 20;
}


/* iFrame wrapper */
#svp-iframe-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #000;
}

#svp-lightbox-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Native <video> element — used for MediaFire */
#svp-lightbox-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
    outline: none;
}

/* Loading spinner */
#svp-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    z-index: 2;
}

#svp-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid rgba(255, 255, 255, .15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: svp-spin .8s linear infinite;
}

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

/* Cast tooltip */
#svp-cast-tooltip {
    display: none;
    position: absolute;
    background: #333;
    color: #fff;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 5px;
    bottom: -38px;
    right: 0;
    white-space: nowrap;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Error state */
#svp-lightbox-error {
    display: none;
    color: #ff7070;
    font-size: 13px;
    text-align: center;
    padding: 8px 14px;
    background: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Responsive */
@media (max-width: 600px) {
    #svp-lightbox {
        gap: 8px;
        padding: 0 4px;
    }

    .svp-nav-btn {
        width: 36px;
        height: 36px;
    }

    .svp-nav-btn svg {
        width: 20px;
        height: 20px;
    }
}
