/* =========================================================
   IntraSky Player — Custom HTML5 Video Player
   IntraSkyTV
   ========================================================= */

.isp {
    position: relative;
    background: #000;
    width: 100%;
    display: block;
    overflow: hidden;
    max-height: 85vh;
    font-family: system-ui, -apple-system, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.isp video {
    width: 100%;
    height: 100%;
    max-height: 85vh;
    display: block;
    cursor: pointer;
    object-fit: contain;
    background: #000;
}

/* ---- UI layer ---- */
.isp-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* ---- Center overlay (click to play/pause) ---- */
.isp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    cursor: pointer;
    z-index: 2;
    transition: opacity 150ms ease;
}
.isp-playing .isp-overlay {
    opacity: 0;
    pointer-events: none;
}

/* Play button: simple dark pill, no circle ring */
.isp-overlay-btn {
    background: rgba(0, 0, 0, 0.48);
    border: none;
    border-radius: 8px;
    padding: 14px 22px 14px 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: background 140ms;
}
.isp-overlay:hover .isp-overlay-btn {
    background: rgba(0, 0, 0, 0.68);
}
.isp-overlay-btn svg {
    width: 32px;
    height: 32px;
    fill: rgba(255, 255, 255, 0.92);
    flex-shrink: 0;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* ---- Bottom gradient ---- */
.isp-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.65) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease;
    z-index: 3;
}
.isp-gradient-visible { opacity: 1; }

/* ---- Control bar ---- */
.isp-ctrl {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 10px 8px;
    z-index: 4;
    pointer-events: all;
    opacity: 0;
    transition: opacity 180ms ease;
}
.isp-ctrl-visible { opacity: 1; }

/* ---- Progress bar ---- */
.isp-progress-wrap {
    padding: 8px 2px 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.isp-prog {
    height: 4px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 2px;
    position: relative;
    transition: height 140ms ease;
}
.isp-progress-wrap:hover .isp-prog,
.isp-dragging .isp-prog {
    height: 6px;
}
.isp-buf {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.32);
    border-radius: 2px;
    pointer-events: none;
    width: 0;
}
.isp-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: #f0f0f0;
    border-radius: 2px;
    pointer-events: none;
    width: 0;
}
.isp-dot {
    position: absolute;
    top: 50%;
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 140ms ease;
    pointer-events: none;
    left: 0;
    margin-top: 1px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.isp-progress-wrap:hover .isp-dot,
.isp-dragging .isp-dot {
    transform: translate(-50%, -50%) scale(1);
}

/* ---- Control row ---- */
.isp-row {
    display: flex;
    align-items: center;
    height: 34px;
    gap: 0;
}
.isp-space { flex: 1; }

.isp-btn {
    background: none;
    border: none;
    padding: 0 7px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #e2e2e2;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-radius: 4px;
    min-width: 30px;
    transition: color 100ms, background 100ms;
    line-height: 1;
    flex-shrink: 0;
    outline: none;
}
.isp-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.isp-ico {
    width: 19px;
    height: 19px;
    fill: currentColor;
    flex-shrink: 0;
    display: block;
}

.isp-time {
    font-size: 12px;
    color: #c9d1d9;
    padding: 0 8px;
    white-space: nowrap;
    letter-spacing: 0.01em;
    pointer-events: none;
}

/* ---- Volume ---- */
.isp-vol-grp {
    display: flex;
    align-items: center;
    position: relative;
}
.isp-vol-bar {
    overflow: hidden;
    width: 0;
    transition: width 150ms ease;
    display: flex;
    align-items: center;
    padding-right: 4px;
}
.isp-vol-grp:hover .isp-vol-bar {
    width: 70px;
}
.isp-vol-track {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}
.isp-vol-track:hover { height: 5px; }
.isp-vol-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: #f0f0f0;
    border-radius: 2px;
    pointer-events: none;
    width: 85%;
}
.isp-vol-thumb {
    position: absolute;
    top: 50%;
    width: 11px;
    height: 11px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    left: 85%;
}

/* ---- Menus ---- */
.isp-speed-grp,
.isp-qual-grp {
    position: relative;
}
.isp-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    min-width: 84px;
    display: none;
    z-index: 20;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
    pointer-events: all;
}
.isp-menu.isp-open { display: block; }
.isp-menu li {
    padding: 7px 16px;
    font-size: 13px;
    color: #8b949e;
    cursor: pointer;
    white-space: nowrap;
    transition: background 80ms, color 80ms;
}
.isp-menu li:hover {
    background: #21262d;
    color: #f0f0f0;
}
.isp-menu li.isp-active {
    color: #f0f6fc;
    font-weight: 600;
}

/* ---- Fullscreen ---- */
.isp:fullscreen,
.isp:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
}
.isp:fullscreen video,
.isp:-webkit-full-screen video {
    height: 100vh;
    max-height: 100vh;
    object-fit: contain;
}

/* ---- Buffering spinner ---- */
@keyframes isp-spin {
    to { transform: rotate(360deg); }
}
.isp-spinner {
    display: none;
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255,255,255,0.18);
    border-top-color: #fff;
    border-radius: 50%;
    animation: isp-spin 0.7s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -17px 0 0 -17px;
    z-index: 3;
    pointer-events: none;
}
.isp-buffering .isp-spinner { display: block; }
.isp-buffering .isp-overlay { opacity: 0; pointer-events: none; }

/* ---- Ad overlay ---- */
.isp-ad-container {
    position: absolute;
    inset: 0;
    z-index: 30;
    pointer-events: all;
}

/* Pre-roll skip button */
.isp-skip-btn {
    position: absolute;
    bottom: 56px;
    right: 12px;
    background: rgba(0, 0, 0, 0.72);
    color: #ddd;
    font-size: 12px;
    font-family: system-ui, sans-serif;
    padding: 8px 14px;
    border-radius: 3px;
    cursor: default;
    z-index: 35;
    border: 1px solid rgba(255,255,255,0.15);
    pointer-events: none;
    transition: color 100ms, border-color 100ms;
}
.isp-skip-btn.isp-skip-ready {
    cursor: pointer;
    color: #fff;
    border-color: rgba(255,255,255,0.4);
    pointer-events: all;
}
.isp-skip-btn.isp-skip-ready:hover {
    background: rgba(0,0,0,0.85);
}
