@keyframes tvFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tvSpin { to { transform: rotate(360deg); } }
@keyframes tvPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

.mr-nose-tv-front-wrapper { position: relative; min-height: 400px; direction: rtl; font-family: inherit; margin: 2rem 0; }

.tv-initial-loader { position: absolute; inset: 0; background: #f8fafc; z-index: 50; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.4s ease; border-radius: 12px; }
.tv-initial-loader.is-hidden { opacity: 0; pointer-events: none; }
.tv-spinner-large { width: 45px; height: 45px; border: 4px solid #e2e8f0; border-top-color: #0284c7; border-radius: 50%; animation: tvSpin 0.8s linear infinite; margin-bottom: 15px; }
.tv-loader-text { color: #475569; font-weight: bold; font-size: 0.95rem; animation: tvPulse 1.5s infinite; }

.tv-tabs-container { display: flex; gap: 10px; margin-bottom: 25px; flex-wrap: wrap; justify-content: center; }
.tv-tab-btn { display: inline-block; background: #f1f5f9; border: 1px solid #cbd5e1; padding: 8px 18px; border-radius: 30px; cursor: pointer; font-family: inherit; font-weight: bold; color: #475569; text-decoration: none; transition: all 0.2s; outline: none; }
.tv-tab-btn:hover, .tv-tab-btn.is-active { background: #1e293b; color: #fff; border-color: #1e293b; }

.tv-front-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; transition: opacity 0.3s ease; }

.tv-front-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); border: 1px solid #f3f4f6; transition: all 0.3s ease; }
.tv-front-card:hover { transform: translateY(-5px); box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.15); }

.tv-front-thumbnail { height: 190px; position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 1.5rem; color: #fff; text-align: center; overflow: hidden; }

/* نمایش عکس کاور با نهایت وضوح و شفافیت ۱۰۰ درصد */
.tv-front-cover-img { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    object-fit: cover !important; object-position: center center !important; z-index: 1; 
    filter: none !important; opacity: 1 !important; 
}

/* لغو کامل تمام لایه‌های تاریک‌کننده روی عکس واقعی */
.tv-has-real-cover::after, .tv-has-real-cover::before { display: none !important; content: none !important; }

/* بک‌گراند مش‌گرادیان اختصاصی برای زمانی که عکسی آپلود نشده */
.tv-mesh-fallback { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); position: relative; }
.tv-mesh-fallback::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.2) 0px, transparent 60%), radial-gradient(circle at 80% 80%, rgba(56, 189, 248, 0.15) 0px, transparent 60%); z-index: 1; pointer-events: none; }
.tv-mesh-fallback .tv-front-thumb-title { color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.9); font-weight: 800; font-size: 1.1rem; }
.tv-mesh-fallback .tv-front-play-icon { color: #ffffff; opacity: 0.95; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6)); }

.tv-front-thumb-title { position: relative; z-index: 3; font-weight: bold; line-height: 1.5; }
.tv-front-play-icon { position: absolute; z-index: 4; width: 55px; height: 55px; opacity: 0.88; transition: transform 0.3s ease; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); color: #fff; }
.tv-audio-icon { width: 45px; height: 45px; color: #38bdf8 !important; } 
.tv-front-thumbnail:hover .tv-front-play-icon { transform: scale(1.15); opacity: 1; }

.tv-front-content { padding: 1.25rem; }
.tv-front-title { font-size: 1.1rem; margin: 0 0 0.5rem 0; line-height: 1.4; font-weight: bold; color: #1e293b; }
.tv-front-desc { font-size: 0.85rem; color: #0284c7; margin: 0 0 1rem 0; line-height: 1.6; background: rgba(14, 165, 233, 0.05); padding: 10px 12px; border-radius: 6px; border-right: 3px solid #38bdf8; font-weight: 500; }
.tv-front-meta { display: flex; justify-content: space-between; font-size: 0.875rem; color: #64748b; font-weight: bold; }

.tv-pagination-wrapper { margin-top: 30px; text-align: center; }
.tv-pagination-wrapper ul { list-style: none; padding: 0; margin: 0; display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tv-pagination-wrapper li span { display: inline-block; padding: 8px 16px; border-radius: 6px; background: #fff; border: 1px solid #cbd5e1; color: #1e293b; font-weight: bold; transition: 0.2s; user-select: none; cursor: pointer; }
.tv-pagination-wrapper li span:not(.current):not(.tv-pag-dots):hover { background: #f1f5f9; border-color: #94a3b8; }
.tv-pagination-wrapper li span.current { background: #1e293b; color: #fff; border-color: #1e293b; pointer-events: none; }
.tv-pagination-wrapper li span.tv-pag-dots { background: transparent; border: none; color: #94a3b8; pointer-events: none; padding: 8px 5px; }
.tv-pagination-wrapper li.tv-pag-nav span { background: #f8fafc; color: #0284c7; }
.tv-pagination-wrapper li.tv-pag-nav span:hover { background: #0284c7; color: #fff; border-color: #0284c7; }

.tv-front-modal { display: none; position: fixed; inset: 0; z-index: 999999; background: rgba(0, 0, 0, 0.95); align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.tv-front-modal.is-open { display: flex; }
.tv-front-modal-content { width: 95%; max-width: 1000px; position: relative; border-radius: 12px; }

#tv-front-player-container.tv-video-mode { background: #000; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); aspect-ratio: 16 / 9; max-height: 85vh; width: 100%; height: 100%; position: relative; border-radius: 12px; overflow: hidden; }
#tv-front-player-container.tv-video-mode iframe, #tv-front-player-container.tv-video-mode video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; overflow: hidden; }

#tv-front-player-container.tv-audio-mode { background: #1e293b; border-radius: 12px; padding: 40px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); max-width: 500px; margin: 0 auto; text-align: center; }
.tv-audio-cover { width: 80px; height: 80px; background: linear-gradient(135deg, #38bdf8, #0284c7); border-radius: 50%; margin: 0 auto 20px auto; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(0,0,0,0.3); }
.tv-audio-cover::after { content: '🎵'; font-size: 30px; }
#tv-front-player-container.tv-audio-mode audio { outline: none; width: 100%; margin-top: 20px; }

.tv-front-modal-close { position: absolute; top: -55px; left: 0; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem; cursor: pointer; transition: 0.2s; z-index: 10; backdrop-filter: blur(5px); }
.tv-front-modal-close:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }

.tv-minimal-dl-btn {
    position: absolute; top: -55px; right: 0; 
    background: rgba(14, 165, 233, 0.15); border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 50%; width: 45px; height: 45px; 
    display: flex; align-items: center; justify-content: center;
    color: #38bdf8; cursor: pointer; transition: 0.2s; z-index: 10; backdrop-filter: blur(5px);
}
.tv-minimal-dl-btn:hover { background: rgba(14, 165, 233, 0.4); color: #fff; transform: scale(1.1); }
.tv-minimal-dl-btn svg { width: 22px; height: 22px; }

/* ----------------------------------------------------------- */
/* استایل فوق‌العاده در چشم، روشن و کاملاً فیکس نوار VPN در بالا */
/* ----------------------------------------------------------- */
.tv-vpn-smart-toast {
    position: absolute;
    top: -65px; /* قرارگیری دقیق در بالای پلیر */
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff !important;
    border: 2px solid #ef4444 !important; 
    color: #1e293b !important; 
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.92rem;
    font-weight: 800 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 99999999 !important; 
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4) !important;
    white-space: nowrap;
}
.tv-vpn-smart-toast svg { width: 22px; height: 22px; color: #ef4444 !important; flex-shrink: 0; }

.tv-vpn-smart-toast.show-toast {
    animation: tvVpnToastStrict 7s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes tvVpnToastStrict {
    0% { opacity: 0; transform: translate(-50%, -25px); }
    12% { opacity: 1; transform: translate(-50%, 0); }
    88% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -25px); }
}

@media (max-width: 768px) {
    .tv-minimal-dl-btn { top: auto; bottom: -60px; }
    .tv-vpn-smart-toast {
        top: -85px; /* تنظیم ارتفاع در موبایل برای دیده شدن کامل */
        font-size: 0.78rem;
        padding: 8px 14px;
        white-space: normal;
        text-align: center;
        width: 86%;
        line-height: 1.6;
    }
}