.JFMediaMod-bg-primary { background-color: var(--bs-primary) !important; }

/* Wrapper اصلی ثابت در پایین */
.JFMediaMod-player-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99999999;
    direction: rtl;
    background: var(--bs-body-bg);
    box-shadow: 0 -5px 25px rgba(0,0,0,0.15);
}

.JFMediaMod-player-wrapper .video-wrapper {
    height: 420px;
}

#playlist-pane {
    max-height: 740px;
}

/* پنل بازشونده (مخفی در حالت پیش‌فرض) */
.JFMediaMod-expanded-panel {
    height: 0;
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 23, 42, 0.85); /* پس زمینه تیره نیمه‌شفاف */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.JFMediaMod-expanded-panel .container-fluid {
    max-height: 90vh;
}

/* هدر پنل بازشونده */
.JFMediaMod-panel-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

/* ویژوالایزر پس‌زمینه */
#JFMediaVisualizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    filter: blur(25px);
    opacity: 0.6;
    pointer-events: none;
    mix-blend-mode: plus-lighter;
}

/* حالت باز شده (مخفی کردن نوار پایین و نمایش پنل) */
.JFMediaMod-player-wrapper.expanded .JFMediaMod-bottom-bar {
    display: none !important;
}

.JFMediaMod-player-wrapper.expanded .JFMediaMod-expanded-panel {
    height: 100vh; /* برای جا شدن کامل ویدئو و تب‌ها */
}

/* نوار پایین */
.JFMediaMod-bottom-bar {
    position: relative;
    height: 80px;
    background: var(--bs-secondary-bg, var(--bs-body-bg));
    border-top: 1px solid var(--bs-border-color);
}

/* عنوان دوخطه */
.JFMediaMod-title-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.4;
    word-break: break-word;
}

.JFMediaMod-progress-container {
    position: relative;
    width: 100%;
    height: 6px;
    background: var(--bs-gray-800);
    border-radius: 4px;
    opacity: 0.6;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.2s, height 0.2s;
}

.JFMediaMod-progress-container:hover {
    height: 8px;
    opacity: 0.9;
}

.JFMediaMod-progress-played {
    position: absolute;
    top: 0;
    right: 0; /* شروع از سمت راست */
    height: 100%;
    background: var(--bs-info);
    width: 0%;
    pointer-events: none;
    border-radius: 4px;
    box-shadow: 0 0 10px var(--bs-primary);
}

.JFMediaMod-progress-buffer {
    position: absolute;
    top: 0;
    right: 0; /* شروع از سمت راست */
    height: 100%;
    background: rgba(100, 100, 100, 0.4);
    width: 0%;
    pointer-events: none;
    border-radius: 4px;
}

.JFMediaMod-progress-input {
    position: absolute;
    top: 0;
    right: 0; /* شروع از سمت راست */
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    direction: rtl; /* برای کارکرد صحیح input range در حالت راست‌چین */
}

/* گرید بندی نوار پایین */
.JFMediaMod-track-info { width: 30%; }
.JFMediaMod-controls { width: 40%; }
.JFMediaMod-extra-controls { width: 30%; }

/* تصویر کاور */
.JFMediaMod-cover-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    position: relative;
    flex-shrink: 0;
    background: var(--bs-gray-900);
    border-radius: 8px;
    overflow: hidden;
}
.JFMediaMod-cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* یکسان سازی دکمه‌های کنترل برای هر دو پنل */
.JFMediaMod-ctrl-btn {
    background: transparent;
    border: none;
    color: var(--bs-body-color);
    font-size: 1.4rem;
    padding: 5px 10px;
    transition: color 0.2s, transform 0.2s;
}
.JFMediaMod-expanded-panel .JFMediaMod-ctrl-btn {color: var(--bs-body-color);}
.JFMediaMod-ctrl-btn:hover { color: white !important; transform: scale(1.1); }

.JFMediaMod-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bs-primary) !important;
    color: var(--bs-body-color);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 15px rgba(var(--bs-primary-rgb), 0.4);
    transition: transform 0.2s, filter 0.2s;
}
.JFMediaMod-expanded-panel .JFMediaMod-play-btn { width: 60px; height: 60px; font-size: 2rem; }
.JFMediaMod-play-btn:hover {transform: scale(1.08);filter: brightness(1.1);color: white !important;}
.JFMediaMod-play-btn:active { transform: scale(0.95); }

/* دکمه باز و بسته کردن */
.JFMediaMod-toggle-btn {
    background: transparent;
    color: var(--bs-secondary-color);
    border: none;
    font-size: 1.2rem;
    padding: 0.4rem;
}
.JFMediaMod-toggle-btn:hover { color: var(--bs-body-color); }

/* استایل تب‌ها و لیست */
.JFMediaMod-tabs { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.JFMediaMod-tabs .nav-link { color: rgba(255,255,255,0.6); border: none; background: transparent; transition: color 0.2s; }
.JFMediaMod-tabs .nav-link:hover { color: white; }
.JFMediaMod-tabs .nav-link.active { color: var(--bs-primary); border-bottom: 2px solid var(--bs-primary); font-weight: bold; background: transparent; }

.playlist-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    transition: background 0.2s, color 0.2s;
}
.playlist-item:hover { background: rgba(255,255,255,0.1); color: white; }
.playlist-item.active-item { color: var(--bs-primary); background: rgba(0,0,0,0.3); font-weight: bold; }

.JFMediaMod-card-panel {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.JFMediaMod-player-wrapper .ratio::before {
    padding: 0;
}

.JFMediaMod-pitch-ctrl {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
    transition: all 0.2s;
}
.JFMediaMod-pitch-ctrl:hover { background: rgba(255, 255, 255, 0.15); }

/* کلاس های کمکی برای تم */
.JFMediaMod-player-wrapper .text-white { color: var(--bs-body-color) !important; }
.JFMediaMod-expanded-panel .text-white { color: #fff !important; }
.JFMediaMod-player-wrapper .text-white-50 { color: var(--bs-secondary-color) !important; }
.JFMediaMod-expanded-panel .text-white-50 { color: rgba(255,255,255,0.5) !important; }
.JFMediaMod-player-wrapper .bg-black { background: var(--bs-dark) !important; }

/* Custom Scrollbar */
.JFMediaMod-expanded-panel ::-webkit-scrollbar { width: 6px; height: 6px; }
.JFMediaMod-expanded-panel ::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 4px; }
.JFMediaMod-expanded-panel ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.JFMediaMod-expanded-panel ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }


.JFMediaMod-swiper-container {
    width: 100%;
    /* به جای کلاس ratio-16x9 بوت‌استرپ می‌توانید از این روش استفاده کنید تا ارتفاع منعطف‌تر باشد */
    aspect-ratio: 16 / 9; 
    max-height: 45vh; /* جلوگیری از بیش از حد بزرگ شدن در مانیتورهای بزرگ */
    background-color: #000;
}

.swiper-slide {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-size: contain; /* یا cover بسته به سلیقه شما */
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* لایه ویدئو - غیرقابل کلیک */
.JFMediaMod-video-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* این خط تداخل موس با ویدئو را کاملاً از بین می‌برد */
}

/* لایه شفاف برای کنترل درگ Swiper */
.JFMediaMod-drag-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    cursor: grab;
}

.JFMediaMod-drag-layer:active {
    cursor: grabbing;
}

@media (max-width: 992px) {
    .JFMediaMod-player-wrapper.expanded .JFMediaMod-expanded-panel { height: 100vh; }
}

/* ریسپانسیو (موبایل) */
@media (max-width: 768px) {
    .JFMediaMod-track-info {width: 35%;}
    .JFMediaMod-controls {width: 65%;}
    .JFMediaMod-extra-controls {width: 0%;/* display: none !important; */}
    .JFMediaMod-track-info .text-white-50, .JFMediaMod-track-info .text-secondary { display: none; }
}