/* ==========================================================
   استایل‌های بخش ویدیوها
   نکته: این فایل باید بعد از style.css لود شود چون از
   متغیرهای :root تعریف‌شده در آن فایل استفاده می‌کند.
========================================================== */

/* ------------------ تنظیمات عمومی ------------------ */
.videos-section {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 40px;
    text-align: center;
}

.scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 20px 0;
}

.movies-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    min-width: fit-content;
    margin: 0 auto;
}

/* ------------------ کارت‌های ویدیو ------------------ */
.video-card {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(49, 27, 94, 0.05);
    border: 1px solid var(--bg-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(49, 27, 94, 0.1);
}

.video-thumbnail {
    position: relative; /* برای اینکه duration نسبت به این کانتینر مطلق شود */
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

/* مخفی کردن تمام آیکون‌های پلیِ تزریق‌شده توسط CSS قبلی */
.video-thumbnail::after,
.video-thumbnail::before,
.video-card::after,
.video-card::before {
    display: none !important;
}

/* دایره‌ی شیشه‌ای آیکون پلی */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;

    /* وسط‌چین کردنِ کاملِ آیکون */
    display: flex;
    justify-content: center;
    align-items: center;

    color: white;
    font-size: 20px; /* اندازه آیکون */
    backdrop-filter: blur(4px);
    pointer-events: none;
    transition: all 0.3s ease;

    /* کمی جابجایی آیکون برای ترازِ بهترِ بصری */
    padding-left: 4px;
}

.play-symbol {
    display: block;
    margin-top: 2px; /* تنظیمِ دستی برای ترازِ عمودی */
    margin-left: 2px; /* تنظیمِ دستی برای ترازِ افقی */
}

/* افکت هاور */
.video-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 183, 3, 0.9);
    border-color: transparent;
}

.video-duration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7); /* پس‌زمینه سیاه نیمه‌شفاف */
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: "vazir-regular", sans-serif !important; /* برای اینکه اعداد در محیط‌های فارسی دقیق‌تر نمایش داده شوند */
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(4px); /* کمی بلور برای شیک‌تر شدن */
    z-index: 5;
    letter-spacing: 0.5px;
    pointer-events: none; /* تا کلیک روی آن مانع باز شدن ویدیو نشود */
}

.video-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
}

.video-info h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 8px;
}

.video-description {
    font-size: 0.9em;
    color: var(--text-muted);
    margin: 5px 0 0 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ------------------ دکمه‌ها و عناصر ویژه ------------------ */

/* دکمه حذف — قبلاً دوبار با استایل‌های متفاوت تعریف شده بود، نسخه‌ی کامل‌تر (گرد + hover) نگه داشته شد */
.delete-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.view-more {
    background: #f8f9fa;
    border: 2px dashed #3498db;
    justify-content: center;
    align-items: center;
}

.view-more-content {
    color: #3498db;
    text-align: center;
}

.view-more-content span {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
}

.highlight-effect {
    border: 5px solid #00d166 !important;
    box-shadow: 0 0 25px #00d166 !important;
    transform: scale(1.02);
    transition: all 0.5s ease;
    z-index: 999 !important;
}

/* ------------------ مودال و پلیر ویدیو ------------------
   نکته: تعریف .modal-content به‌طور کامل به style.css منتقل شد
   (قبلاً اینجا هم یک نسخه‌ی متفاوت وجود داشت که با آن تناقض داشت).
*/
#player {
    aspect-ratio: 16 / 9;
    width: 100%;
}

.close-btn {
    position: absolute;
    top: -15px;
    left: -15px; /* ضربدر به سمت چپ منتقل شد */
    background: #fff; /* پس‌زمینه سفید برای تضاد بیشتر */
    color: #333; /* رنگ ضربدر تیره */
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* سایه نرم و شیک */
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e74c3c; /* قرمز شدن هنگام هاور */
    color: #fff;
    transform: rotate(90deg) scale(1.1); /* چرخش نرم */
}

/* ------------------ تنظیمات ریسپانسیو ------------------ */
@media screen and (max-width: 900px) {
    .movies-grid {
        justify-content: flex-start;
    }
}

@media screen and (max-width: 768px) {
    .videos-section {
        padding: 0 20px;
    }

    .video-card {
        width: 260px;
    }

    .video-thumbnail {
        height: 150px;
    }

    .video-info h3 {
        font-size: 16px;
    }
}

@media screen and (max-width: 360px) {
    .video-card {
        width: 240px;
    }

    .video-thumbnail {
        height: 135px;
    }
}

.edit-btn{
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(243,156,18,0.45);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.edit-btn i{
  transition: transform .25s ease;
}

.edit-btn:hover{
  background: linear-gradient(135deg, #ffb703, #f39c12);
  transform: translateY(-4px) scale(1.12);
  box-shadow: 0 8px 18px rgba(243,156,18,0.6);
}

.edit-btn:hover i{
  transform: rotate(-18deg) scale(1.1);
}

.edit-btn:active{
  transform: translateY(-1px) scale(0.95);
  box-shadow: 0 3px 8px rgba(243,156,18,0.4);
}


/* ===== کارت «مشاهده بیشتر» ===== */
.video-card.view-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.1), rgba(15, 52, 96, 0.35));
  border: 2px dashed rgba(255, 183, 3, 0.5);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}
.video-card.view-more:hover {
  background: linear-gradient(135deg, #ffb703, #fb8500);
  border-style: solid;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(255, 183, 3, 0.35);
}
.video-card.view-more .view-more-content {
  text-align: center;
  padding: 20px;
}
.video-card.view-more .vm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 183, 3, 0.15);
  color: #ffb703;
  font-size: 22px;
  margin-bottom: 10px;
  transition: all 0.25s ease;
}
.video-card.view-more:hover .vm-icon {
  background: rgba(255, 255, 255, 0.25);
  color: #241442;
  transform: scale(1.12) rotate(90deg);
}
.video-card.view-more .vm-title {
  color: #fff;
  font-weight: bold;
  font-size: 14px;
  margin: 0;
}
.video-card.view-more:hover .vm-title {
  color: #241442;
}
.video-card.view-more .vm-count {
  color: #ffb703;
  font-size: 12px;
  margin-top: 4px;
}
.video-card.view-more:hover .vm-count {
  color: #241442;
}

/* ===== اسکرول داخل بخش لیست کامل مودال ===== */
#videoModal #fullListSection {
  max-height: 80vh;
  overflow-y: auto;
  padding-left: 6px;
}
#videoModal .full-video-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

/* ===== تب‌های فیلتر پایه ===== */
.grade-filter-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 15px 0 25px 0;
}
.grade-tab-btn {
  padding: 8px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 183, 3, 0.3);
  color: #ccc;
  border-radius: 50px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  transition: all 0.2s ease;
}
.grade-tab-btn:hover {
  border-color: #ffb703;
  color: #ffb703;
}
.grade-tab-btn.active {
  background: linear-gradient(135deg, #ffb703, #fb8500);
  color: #241442;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 183, 3, 0.35);
}

/* ===== بزرگ‌تر شدن مودال + بلور بیشترِ پس‌زمینه ===== */
#videoModal {
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  background: rgba(5, 3, 10, 0.78) !important;
}
#videoModal .modal-content {
  width: 96vw !important;
  max-width: 1300px !important;
  max-height: 94vh !important;
}
#videoModal #fullListSection {
  max-height: 85vh;
  overflow-y: auto;
  padding-left: 6px;
}