/**
 * Shohaz Simple Player — CSS
 * پلیر ساده برای نتایج دانشجویان و اکسپلور
 */

/* ── کانتینر ── */
.ssp-player {
    position: relative;
    width: 100%;
    /* aspect-ratio از ویدیو خودش گرفته می‌شه — مقدار ثابت نمی‌ذاریم */
    min-height: 120px;
    /* حداقل ارتفاع تا overlay و controls visible باشن */
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.ssp-player * {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* ── ویدیو ── */
.ssp-video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

/* ── Overlay (دکمه پخش مرکزی) ── */
.ssp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .3);
    z-index: 2;
    transition: opacity .18s ease, visibility .18s ease;
    pointer-events: auto;
}

.ssp-player.playing .ssp-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ssp-play-big {
    width: 58px;
    height: 58px;
    background: rgba(255, 255, 255, .92);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
    transition: transform .15s ease, background .15s ease;
    outline: none;
    flex-shrink: 0;
}

.ssp-play-big svg {
    color: #111;
    margin-right: -2px;
    pointer-events: none;
}

.ssp-play-big:hover {
    transform: scale(1.08);
    background: #fff;
}

.ssp-play-big:active {
    transform: scale(.93);
}

.ssp-play-big:focus-visible {
    outline: 2px solid var(--accent, #22c55e);
    outline-offset: 3px;
}

/* ── Loading spinner ── */
.ssp-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    z-index: 8;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    pointer-events: none;
}

.ssp-player.buffering .ssp-loading {
    opacity: 1;
    visibility: visible;
}

.ssp-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, .2);
    border-top-color: var(--accent, #22c55e);
    border-radius: 50%;
    animation: sspSpin .8s linear infinite;
}

@keyframes sspSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ── نوار کنترل ── */
.ssp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 10px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .72));
    z-index: 3;
    opacity: 0;
    transition: opacity .2s ease;
}

.ssp-player:hover .ssp-controls,
.ssp-player.playing .ssp-controls,
.ssp-player.paused-visible .ssp-controls {
    opacity: 1;
}

/* داخل sr-modal — کنترل‌ها همیشه visible */
.sr-modal-player-wrap .ssp-controls {
    opacity: 1;
}

/* ── Progress bar ── */
.ssp-progress {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, .22);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 7px;
    direction: ltr;
    transition: height .12s ease;
}

.ssp-progress:hover {
    height: 6px;
}

.ssp-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--accent, #22c55e);
    border-radius: 4px;
    pointer-events: none;
}

.ssp-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform .12s ease;
    pointer-events: none;
}

.ssp-progress:hover .ssp-progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}

/* ── Bar ── */
.ssp-bar {
    display: flex;
    align-items: center;
    gap: 2px;
    direction: ltr;
}

.ssp-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background .12s ease;
    outline: none;
    flex-shrink: 0;
}

.ssp-btn:hover {
    background: rgba(255, 255, 255, .14);
}

.ssp-btn:active {
    background: rgba(255, 255, 255, .22);
}

.ssp-btn:focus-visible {
    outline: 1px solid rgba(255, 255, 255, .5);
}

.ssp-btn svg {
    pointer-events: none;
}

.ssp-time {
    font-size: .68rem;
    color: rgba(255, 255, 255, .82);
    direction: ltr;
    min-width: 78px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    padding: 0 4px;
}

.ssp-spacer {
    flex: 1;
}

/* ── Play/Pause آیکون ── */
.ssp-ico-pause {
    display: none;
}

.ssp-ico-play {
    display: block;
}

.ssp-player.playing .ssp-ico-play {
    display: none;
}

.ssp-player.playing .ssp-ico-pause {
    display: block;
}

/* ── Mute آیکون ── */
.ssp-ico-mute {
    display: none;
}

.ssp-ico-vol {
    display: block;
}

.ssp-player.muted .ssp-ico-vol {
    display: none;
}

.ssp-player.muted .ssp-ico-mute {
    display: block;
}

/* ── Fullscreen آیکون ── */
.ssp-ico-compress {
    display: none;
}

.ssp-ico-expand {
    display: block;
}

.ssp-player.fullscreen .ssp-ico-expand {
    display: none;
}

.ssp-player.fullscreen .ssp-ico-compress {
    display: block;
}

/* ── منوی سرعت ── */
.ssp-speed-wrap {
    position: relative;
}

.ssp-btn-speed {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: .68rem;
    font-weight: 700;
    padding: 0 6px;
    height: 30px;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background .12s;
    white-space: nowrap;
    font-family: inherit;
    outline: none;
}

.ssp-btn-speed:hover {
    background: rgba(255, 255, 255, .14);
}

.ssp-speed-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1c1c1c;
    border: 1px solid #383838;
    border-radius: 8px;
    overflow: hidden;
    z-index: 20;
    min-width: 66px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .55);
}

.ssp-speed-menu.open {
    display: flex;
}

.ssp-speed-menu button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .8);
    font-size: .74rem;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
    text-align: center;
    transition: background .12s, color .12s;
    font-family: inherit;
    white-space: nowrap;
}

.ssp-speed-menu button:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.ssp-speed-menu button.active {
    color: var(--accent, #22c55e);
}

/* ── empty state ── */
.ssp-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: .85rem;
}