/* ══════════════════════════════════════════════
   ShahedPro Universal Player — Clean Design
══════════════════════════════════════════════ */
.sp-uplayer {
    position: relative;
    background: #000;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 8px;
    font-family: 'Cairo', system-ui, sans-serif;
    direction: rtl;
}

/* Screen */
.sp-up-screen {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.sp-up-screen video,
.sp-up-screen iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.sp-up-screen video { object-fit: contain; background: #000; }

/* Loading */
.sp-up-loading {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0,0,0,.65);
    color: #aaa;
    font-size: .8rem;
    pointer-events: none;
}
.sp-up-spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,.1);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spSpin .7s linear infinite;
}
@keyframes spSpin { to { transform: rotate(360deg); } }

/* Error */
.sp-up-error {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(0,0,0,.8);
    color: #888;
    font-size: .85rem;
}
.sp-up-error button {
    padding: 7px 18px;
    background: #e50914;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: .82rem;
    margin-top: 4px;
}

/* ── Overlay ── */
.sp-up-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 1;
    transition: opacity .3s;
}

.sp-up-overlay.sp-up-hide { opacity: 0; pointer-events: none; }

/* Top bar */
.sp-up-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(rgba(0,0,0,.7), transparent);
}
.sp-up-title {
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,.9);
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sp-up-top-actions { display: flex; gap: 4px; }

/* Center — NO big play button for iframe/YouTube */
.sp-up-center { flex: 1; display: flex; align-items: center; justify-content: center; }
.sp-up-big-play { display: none !important; }

/* Bottom bar */
.sp-up-bottom {
    background: linear-gradient(transparent, rgba(0,0,0,.8));
    padding: 16px 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Controls row */
.sp-up-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sp-up-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,.9);
    font-size: .95rem;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color .15s, background .15s;
    line-height: 1;
    font-family: inherit;
    min-width: 28px;
    text-align: center;
}
.sp-up-btn:hover { color: #fff; background: rgba(255,255,255,.12); }
.sp-up-spacer { flex: 1; }

/* Volume */
.sp-up-vol-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 72px;
}
.sp-up-vol-wrap input[type=range] {
    width: 100%;
    height: 3px;
    accent-color: #e50914;
    cursor: pointer;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
}

/* Quality */
.sp-up-qlsel {
    background: rgba(0,0,0,.5);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    font-size: .72rem;
    border-radius: 4px;
    padding: 3px 6px;
    cursor: pointer;
    font-family: inherit;
}
.sp-up-qlsel option { background: #111; }

/* Server buttons */
.sp-up-servers { display: flex; gap: 6px; flex-wrap: wrap; }
.sp-up-srv {
    padding: 4px 12px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(0,0,0,.5);
    color: #ddd;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    transition: .15s;
    font-family: inherit;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}
.sp-up-srv:hover { background: rgba(255,255,255,.15); color: #fff; }
.sp-up-srv.active {
    background: rgba(229,9,20,.3);
    border-color: rgba(229,9,20,.7);
    color: #fff;
}

/* Logo watermark */
.sp-up-logo {
    position: absolute;
    z-index: 8;
    max-height: 32px;
    max-width: 110px;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 1px 4px rgba(0,0,0,.7));
    transition: opacity .3s;
}
.sp-uplayer:hover .sp-up-logo { opacity: 0.35 !important; }
.sp-up-logo-top-right    { top: 10px; left: 14px; }
.sp-up-logo-top-left     { top: 10px; right: 14px; }
.sp-up-logo-bottom-right { bottom: 50px; left: 14px; }
.sp-up-logo-bottom-left  { bottom: 50px; right: 14px; }

/* Fullscreen */
.sp-uplayer:fullscreen,
.sp-uplayer:-webkit-full-screen {
    border-radius: 0;
    aspect-ratio: unset;
    width: 100vw;
    height: 100vh;
}

/* Responsive */
@media (max-width: 480px) {
    .sp-up-vol-wrap { display: none; }
    .sp-up-title { font-size: .75rem; }
    .sp-up-srv { font-size: .68rem; padding: 3px 8px; }
}
