/* ===== VIDEO SECTION ===== */
.videos-section {
  padding: 80px 20px;
  background: linear-gradient(180deg, #0a0a1a 0%, #0d0d2b 50%, #0a0a1a 100%);
  position: relative;
  overflow: hidden;
}
.videos-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0,188,212,.05) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(156,39,176,.05) 0%, transparent 60%);
  pointer-events: none;
}

/* دکمه‌های دسته‌بندی */
.video-cats-wrap {
  max-width: 1200px;
  margin: 0 auto 60px;
}
.video-cats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
.video-cat-btn {
  position: relative;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(0,188,212,.2);
  border-radius: 20px;
  padding: 28px 40px;
  color: #fff;
  font-size: 18px;
  font-family: inherit;
  cursor: none !important;
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
  overflow: hidden;
  min-width: 180px;
  text-align: center;
  backdrop-filter: blur(10px);
}
.video-cat-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,188,212,.1), rgba(156,39,176,.1));
  opacity: 0;
  transition: opacity .4s;
}
.video-cat-btn::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(0,188,212,.3) 60deg, transparent 120deg);
  animation: rotateBorder 4s linear infinite;
  opacity: 0;
  transition: opacity .4s;
}
.video-cat-btn:hover::before,
.video-cat-btn:hover::after { opacity: 1; }
.video-cat-btn:hover {
  transform: translateY(-8px) scale(1.05);
  border-color: rgba(0,188,212,.6);
  box-shadow:
    0 20px 40px rgba(0,188,212,.2),
    0 0 60px rgba(0,188,212,.1),
    inset 0 1px 0 rgba(255,255,255,.1);
}
.vcb-icon { font-size: 40px; display: block; margin-bottom: 12px; }
.vcb-title { font-weight: bold; display: block; }
.vcb-count {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 12px;
  background: rgba(0,188,212,.15);
  border-radius: 20px;
  font-size: 12px;
  color: #00bcd4;
}
@keyframes rotateBorder {
  to { transform: rotate(360deg); }
}

/* ===== MODAL ویدیو ===== */
#videoModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #060612;
  overflow-y: auto;
  animation: vmFadeIn .4s ease;
}
@keyframes vmFadeIn {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* هدر */
.vm-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 30px;
  background: rgba(6,6,18,.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,188,212,.15);
}
.vm-header h2 { color: #00bcd4; font-size: 22px; margin: 0; }
.vm-close {
  background: rgba(239,83,80,.1);
  border: 1px solid rgba(239,83,80,.4);
  color: #ef5350;
  width: 44px; height: 44px;
  border-radius: 50%; font-size: 18px;
  cursor: none !important; transition: all .3s;
  display: flex; align-items: center; justify-content: center;
}
.vm-close:hover { background: #ef5350; color: #fff; transform: rotate(90deg); }

/* ویدیو اصلی بالای صفحه */
.vm-hero {
  position: relative;
  width: 100%;
  background: #000;
  max-height: 70vh;
  overflow: hidden;
}
.vm-hero video {
  width: 100%;
  max-height: 70vh;
  display: block;
  object-fit: cover;
}
.vm-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(6,6,18,.8) 100%);
  pointer-events: none;
}

/* دکمه صدا */
.vm-sound-btn {
  position: absolute;
  bottom: 20px; left: 20px;
  background: rgba(0,0,0,.6);
  border: 2px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  cursor: none !important;
  backdrop-filter: blur(10px);
  transition: all .3s;
  display: flex; align-items: center; gap: 8px;
  animation: soundPulse 2s ease-in-out infinite;
}
.vm-sound-btn:hover {
  background: rgba(0,188,212,.3);
  border-color: #00bcd4;
  box-shadow: 0 0 20px rgba(0,188,212,.4);
}
@keyframes soundPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,188,212,.4); }
  50%      { box-shadow: 0 0 0 8px rgba(0,188,212,0); }
}
.vm-sound-icon { font-size: 20px; transition: transform .3s; }
.vm-sound-btn.unmuted .vm-sound-icon { animation: shake .3s; }
@keyframes shake {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.3); }
}

/* برچسب Live */
.vm-live-badge {
  position: absolute;
  top: 20px; right: 20px;
  background: linear-gradient(135deg, #00bcd4, #9c27b0);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  display: flex; align-items: center; gap: 6px;
}
.vm-live-dot {
  width: 8px; height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: blink 1s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; } 50% { opacity: .2; }
}

/* بدنه اصلی */
.vm-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 30px;
}

/* توضیحات دسته */
.vm-cat-desc {
  color: #aaa;
  font-size: 15px;
  line-height: 2;
  padding: 20px 24px;
  background: rgba(0,188,212,.05);
  border-right: 3px solid #00bcd4;
  border-radius: 10px;
  margin-bottom: 40px;
}

/* تیتر بخش ویدیوها */
.vm-items-title {
  color: #fff;
  font-size: 22px;
  margin-bottom: 30px;
  display: flex; align-items: center; gap: 12px;
}
.vm-items-title::before {
  content: '';
  width: 4px; height: 28px;
  background: linear-gradient(#00bcd4, #9c27b0);
  border-radius: 2px;
}

/* گرید ویدیوهای زیرین */
.vm-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

/* کارت ویدیو */
.vm-item-card {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 20px;
  overflow: hidden;
  cursor: none !important;
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
  position: relative;
}
.vm-item-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,188,212,.05), rgba(156,39,176,.05));
  opacity: 0; transition: opacity .4s; z-index: 0;
}
.vm-item-card:hover {
  transform: translateY(-10px);
  border-color: rgba(0,188,212,.4);
  box-shadow:
    0 30px 60px rgba(0,0,0,.5),
    0 0 40px rgba(0,188,212,.1);
}
.vm-item-card:hover::before { opacity: 1; }

/* تامبنیل */
.vm-thumb {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #111;
}
.vm-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.vm-item-card:hover .vm-thumb img { transform: scale(1.1); }
.vm-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  font-size: 60px;
}

/* دکمه پلی روی تامبنیل */
.vm-play-overlay {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3);
  transition: background .3s;
}
.vm-item-card:hover .vm-play-overlay { background: rgba(0,0,0,.1); }
.vm-play-btn-big {
  width: 60px; height: 60px;
  background: rgba(0,188,212,.2);
  border: 2px solid rgba(0,188,212,.6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
  backdrop-filter: blur(5px);
  transition: all .3s;
  box-shadow: 0 0 30px rgba(0,188,212,.3);
}
.vm-item-card:hover .vm-play-btn-big {
  background: rgba(0,188,212,.5);
  transform: scale(1.15);
  box-shadow: 0 0 50px rgba(0,188,212,.5);
}

/* اطلاعات کارت */
.vm-item-info {
  padding: 18px;
  position: relative; z-index: 1;
}
.vm-item-info h4 { color: #fff; margin: 0 0 8px; font-size: 17px; }
.vm-item-info p  { color: #888; font-size: 13px; line-height: 1.7; margin: 0 0 16px; }
.vm-item-actions { display: flex; gap: 10px; }
.vm-watch-btn, .vm-dl-btn {
  flex: 1; padding: 10px;
  border-radius: 10px;
  font-size: 13px; font-family: inherit;
  cursor: none !important; transition: all .3s;
  text-align: center; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.vm-watch-btn {
  background: linear-gradient(135deg, rgba(0,188,212,.15), rgba(156,39,176,.15));
  border: 1px solid rgba(0,188,212,.3);
  color: #00bcd4;
}
.vm-watch-btn:hover {
  background: linear-gradient(135deg, #00bcd4, #9c27b0);
  color: #fff; border-color: transparent;
  box-shadow: 0 5px 20px rgba(0,188,212,.3);
}
.vm-dl-btn {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #aaa;
}
.vm-dl-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* مودال پخش ویدیو */
#videoPlayerModal {
  display: none;
  position: fixed; inset: 0;
  z-index: 10001;
  background: rgba(0,0,0,.95);
  align-items: center; justify-content: center;
  animation: vpFadeIn .3s ease;
}
#videoPlayerModal.open { display: flex; }
@keyframes vpFadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.vp-inner {
  width: 95vw; max-width: 960px;
  background: #111;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0,188,212,.3);
  box-shadow: 0 0 80px rgba(0,188,212,.2);
  position: relative;
}
.vp-header {
  padding: 16px 60px 16px 20px;
  background: rgba(0,0,0,.5);
  color: #00bcd4; font-size: 16px; font-weight: bold;
  border-bottom: 1px solid rgba(0,188,212,.2);
}
.vp-close {
  position: absolute; top: 10px; left: 12px;
  background: rgba(239,83,80,.8); border: none;
  color: #fff; width: 40px; height: 40px;
  border-radius: 50%; font-size: 16px;
  cursor: none !important; transition: all .3s;
  display: flex; align-items: center; justify-content: center;
}
.vp-close:hover { background: #ef5350; transform: rotate(90deg); }
.vp-inner video {
  width: 100%; display: block;
  max-height: 75vh;
  background: #000;
}
.vp-desc {
  padding: 16px 20px;
  color: #aaa; font-size: 14px;
  border-top: 1px solid rgba(255,255,255,.05);
}

/* empty / loading */
.vm-empty {
  grid-column: 1/-1;
  text-align: center; padding: 60px;
  color: #555; font-size: 16px;
}
.vm-loading {
  text-align: center; padding: 80px;
  color: #00bcd4; font-size: 28px;
}

/* ===== ADMIN ===== */
.va-section { margin-bottom: 50px; }
.va-section h3 {
  color: #00bcd4; font-size: 20px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,188,212,.2);
}
.va-form {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px; padding: 28px;
}
.va-form label { display: block; color: #ccc; font-size: 14px; margin-bottom: 6px; }
.va-form input[type=text],
.va-form textarea,
.va-form select {
  width: 100%;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff; border-radius: 10px;
  padding: 12px 16px; font-size: 14px;
  font-family: inherit; margin-bottom: 18px;
  transition: border-color .3s;
  box-sizing: border-box;
}
.va-form input:focus,
.va-form textarea:focus,
.va-form select:focus {
  outline: none;
  border-color: #00bcd4;
  box-shadow: 0 0 0 3px rgba(0,188,212,.1);
}
.va-form textarea { height: 100px; resize: vertical; }
.va-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.va-submit {
  background: linear-gradient(135deg, #00bcd4, #9c27b0);
  border: none; color: #fff; padding: 12px 32px;
  border-radius: 10px; font-size: 15px; font-family: inherit;
  cursor: pointer; transition: all .3s;
}
.va-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0,188,212,.3);
}

/* جدول ادمین */
.va-table-wrap { overflow-x: auto; border-radius: 12px; overflow: hidden; }
.va-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.va-table th {
  background: rgba(0,188,212,.1);
  color: #00bcd4; padding: 14px 16px; text-align: right;
}
.va-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: #ccc;
}
.va-table tr:hover td { background: rgba(255,255,255,.02); }
.va-del-btn {
  background: rgba(239,83,80,.1);
  border: 1px solid rgba(239,83,80,.3);
  color: #ef5350; padding: 6px 14px;
  border-radius: 8px; font-size: 13px;
  cursor: pointer; transition: all .3s;
}
.va-del-btn:hover { background: #ef5350; color: #fff; }

.va-tabs {
  display: flex; gap: 10px; margin-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.va-tab {
  padding: 12px 24px; border: none;
  background: transparent; color: #888;
  font-size: 15px; font-family: inherit;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all .3s; margin-bottom: -1px;
}
.va-tab.active { color: #00bcd4; border-bottom-color: #00bcd4; }

.alert-success {
  background: rgba(76,175,80,.15);
  border: 1px solid rgba(76,175,80,.3);
  color: #81c784; padding: 12px 20px;
  border-radius: 10px; margin-bottom: 20px;
}
.alert-error {
  background: rgba(239,83,80,.15);
  border: 1px solid rgba(239,83,80,.3);
  color: #ef9a9a; padding: 12px 20px;
  border-radius: 10px; margin-bottom: 20px;
}

video.thumb-preview {
  width: 80px; height: 50px;
  object-fit: cover; border-radius: 6px;
}

@media (max-width: 768px) {
  .vm-items-grid { grid-template-columns: 1fr; }
  .vm-body { padding: 20px 16px; }
  .vm-hero,
  .vm-hero video { max-height: 40vh; }
  .video-cats-grid { flex-direction: column; align-items: center; }
  .video-cat-btn { width: 100%; max-width: 320px; }
  .va-form .form-row { grid-template-columns: 1fr; }
}
