/* Secure HLS Video – Player (baseline UI + logo overlay) v1.1.3 */
.shv-player-wrapper {
    --shv-primary: #102C59;
    --shv-secondary: #DAC0A3;
    --shv-accent: #991110;
    --shv-opacity: 0.4;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Vazirmatn", sans-serif;
    direction: rtl;
}

.shv-mobile-gate {
    background: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 16px;
    padding: 40px 24px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shv-gate-card { max-width: 360px; width: 100%; }
.shv-gate-icon { font-size: 3rem; margin-bottom: 12px; }
.shv-gate-card h3 { color: #fff; margin: 0 0 10px; font-size: 1.35rem; }
.shv-gate-card p { color: rgba(255,255,255,0.75); font-size: 0.95rem; margin: 0 0 20px; line-height: 1.5; }
.shv-mobile-input {
    width: 100%; padding: 14px 16px; border: 2px solid rgba(16,44,89,0.4);
    border-radius: 10px; background: rgba(255,255,255,0.08); color: #fff;
    font-size: 1.1rem; text-align: center; margin-bottom: 16px; direction: ltr; box-sizing: border-box;
}
.shv-mobile-input:focus { outline: none; border-color: var(--shv-primary); }
.shv-gate-btn {
    width: 100%; padding: 14px 24px;
    background: linear-gradient(135deg, var(--shv-primary) 0%, #1a3d73 100%);
    color: #fff; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.shv-gate-note { margin-top: 16px !important; font-size: 0.8rem !important; color: rgba(255,255,255,0.5) !important; }

.shv-player-container {
    position: relative;
    width: 100%;
    background: #0d0d0f;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0,0,0,0.28);
    aspect-ratio: 16 / 9;
}
.shv-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

.shv-watermark {
    position: absolute; pointer-events: none; z-index: 10;
    user-select: none; opacity: var(--shv-opacity);
}
.shv-wm-text {
    display: inline-block; background: rgba(0,0,0,0.45); color: #fff;
    font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 4px;
    font-family: monospace; white-space: nowrap;
}
.shv-watermark[data-position="fixed"] { bottom: 48px; left: 12px; }
.shv-watermark[data-position="moving"] {
    bottom: 48px; left: 12px;
    animation: shv-wm-move 18s ease-in-out infinite alternate;
}
@keyframes shv-wm-move {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(40vw, -20vh); }
    50%  { transform: translate(10vw, -40vh); }
    75%  { transform: translate(50vw, -10vh); }
    100% { transform: translate(5vw, -30vh); }
}
.shv-watermark[data-position="random"] { bottom: 48px; left: 12px; }

/* Brand logo / icon overlay */
.shv-logo-overlay {
    position: absolute;
    z-index: 11;
    pointer-events: none;
    line-height: 0;
}
.shv-logo-overlay img {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}
.shv-logo-overlay.pos-top-right    { top: 12px; right: 12px; }
.shv-logo-overlay.pos-top-left     { top: 12px; left: 12px; }
.shv-logo-overlay.pos-bottom-right { bottom: 48px; right: 12px; }
.shv-logo-overlay.pos-bottom-left  { bottom: 48px; left: 12px; }

.shv-player-loading {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.75); color: #fff; z-index: 6; font-size: 0.95rem; text-align: center; padding: 16px;
}
.shv-player-error {
    position: absolute; inset: 12px; z-index: 7; background: rgba(20,10,10,0.92);
    color: #fff; padding: 16px 18px; border-radius: 10px; border-right: 4px solid var(--shv-accent);
    font-size: 0.9rem; line-height: 1.6; overflow: auto;
}
.shv-player-error code {
    background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 4px; font-size: 12px;
}

@media (max-width: 640px) {
    .shv-player-container { border-radius: 10px; }
    .shv-wm-text { font-size: 11px; }
    .shv-logo-overlay.pos-bottom-right,
    .shv-logo-overlay.pos-bottom-left { bottom: 40px; }
}

/* ===== v1.1.4 ratios, poster, notice, mobile ===== */
.shv-player-wrapper.shv-ratio-16x9 .shv-player-container { aspect-ratio: 16 / 9; }
.shv-player-wrapper.shv-ratio-9x16 .shv-player-container {
    aspect-ratio: 9 / 16;
    max-width: min(100%, 420px);
    margin-left: auto;
    margin-right: auto;
}
.shv-player-wrapper.shv-ratio-1x1 .shv-player-container {
    aspect-ratio: 1 / 1;
    max-width: min(100%, 560px);
    margin-left: auto;
    margin-right: auto;
}

.shv-poster {
    position: absolute;
    inset: 0;
    z-index: 8;
    background-size: cover;
    background-position: center;
    background-color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
.shv-poster-default {
    background: linear-gradient(145deg, #1a2420 0%, #0d0d0f 50%, #2a2218 100%);
}
.shv-poster-hidden {
    opacity: 0;
    pointer-events: none;
}
.shv-poster-play-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--shv-primary), #1a3d73);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 8px 28px rgba(16, 44, 89, 0.45);
    border: 3px solid rgba(255,255,255,0.35);
    padding-left: 4px;
    transition: transform 0.2s ease;
}
.shv-poster:hover .shv-poster-play-circle,
.shv-poster:active .shv-poster-play-circle {
    transform: scale(1.08);
}

.shv-notice-bar {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 14;
    background: linear-gradient(90deg, rgba(16,44,89,0.95), rgba(153,17,16,0.92));
    color: #fff;
    padding: 10px 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
}
.shv-notice-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 100%;
}
.shv-notice-text {
    flex: 1 1 auto;
    font-size: 0.9rem;
    line-height: 1.45;
    min-width: 120px;
}
.shv-notice-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    color: #991110;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.shv-notice-btn:hover { filter: brightness(1.05); color: #102C59; }
.shv-notice-close {
    appearance: none;
    border: none;
    background: rgba(255,255,255,0.2);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.shv-notice-close:hover { background: rgba(255,255,255,0.35); }

.shv-video { width: 100%; height: 100%; object-fit: contain; background: #000; }

@media (max-width: 640px) {
    .shv-poster-play-circle { width: 60px; height: 60px; font-size: 24px; }
    .shv-notice-bar { padding: 10px; }
    .shv-notice-text { font-size: 0.82rem; }
    .shv-notice-btn { width: 100%; justify-content: center; }
    .shv-mobile-gate { padding: 28px 16px; min-height: 240px; border-radius: 12px; }
    .shv-gate-btn { min-height: 48px; font-size: 1rem; }
    .shv-mobile-input { min-height: 48px; font-size: 16px; } /* prevent iOS zoom */
}

/* ===== v1.1.7 watermark fullscreen + notice + mobile ===== */
.shv-watermark {
    z-index: 50 !important;
    pointer-events: none !important;
}
.shv-watermark.shv-wm-fullscreen,
.shv-player-container:fullscreen .shv-watermark,
.shv-player-container:-webkit-full-screen .shv-watermark {
    position: absolute !important;
    z-index: 2147483646 !important;
    display: block !important;
    opacity: var(--shv-opacity, 0.45) !important;
    bottom: 12% !important;
    left: 8% !important;
    right: auto !important;
    top: auto !important;
}
.shv-player-container:fullscreen .shv-wm-text,
.shv-player-container:-webkit-full-screen .shv-wm-text {
    font-size: 16px !important;
    padding: 6px 12px !important;
}

/* Notice bar – high contrast, beat Elementor styles */
.shv-notice-bar {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 60 !important;
    background: linear-gradient(105deg, #102C59 0%, #1a3d73 55%, #991110 130%) !important;
    color: #ffffff !important;
    padding: 12px 14px !important;
    box-shadow: 0 -6px 24px rgba(16, 44, 89, 0.35) !important;
    border-top: 2px solid rgba(218, 192, 163, 0.55) !important;
    font-family: inherit !important;
}
.shv-notice-inner {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}
.shv-notice-text {
    flex: 1 1 auto !important;
    font-size: 0.92rem !important;
    line-height: 1.5 !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.25) !important;
}
.shv-notice-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 9px 16px !important;
    border-radius: 999px !important;
    background: #DAC0A3 !important;
    color: #102C59 !important;
    font-weight: 800 !important;
    font-size: 0.85rem !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2) !important;
    white-space: nowrap !important;
    transition: transform 0.15s ease, filter 0.15s ease !important;
}
.shv-notice-btn:hover,
.shv-notice-btn:focus {
    filter: brightness(1.06) !important;
    color: #991110 !important;
    text-decoration: none !important;
    transform: translateY(-1px) !important;
}
.shv-notice-close {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 2px solid rgba(218, 192, 163, 0.7) !important;
    background: rgba(16, 44, 89, 0.55) !important;
    color: #DAC0A3 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    font-size: 1.35rem !important;
    line-height: 1 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    font-family: inherit !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}
.shv-notice-close:hover,
.shv-notice-close:focus {
    background: #991110 !important;
    color: #fff !important;
    border-color: #DAC0A3 !important;
}

.shv-player-loading {
    z-index: 9 !important;
    flex-direction: column;
    gap: 10px;
}
.shv-player-loading::after {
    content: "";
    width: 28px;
    height: 28px;
    border: 3px solid rgba(218,192,163,0.35);
    border-top-color: #DAC0A3;
    border-radius: 50%;
    animation: shv-spin 0.8s linear infinite;
}
@keyframes shv-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
    .shv-notice-bar { padding: 12px 10px !important; }
    .shv-notice-text { font-size: 0.84rem !important; width: 100%; }
    .shv-notice-btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 44px !important;
    }
    .shv-poster-play-circle {
        width: 64px !important;
        height: 64px !important;
        min-width: 64px;
    }
    .shv-player-container {
        border-radius: 10px;
        max-width: 100vw;
    }
    .shv-video {
        max-height: 100%;
    }
}

/* ===== v1.2.0 Fullscreen DRM dense overlay ===== */
.shv-player-container {
    position: relative;
}
.shv-player-container.shv-is-fullscreen,
.shv-player-container:fullscreen,
.shv-player-container:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    background: #000 !important;
}
.shv-player-container:fullscreen .shv-video,
.shv-player-container:-webkit-full-screen .shv-video,
.shv-player-container.shv-is-fullscreen .shv-video {
    width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    object-fit: contain !important;
}
.shv-wm-dense {
    display: none;
    position: absolute !important;
    inset: 0 !important;
    z-index: 2147483645 !important;
    pointer-events: none !important;
    display: none;
    flex-wrap: wrap;
    align-content: space-around;
    justify-content: space-around;
    overflow: hidden;
    background: transparent !important;
}
.shv-player-container:fullscreen .shv-wm-dense,
.shv-player-container:-webkit-full-screen .shv-wm-dense,
.shv-player-container.shv-is-fullscreen .shv-wm-dense {
    display: flex !important;
}
.shv-wm-dense-item {
    color: rgba(255, 255, 255, 0.38) !important;
    font-size: clamp(12px, 2.2vw, 20px) !important;
    font-weight: 700 !important;
    padding: 8px 14px !important;
    transform: rotate(-18deg);
    text-shadow: 0 1px 2px rgba(0,0,0,0.55);
    user-select: none !important;
    white-space: nowrap;
    font-family: Tahoma, Vazirmatn, sans-serif !important;
}
.shv-player-container:fullscreen .shv-watermark,
.shv-player-container:-webkit-full-screen .shv-watermark,
.shv-player-container.shv-is-fullscreen .shv-watermark {
    display: block !important;
    visibility: visible !important;
    opacity: var(--shv-opacity, 0.55) !important;
    z-index: 2147483646 !important;
}
/* Style native TextTrack captions used as DRM fallback (iOS) */
.shv-video::cue {
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.75);
    font-size: 16px;
    font-family: Tahoma, sans-serif;
}


/* v1.2.1 custom fullscreen button + moving DRM in FS */
.shv-fs-btn {
    position: absolute;
    bottom: 52px;
    left: 12px;
    z-index: 40;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: rgba(16, 44, 89, 0.75);
    color: #DAC0A3;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    transition: transform 0.15s ease, background 0.15s ease;
}
.shv-fs-btn:hover { background: #991110; color: #fff; transform: scale(1.06); }
.shv-player-container:fullscreen .shv-fs-btn,
.shv-player-container.shv-is-fullscreen .shv-fs-btn {
    bottom: 24px;
    left: 20px;
}
.shv-player-container:fullscreen .shv-watermark,
.shv-player-container.shv-is-fullscreen .shv-watermark,
.shv-player-container:-webkit-full-screen .shv-watermark {
    transition: top 1.2s ease, left 1.2s ease !important;
}
.shv-wm-dense-item {
    animation: shv-wm-drift 12s ease-in-out infinite alternate;
}
.shv-wm-dense-item:nth-child(odd) { animation-duration: 15s; }
.shv-wm-dense-item:nth-child(3n) { animation-duration: 10s; }
@keyframes shv-wm-drift {
    from { transform: rotate(-18deg) translate(0, 0); }
    to { transform: rotate(-12deg) translate(12px, 18px); }
}
@media (max-width: 640px) {
    .shv-fs-btn { width: 44px; height: 44px; bottom: 56px; }
}
