/* ============================================================
   style.css — تصميم Dark Mode احترافي للمنصة
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ====== متغيرات التصميم ====== */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2230;
  --bg-card-hover: #222c3d;
  --bg-input: #0d1117;

  --accent: #4f8ef7;
  --accent-light: #6ba3ff;
  --accent-dark: #3a6fd6;
  --accent-glow: rgba(79, 142, 247, 0.25);

  --success: #2ea44f;
  --success-bg: rgba(46, 164, 79, 0.12);
  --warning: #d29922;
  --warning-bg: rgba(210, 153, 34, 0.12);
  --danger: #f85149;
  --danger-bg: rgba(248, 81, 73, 0.12);
  --info: #58a6ff;
  --info-bg: rgba(88, 166, 255, 0.1);

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;

  --border: rgba(255,255,255,0.08);
  --border-accent: rgba(79, 142, 247, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --shadow-accent: 0 4px 20px rgba(79, 142, 247, 0.2);

  --transition: 0.2s ease;
}

/* ====== Reset & Base ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  text-align: right;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input { font-family: inherit; }

/* ====== صفحة تسجيل الدخول ====== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(79, 142, 247, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(147, 51, 234, 0.05) 0%, transparent 60%),
    var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* خلفية متحركة */
.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 15% 85%, rgba(79, 142, 247, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(147, 51, 234, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
  animation: slideUp 0.4s ease;
}

/* الشعار */
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-accent), 0 0 0 1px rgba(79, 142, 247, 0.2);
}

.logo-title {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* بطاقة المصادقة */
.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.auth-form-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
}

/* مجموعة الإدخال */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

/* زر الإجراء الرئيسي */
.btn-primary {
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, var(--accent), #5b6af0);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
  filter: brightness(1.1);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* رابط التبديل */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--accent-light);
  font-weight: 600;
  cursor: pointer;
}

.auth-switch a:hover { text-decoration: underline; }

/* الشروط والأحكام */
.terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.terms-row input[type="checkbox"] { 
  width: 18px; 
  height: 18px; 
  margin-top: 2px;
  accent-color: var(--accent);
}

.terms-row.agreed {
  border-color: var(--success);
  background: var(--success-bg);
}

.terms-link {
  color: var(--accent-light);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}

/* رسائل الحالة */
.msg-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

.msg-error { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(248,81,73,0.2); }
.msg-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(46,164,79,0.2); }
.msg-info { background: var(--info-bg); color: var(--info); border: 1px solid rgba(88,166,255,0.2); }

/* المودال - الشروط */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.modal-box.show {
  transform: translateY(0);
  opacity: 1;
}

.modal-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent-light);
}

.modal-box ul {
  padding-right: 20px;
  margin: 12px 0;
}

.modal-box ul li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.modal-box p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 8px 0;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-agree {
  flex: 1;
  padding: 11px;
  background: var(--success);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}

.btn-agree:hover { filter: brightness(1.1); }

.btn-decline {
  flex: 1;
  padding: 11px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-decline:hover { border-color: var(--danger); color: var(--danger); }

/* عرض الحالة (Pending / Expired / Success) */
.status-display {
  text-align: center;
  padding: 16px;
}

.status-icon {
  font-size: 56px;
  margin-bottom: 16px;
  animation: bounce 1s ease infinite alternate;
}

.status-display h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.status-display p {
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-size: 15px;
}

.status-display .hint {
  font-size: 13px;
  color: var(--text-muted);
}

.contact-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 20px 0;
  flex-wrap: wrap;
}

.btn-whatsapp {
  padding: 12px 24px;
  background: #25d366;
  color: white;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
  transition: var(--transition);
}

.btn-whatsapp:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-email {
  padding: 12px 24px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

.btn-email:hover { border-color: var(--accent); }

.btn-secondary {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 8px;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent-light); }

/* ============================================================
   صفحة المستكشف الرئيسية
   ============================================================ */
.main-page {
  min-height: 100vh;
  background: var(--bg-primary);
}

/* الهيدر */
.main-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  text-align: left;
}

.user-name-text {
  font-size: 14px;
  font-weight: 600;
}

.user-expiry {
  font-size: 12px;
  color: var(--success);
}

.user-expiry.expiring-soon {
  color: var(--warning);
}

.btn-logout {
  padding: 7px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* شريط الأدوات */
.toolbar {
  padding: 16px 32px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow: hidden;
}

.crumb {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crumb.active { color: var(--text-primary); font-weight: 600; }

.crumb.clickable, .crumb.home-crumb {
  color: var(--accent-light);
  cursor: pointer;
  transition: var(--transition);
}

.crumb.clickable:hover, .crumb.home-crumb:hover { text-decoration: underline; }

.crumb-sep { color: var(--text-muted); font-size: 12px; }

/* البحث */
.search-box {
  position: relative;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  padding: 9px 16px 9px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.search-box input:focus { border-color: var(--accent); }
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

/* محتوى المستكشف */
.explorer-content {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* شبكة الكورسات */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.course-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  opacity: 0;
  transition: var(--transition);
}

.course-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.course-card:hover::before { opacity: 1; }

.course-icon {
  font-size: 36px;
  flex-shrink: 0;
}

.course-info { flex: 1; min-width: 0; }

.course-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.course-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-arrow {
  color: var(--text-muted);
  font-size: 18px;
  transition: var(--transition);
}

.course-card:hover .course-arrow { 
  color: var(--accent-light);
  transform: translateX(-4px);
}

/* رأس القسم */
.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.section-icon { font-size: 16px; }

/* شبكة المجلدات */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.item-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.item-icon { font-size: 32px; margin-bottom: 8px; }
.item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  direction: ltr;
  text-align: center;
}

/* قائمة الملفات */
.files-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}

.file-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.file-icon { font-size: 22px; flex-shrink: 0; }

.file-details { flex: 1; min-width: 0; }

.file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-actions { flex-shrink: 0; }

.btn-download {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent), #5b6af0);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-accent);
  filter: brightness(1.1);
}

/* حالات التحميل والخطأ */
.loading-state,
.error-state,
.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

.loading-state p,
.error-state h3,
.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.error-state p,
.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.error-icon, .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.btn-retry, .btn-contact {
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
}

.btn-retry:hover, .btn-contact:hover { filter: brightness(1.1); }

/* الـ Spinner في الزر */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* hidden */
.hidden { display: none !important; }

/* ====== Animations ====== */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .main-header { padding: 0 16px; }
  .toolbar { padding: 12px 16px; flex-wrap: wrap; }
  .explorer-content { padding: 16px; }
  .search-box { min-width: 100%; order: 3; }
  .breadcrumb { order: 1; }
  .courses-grid { grid-template-columns: 1fr; }
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .file-item { padding: 12px 14px; }
  .auth-card { padding: 24px; }
  .modal-actions { flex-direction: column; }
}

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ====== أزرار الملفات ====== */
.btn-watch {
  padding: 8px 16px;
  background: linear-gradient(135deg, #7c3aed, #5b6af0);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn-watch:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(124,58,237,0.35); filter: brightness(1.1); }

.btn-view {
  padding: 8px 16px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn-view:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(217,119,6,0.35); filter: brightness(1.1); }

/* تمييز صف الفيديو */
.file-item.is-video {
  border-color: rgba(124, 58, 237, 0.2);
}
.file-item.is-video:hover {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.05);
}

/* ============================================================
   مودال مشغّل الفيديو / عارض PDF
   ============================================================ */
.vmodal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.vmodal-overlay.hidden { display: none !important; }

.vmodal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(124,58,237,0.15);
  transform: translateY(30px) scale(0.97);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vmodal-box.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* هيدر المودال */
.vmodal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.vmodal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 48px);
}

.vmodal-close {
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.vmodal-close:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* جسم المودال */
.vmodal-body {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 300px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* حالة التحميل داخل المودال */
.vmodal-loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px;
}
.vmodal-loading p { margin-top: 12px; font-size: 14px; }

/* مشغّل الفيديو */
.vmodal-video {
  width: 100%;
  height: 100%;
  max-height: 70vh;
  display: block;
  background: #000;
  outline: none;
  /* منع السحب */
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

/* iframe للـ Preview / PDF */
.vmodal-iframe {
  width: 100%;
  height: 70vh;
  border: none;
  display: block;
  background: var(--bg-primary);
}

/* ====== Responsive للمودال ====== */
@media (max-width: 768px) {
  .vmodal-box { border-radius: var(--radius-lg); max-height: 100vh; }
  .vmodal-video { max-height: 55vh; }
  .vmodal-iframe { height: 55vh; }
  .vmodal-header { padding: 12px 16px; }
}

/* ============================================================
   شريط قنوات الدرايف المتعددة (Multi-Drive Switcher)
   ============================================================ */
.drive-tabs-bar {
  display: flex;
  gap: 10px;
  padding: 10px 24px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  align-items: center;
}

.drive-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.drive-tab-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: #38bdf8;
  color: #f8fafc;
  transform: translateY(-1px);
}

.drive-tab-btn.active {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.35);
}

.drive-tab-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: #e2e8f0;
}
