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

/* ==========================================================================
   صوتي ستوديو — نظام التصميم الموحد الشامل (Master Design System)
   ========================================================================== */

/* 1. المتغيرات العامة (Design Tokens) */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.14);

  --ai-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #6366f1 100%);
  --ai-glow: rgba(236, 72, 153, 0.45);

  --navy: #0f172a;
  --text-main: #334155;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --card-bg: #ffffff;

  --border-light: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #3b82f6;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 20px -3px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 32px -4px rgba(15, 23, 42, 0.12);

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

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-page);
  color: var(--text-main);
  font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

.container {
  width: min(1340px, calc(100% - 32px));
  margin: auto;
}

/* 2. الهيدر الموحد */
.header {
  width: min(1340px, calc(100% - 32px));
  margin: 16px auto 20px;
  position: static;
  background: linear-gradient(135deg, #1e3a8a 0%, #0369a1 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 22px -4px rgba(30, 58, 138, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
}

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

.brand .logo {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.brand b {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.brand small {
  display: block;
  font-size: 11px;
  opacity: 0.85;
  direction: ltr;
  text-align: right;
  font-weight: 600;
}

.head-inner nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 14px;
}

.head-inner nav > a {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.9);
}

.head-inner nav > a:hover,
.head-inner nav > a.active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* القوائم المنسدلة */
.dropdown {
  position: relative;
}

.dropbtn {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.dropbtn:hover,
.dropdown.open .dropbtn,
.dropbtn.active {
  background: rgba(255, 255, 255, 0.18);
}

.dropmenu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #ffffff;
  color: var(--text-main);
  min-width: 250px;
  padding: 8px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  z-index: 200;
}

.dropdown.open .dropmenu {
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: dropFade 0.2s ease;
}

@keyframes dropFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropmenu a {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
}

.dropmenu a:hover,
.dropmenu a.active {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(-3px);
}

.actions {
  display: flex;
  gap: 10px;
}

.actions a {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
}

.actions a:hover,
.actions a.active {
  background: #ffffff;
  color: var(--primary);
  transform: translateY(-2px);
}

/* زر لايف المباشر السريع المميز في الهيدر */
.nav-live-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  color: #ffffff !important;
  padding: 6px 14px !important;
  border-radius: 20px !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.nav-live-btn:hover,
.nav-live-btn.active {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.45);
}

.nav-live-btn .live-dot {
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  animation: liveBlink 1.4s infinite;
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.7); }
}

/* 3. الفوتر الموحد */
.footer {
  width: min(1340px, calc(100% - 32px));
  margin: 36px auto 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #1e3a8a 0%, #0369a1 100%);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -4px rgba(30, 58, 138, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 26px;
}

.foot-inner p {
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.95;
}

.foot-inner nav {
  display: flex;
  gap: 16px;
  font-size: 13.5px;
  font-weight: 600;
}

.foot-inner nav a { opacity: 0.85; }
.foot-inner nav a:hover { opacity: 1; text-decoration: underline; }

.social { display: flex; gap: 8px; }
.social a {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s;
}

.social a:hover {
  background: #ffffff;
  color: var(--primary);
  transform: translateY(-2px);
}

/* 4. السلايدر المتحرك الصغير التفاعلي (Mini Ticker) */
.mini-ticker {
  margin: 18px 0 26px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  gap: 14px;
}

.ticker-badge {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.ticker-track-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
}

.ticker-track {
  display: flex;
  gap: 12px;
  animation: tickerSlide 28s linear infinite;
  white-space: nowrap;
  width: max-content;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes tickerSlide {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.2s;
  flex: none;
}

.ticker-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
  transform: translateY(-2px);
}

.ticker-item span { font-size: 16px; }

/* 5. قسم الهيرو والسلايدر */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 330px;
  padding: 32px 5%;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 50%, #eff6ff 100%);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-top: 10px;
}

.hero-copy {
  text-align: right;
  z-index: 2;
}

.hero-copy label {
  display: inline-block;
  background: #ffffff;
  padding: 5px 14px;
  border-radius: 20px;
  color: var(--primary);
  font-weight: 700;
  font-size: 12.5px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-light);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.3;
  margin: 6px 0 12px;
  font-weight: 900;
  color: var(--navy);
}

.hero h1 strong { color: var(--primary); }

.hero p {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  padding: 11px 26px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14.5px;
  border: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.button:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  color: #ffffff;
}

.button.secondary {
  background: #ffffff;
  color: var(--navy);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.button.secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--primary);
}

.hero .hero-art {
  position: relative;
  min-height: 280px;
  align-self: stretch;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.18);
  border: 2px solid rgba(255, 255, 255, 0.9);
  background: #e0f2fe;
}

.hero .slides {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero .slides > * {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .8s ease, transform .8s ease;
  transform: scale(1.02);
}

.hero .slides > *.on {
  opacity: 1;
  transform: scale(1);
}

.hero .slides img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
}

.hero .ph .ph-icon { font-size: 56px; }
.hero .ph b { font-size: 20px; color: var(--navy); font-weight: 800; }
.hero .ph small { font-size: 13.5px; color: var(--text-muted); font-weight: 600; max-width: 320px; }

.hero .ph1 { background: linear-gradient(135deg, #bfdbfe, #eff6ff); }
.hero .ph2 { background: linear-gradient(135deg, #ddd6fe, #f5f3ff); }
.hero .ph3 { background: linear-gradient(135deg, #fed7aa, #fff7ed); }
.hero .ph4 { background: linear-gradient(135deg, #bbf7d0, #f0fdf4); }

.hero .dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}

.hero .dots b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: all 0.3s;
  font-size: 0;
}

.hero .dots b.on {
  width: 24px;
  border-radius: 10px;
  background: var(--primary);
}

/* 6. أيقونات SVG المتجهة */
.logo svg { display: block; stroke-width: 2.2; }
.actions a svg { display: block; }
.social a svg { display: block; }
.tool .icon svg { display: block; margin: auto; transition: transform .3s ease; }
.tool:hover .icon svg { transform: scale(1.1); }
.tool-heading > span svg { display: block; width: 34px; height: 34px; }
.placeholder div svg { display: block; margin: auto; width: 64px; height: 64px; opacity: .85; }
.ad-icon svg { width: 56px; height: 56px; display: inline-block; vertical-align: middle; }

/* 7. كروت الأدوات والشبكات */
.section-title {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  text-align: center;
  margin: 36px 0 24px;
}

.section-title > span {
  height: 1.5px;
  width: 50px;
  background: #cbd5e1;
}

.section-title h2 {
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 800;
  color: var(--navy);
}

.section-title p {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14.5px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
}

.cards, .teacher-cards, .student-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.tool {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: space-between;
  min-height: 250px;
  box-shadow: var(--shadow-xs);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.tool::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--c, var(--primary));
  opacity: 0.8;
  transition: height 0.2s;
}

.tool:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.tool:hover::before { height: 5px; }

.tool .icon {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-lg);
  background: var(--bg-icon, var(--primary-light));
  color: var(--c, var(--primary));
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid var(--border-subtle);
}

.tool h3 {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.tool p {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.tool b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-icon, var(--primary-light));
  color: var(--c, var(--primary));
  font-weight: 700;
  font-size: 13px;
  transition: all 0.2s;
}

.tool:hover b {
  background: var(--c, var(--primary));
  color: #ffffff;
}

.blue { --c: #2563eb; --bg-icon: #eff6ff; }
.purple { --c: #7c3aed; --bg-icon: #f5f3ff; }
.orange { --c: #ea580c; --bg-icon: #fff7ed; }
.green { --c: #059669; --bg-icon: #ecfdf5; }
.sky { --c: #0284c7; --bg-icon: #f0f9ff; }
.emerald { --c: #10b981; --bg-icon: #ecfdf5; }
.rose { --c: #e11d48; --bg-icon: #fff1f2; }
.amber { --c: #d97706; --bg-icon: #fffbeb; }

.soon {
  --c: #94a3b8;
  --bg-icon: #f8fafc;
  border-style: dashed;
}

/* بطاقة الشات بوت المميزة في العمود الجانبي */
.side-card.bot-promo {
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 60%, #ec4899 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  padding: 20px 16px;
  box-shadow: 0 10px 25px -4px rgba(67, 56, 202, 0.35);
}

.side-card.bot-promo h4 {
  color: #ffffff;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 8px;
}

.side-card.bot-promo p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 14px;
}

.side-card.bot-promo .button {
  background: #ffffff;
  color: #4338ca;
  width: 100%;
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.side-card.bot-promo .button:hover {
  background: #f8fafc;
  color: #312e81;
}

.ad {
  position: sticky;
  top: 20px;
  background: linear-gradient(135deg, #1e3a8a 0%, #0369a1 100%);
  color: #ffffff;
  padding: 22px 18px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ad h2 {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
}

.ad strong { color: #fde047; }

.ad ul {
  list-style: none;
  font-weight: 600;
  font-size: 13.5px;
  line-height: 2.1;
  margin-bottom: 16px;
  text-align: right;
  width: 100%;
  padding-right: 8px;
}

.ad ul li::before {
  content: "✔ ";
  color: #6ee7b7;
  font-weight: bold;
}

.ad-icon {
  margin: 6px auto 14px;
  color: rgba(255, 255, 255, 0.9);
}

.button.white {
  background: #ffffff;
  color: var(--primary);
  width: 100%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.button.white:hover {
  background: #f8fafc;
  color: var(--primary-hover);
}

.about {
  text-align: center;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin: 28px 0;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.about h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.about p {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14.5px;
}

/* 8. صفحات الأدوات والشريط الجانبي */
.tool-page {
  min-height: 75vh;
  padding: 12px 0 40px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 14px;
  padding: 6px 14px;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.back:hover {
  color: var(--primary-hover);
  border-color: #cbd5e1;
  transform: translateX(3px);
}

.tool-heading {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 8px 0 20px;
  padding: 18px 22px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.tool-heading > span {
  width: 54px;
  height: 54px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--border-subtle);
}

.tool-heading h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
}

.tool-heading p {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13.5px;
  margin-top: 3px;
}

.workspace {
  background: #ffffff;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}

.sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 20px;
}

.side-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}

.side-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 10px;
}

.side-card h4 span { font-size: 16px; }

.side-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.5;
}

.side-card ul li {
  position: relative;
  padding-right: 14px;
}

.side-card ul li::before {
  content: "•";
  position: absolute;
  right: 0;
  color: var(--primary);
  font-weight: bold;
}

.side-card.ad-card {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px dashed #93c5fd;
  text-align: center;
  padding: 14px 12px;
}

.side-card.ad-card small.tag {
  display: inline-block;
  background: #ffffff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  margin-bottom: 6px;
}

.side-card.ad-card p {
  font-size: 12px;
  font-weight: 700;
  color: #1e3a8a;
  margin: 4px 0 8px;
}

.side-card.ad-card a.ad-btn {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.side-card.ad-card a.ad-btn:hover { background: var(--primary-hover); }

/* 9. نظام تبويبات ومكونات استوديو المعلم والطالب */
.teacher-tabs, .student-tabs {
  display: flex;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px;
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.6);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-btn span { font-size: 17px; }

.tab-content { display: none; }
.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.teacher-grid, .student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.teacher-box, .student-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-xs);
}

.teacher-box h3, .student-box h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.teacher-box p.desc, .student-box p.desc {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
}

.teacher-box textarea, .student-box textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  background: #f8fafc;
  color: var(--text-main);
  line-height: 1.6;
}

.quiz-options, .doc-options, .student-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.quiz-options label, .doc-options label, .student-filter-grid label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.quiz-options select, .doc-options select, .student-filter-grid select, .quiz-options input, .student-filter-grid input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
}

/* 10. شريط فلترة بوابة الطالب */
.student-filter-bar {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-xs);
}

.student-filter-bar .filter-item {
  flex: 1;
  min-width: 140px;
}

.student-filter-bar .filter-item label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.student-filter-bar .filter-item select, .student-filter-bar .filter-item input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  background: #f8fafc;
}

.resource-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s;
}

.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.resource-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.badge-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
}

.resource-card h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}

.resource-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 14px;
}

.pomodoro-box {
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.pomodoro-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pomodoro-info span { font-size: 32px; }

.pomodoro-time {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

/* ==========================================================================
   11. الأيقونة الدائرية العائمة للشات بوت التفاعلي (موجودة في اليمين بألوان مبهرة)
   ========================================================================== */
.floating-bot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px; /* منقولة إلى اليمين */
  left: auto;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-direction: row-reverse; /* في العربي: الزر على اليمين والتلميح يساره */
}

.bot-avatar-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  /* تدرج الذكاء الاصطناعي المبهر (Cyberpunk / AI Violet-Magenta-Amber) */
  background: linear-gradient(135deg, #ff2a85 0%, #8b5cf6 55%, #3b82f6 100%);
  color: #ffffff;
  border: 3.5px solid #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(255, 42, 133, 0.45), 0 0 20px rgba(139, 92, 246, 0.4);
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: botPulse 2.4s infinite;
}

.bot-avatar-btn:hover {
  transform: scale(1.12) rotate(4deg);
  box-shadow: 0 14px 34px rgba(255, 42, 133, 0.65), 0 0 28px rgba(139, 92, 246, 0.6);
}

.bot-inner-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: botBounce 3s ease-in-out infinite;
}

.bot-inner-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.25));
}

@keyframes botBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes botPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 42, 133, 0.7), 0 8px 22px rgba(139, 92, 246, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(255, 42, 133, 0), 0 8px 22px rgba(139, 92, 246, 0.4); }
  100% { box-shadow: 0 0 0 0 rgba(255, 42, 133, 0), 0 8px 22px rgba(139, 92, 246, 0.4); }
}

.bot-badge-online {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 15px;
  height: 15px;
  background: #10b981;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

.bot-tooltip {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
  animation: floatTooltip 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-tooltip::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #1e1b4b;
}

@keyframes floatTooltip {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* نافذة الشات المنبثقة الذكية (موجودة في اليمين فوق الزر) */
.chat-drawer {
  position: fixed;
  bottom: 98px;
  right: 24px; /* منقولة لليمين */
  left: auto;
  width: min(400px, calc(100vw - 32px));
  height: 530px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px -8px rgba(15, 23, 42, 0.22);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpChat 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-drawer.open { display: flex; }

@keyframes slideUpChat {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-head {
  background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 60%, #ec4899 100%);
  color: #ffffff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-head-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-head-info b { display: block; font-size: 15.5px; font-weight: 800; }
.chat-head-info small { color: #6ee7b7; font-size: 11.5px; font-weight: 700; }

.chat-close-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.chat-close-btn:hover { background: rgba(255, 255, 255, 0.35); }

.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
}

.chat-msg.bot {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  align-self: flex-start;
  border-bottom-right-radius: 2px;
  box-shadow: var(--shadow-xs);
}

.chat-msg.user {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-left-radius: 2px;
}

.chat-quick-chips {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  white-space: nowrap;
}

.chat-chip {
  background: #f1f5f9;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s;
}

.chat-chip:hover {
  background: #eff6ff;
  color: var(--primary);
  border-color: #bfdbfe;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

.chat-input-row input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13.5px;
  background: #f8fafc;
}

.chat-input-row button {
  background: var(--ai-gradient);
  color: #ffffff;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-weight: 800;
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

/* 12. باقي مكونات الأدوات الفردية */
.tts-panel, .rec-panel, .stt-panel, .audio-panel, .video-panel {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}

.tts-panel h2, .rec-panel h2, .stt-panel h2, .audio-panel h2, .video-panel h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17.5px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.tts-panel h2 i, .rec-panel h2 i, .stt-panel h2 i, .audio-panel h2 i, .video-panel h2 i {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 15px;
}

.tts-panel > small, .rec-panel > small, .stt-panel > small, .audio-panel > small, .video-panel > small {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  display: block;
  margin-bottom: 12px;
}

.tts-panel textarea {
  width: 100%;
  min-height: 140px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  background: #f8fafc;
  color: var(--text-main);
  transition: all 0.2s;
}

.counter {
  display: flex;
  justify-content: flex-end;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 8px;
}

.voice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 12px 0 16px;
}

.vinfo small {
  display: block;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

#vname { font-weight: 800; font-size: 16px; color: var(--primary); }

.vbig {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: all 0.2s;
}

.vbig:hover { background: var(--primary-hover); transform: scale(1.06); }
.vbig.playing { background: #059669; box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3); }

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.btn-row .button {
  flex: 1;
  min-width: 140px;
  font-size: 13.5px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
}

#vtest, #pdownload {
  background: #059669;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

#vtest:hover, #pdownload:hover { background: #047857; }

.tts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.tts-grid label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--navy);
}

.tts-grid select, .tts-grid input[type=range] {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
}

.tts-grid input[type=range] { padding: 0; accent-color: var(--primary); }

.preview {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.preview .play {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  flex: none;
  transition: 0.2s;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.2);
}

.preview .play:hover { background: var(--primary-hover); transform: scale(1.05); }

.wave {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 44px;
  min-width: 120px;
}

.wave i {
  width: 3.5px;
  height: 8px;
  background: #cbd5e1;
  border-radius: 2px;
  transition: .15s;
}

.wave.on i { animation: bars .7s infinite ease-in-out alternate; }
.wave.on i:nth-child(2n) { animation-delay: .15s; }
.wave.on i:nth-child(3n) { animation-delay: .3s; }
.wave.on i:nth-child(5n) { animation-delay: .45s; }
@keyframes bars { to { height: 36px; background: var(--primary); } }

.status {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12.5px;
  margin-top: 4px;
}

/* تسجيل الشاشة */
.modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.modes label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--navy);
  text-align: center;
  transition: all 0.2s;
}

.modes label span { font-size: 24px; }
.modes input { display: none; }
.modes input:checked + label, .modes label:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
}

.console {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 26px 20px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
  margin-top: 10px;
}

.console button { border: 0; cursor: pointer; font-family: inherit; font-weight: 700; }

#btnStart {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: #ef4444;
  color: #ffffff;
  font-size: 13.5px;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#btnStart b { font-size: 28px; line-height: 1; }
#btnStart:hover { transform: scale(1.05); background: #dc2626; box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4); }
#btnStart:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; transform: none; }

.ctrl-side { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.timer { font-size: 40px; font-weight: 900; color: var(--primary); font-variant-numeric: tabular-nums; letter-spacing: 2px; text-align: center; }
.timer small { display: block; text-align: center; font-size: 12.5px; color: var(--text-muted); font-weight: 600; letter-spacing: 0; }

#btnPause, #btnStop { width: 48px; height: 48px; border-radius: 50%; color: #ffffff; font-size: 17px; transition: all 0.2s; }
#btnPause { background: #f59e0b; box-shadow: 0 3px 10px rgba(245, 158, 11, 0.2); }
#btnPause:hover { background: #d97706; }
#btnStop { background: #475569; box-shadow: 0 3px 10px rgba(71, 85, 105, 0.2); }
#btnStop:hover { background: #334155; }
#btnPause:disabled, #btnStop:disabled { background: #cbd5e1; cursor: not-allowed; box-shadow: none; }

#previewVideo, #previewAudio { width: 100%; border-radius: var(--radius-md); border: 1px solid var(--border-light); background: #000; margin-top: 14px; box-shadow: var(--shadow-xs); }
#previewAudio { background: #f8fafc; }
.result-info { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--text-muted); font-weight: 700; font-size: 12.5px; margin-top: 10px; }
#btnSave { width: 100%; margin-top: 14px; padding: 11px; }

#cropStage { position: relative; background: #000; border-radius: var(--radius-md); overflow: hidden; user-select: none; margin-top: 14px; aspect-ratio: 16/9; max-height: 400px; }
#cropStage video { width: 100%; height: 100%; object-fit: contain; display: block; cursor: crosshair; }
#cropRect { position: absolute; border: 2px solid #10b981; background: rgba(16, 185, 129, 0.2); border-radius: 6px; pointer-events: none; }
.settings-note { margin-top: 10px; color: var(--text-muted); font-size: 12.5px; font-weight: 600; }

/* دروب زون */
.drop-zone {
  border: 1px dashed #93c5fd;
  background: #f0f9ff;
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.drop-zone:hover { background: #e0f2fe; border-color: var(--primary); }
.drop-zone-icon { color: var(--primary); margin-bottom: 8px; }
.drop-zone h3 { font-size: 15px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.drop-zone p { color: var(--text-muted); font-size: 12.5px; font-weight: 600; }

.stt-output {
  width: 100%;
  min-height: 170px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: inherit;
  font-size: 14.5px;
  resize: vertical;
  background: #f8fafc;
  color: var(--text-main);
  line-height: 1.8;
}

.stt-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.stt-actions .button { flex: 1; font-size: 13.5px; border-radius: var(--radius-md); padding: 10px 14px; }

/* فلاتر وتحويل */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.filter-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.filter-card b { display: block; font-size: 13.5px; color: var(--navy); margin-bottom: 4px; font-weight: 800; }
.filter-card small { display: block; color: var(--text-muted); font-size: 12px; margin-bottom: 10px; }
.filter-card input[type=range] { width: 100%; accent-color: #059669; }

.convert-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.option-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.option-box label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--navy);
}

.option-box select {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
}

/* الإعدادات */
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
}

.setting .info { display: flex; align-items: center; gap: 12px; }
.setting .info > span {
  width: 40px;
  height: 40px;
  font-size: 18px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: none;
}
.setting .info b { display: block; font-size: 14px; font-weight: 800; color: var(--navy); }
.setting .info small { color: var(--text-muted); font-weight: 600; font-size: 12px; }

.switch { position: relative; width: 48px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #cbd5e1; border-radius: 20px; transition: .2s; cursor: pointer; }
.switch i:before { content: ""; position: absolute; top: 2.5px; right: 2.5px; width: 19px; height: 19px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.switch input:checked + i { background: #059669; }
.switch input:checked + i:before { transform: translateX(-24px); }
.switch input:disabled + i { opacity: .55; cursor: not-allowed; }

.conn-section {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.conn-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: #eff6ff;
  border-bottom: 1px solid var(--border-light);
}

.conn-head > span {
  width: 40px;
  height: 40px;
  font-size: 20px;
  background: #ffffff;
  color: var(--primary);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: var(--shadow-xs);
}

.conn-head b { display: block; font-size: 15px; font-weight: 800; color: var(--navy); }
.conn-head small { color: var(--primary); font-weight: 700; font-size: 12.5px; }

.conn-body { padding: 20px; }
.conn-body label { display: block; font-size: 12.5px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }

.conn-field { position: relative; margin-bottom: 14px; }
.conn-field input {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 9px 40px 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  background: #f8fafc;
  direction: ltr;
  text-align: left;
}

.conn-field button {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  border: 0;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
}

.conn-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.conn-actions .button { flex: 1; min-width: 130px; font-size: 13px; padding: 9px 16px; }

#connTest { background: #059669; box-shadow: 0 4px 10px rgba(5, 150, 105, 0.2); }
#connTest:hover { background: #047857; }

.conn-status {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #eff6ff;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  border: 1px solid #dbeafe;
}

.conn-status[data-state="success"] { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.conn-status[data-state="error"] { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.conn-status[data-state="loading"] { background: #eff6ff; color: var(--primary); border-color: #bfdbfe; }

/* 13. إمكانية الوصول والتجاوب */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-glow);
  border-color: var(--border-focus);
}

@media (max-width: 960px) {
  .layout, .page-layout { grid-template-columns: 1fr; }
  .cards, .teacher-cards, .student-cards { grid-template-columns: repeat(2, 1fr); }
  .sidebar-col { position: static; }
}

@media (max-width: 768px) {
  .head-inner { flex-wrap: wrap; padding: 12px 16px; }
  .head-inner nav { order: 3; width: 100%; justify-content: center; gap: 4px; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { text-align: center; }
  .hero p { margin: 0 auto 18px; }
  .hero-actions { justify-content: center; }
  .foot-inner { flex-direction: column; text-align: center; gap: 12px; padding: 16px; }
  .foot-inner nav { flex-wrap: wrap; justify-content: center; }
  .teacher-tabs, .student-tabs { flex-direction: column; }
  .floating-bot-widget { bottom: 16px; right: 16px; left: auto; }
  .chat-drawer { bottom: 88px; right: 16px; left: auto; width: calc(100vw - 32px); height: 470px; }
}

@media (max-width: 480px) {
  .cards, .teacher-cards, .student-cards { grid-template-columns: 1fr; }
}


/* ==========================================================================
   14. تصميم غرفة البث المباشر (Live Classroom Suite) - مثل زووم
   ========================================================================== */
.live-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  margin-top: 18px;
}

.live-main-stage {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.live-screen-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.4);
  border: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-screen-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* بطاقة المعلم العائمة داخل شاشة البث (Picture-in-Picture) */
.teacher-pip {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 190px;
  aspect-ratio: 4 / 3;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.teacher-pip video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.teacher-pip-label {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

/* شارات البث الحي العلوية */
.live-badges {
  position: absolute;
  top: 18px;
  right: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
  backdrop-filter: blur(4px);
}

.live-room-info {
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

/* لوحة التحكم السفلية بالبث (Zoom Control Bar) */
.live-controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 14px 22px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.live-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  min-width: 68px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--navy);
  transition: all 0.2s ease;
}

.live-btn span { font-size: 18px; }

.live-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary);
  transform: translateY(-2px);
}

.live-btn.active {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}

.live-btn.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.live-btn.danger:hover {
  background: #dc2626;
  color: #ffffff;
}

.live-btn.end-call {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  padding: 8px 20px;
}

.live-btn.end-call:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* شريط التفاعل الجانبي المزدوج (الطلاب والشات) */
.live-sidebar {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: 640px;
}

.live-side-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
}

.live-tab-btn {
  flex: 1;
  padding: 12px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.live-tab-btn.active {
  color: var(--primary);
  background: #ffffff;
  border-bottom-color: var(--primary);
}

.live-side-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

/* قائمة الطلاب المتواجدين */
.student-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #f8fafc;
  border: 1px solid var(--border-light);
  margin-bottom: 8px;
}

.student-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
}

.student-name b { display: block; font-size: 13px; color: var(--navy); }
.student-name small { font-size: 11px; color: var(--text-muted); }

.student-badges {
  display: flex;
  gap: 6px;
  font-size: 14px;
}

/* السبورة التفاعلية (Whiteboard Canvas) */
.whiteboard-stage {
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: none;
  flex-direction: column;
}

.whiteboard-toolbar {
  padding: 8px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
  align-items: center;
}

.tool-choice {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.tool-choice.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ==========================================================================
   15. تصميم صفحة التحميلات وتحديثات البرنامج (Downloads Hub)
   ========================================================================== */
.download-hero {
  text-align: center;
  padding: 38px 20px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  margin-top: 10px;
}

.download-hero h1 {
  font-size: clamp(24px, 3.2vw, 36px);
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 10px;
}

.download-hero p {
  color: var(--text-muted);
  font-size: 15.5px;
  font-weight: 600;
  max-width: 620px;
  margin: 0 auto 24px;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  color: #059669;
  border: 1px solid #a7f3d0;
  box-shadow: var(--shadow-xs);
  margin-bottom: 16px;
}

.os-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}

.os-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 26px 20px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all 0.25s ease;
}

.os-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #bfdbfe;
}

.os-card.featured {
  border: 2px solid var(--primary);
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 40%);
}

.os-card-badge {
  position: absolute;
  top: -12px;
  background: var(--primary);
  color: #ffffff;
  padding: 4px 14px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 800;
}

.os-icon {
  font-size: 44px;
  margin-bottom: 12px;
}

.os-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.os-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 16px;
}

.os-card .button {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  margin-top: auto;
}

.changelog-section {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 26px 30px;
  margin-top: 30px;
}

.changelog-item {
  position: relative;
  padding-right: 24px;
  padding-bottom: 24px;
  border-right: 2px solid var(--border-light);
}

.changelog-item:last-child {
  padding-bottom: 0;
  border-right: 2px solid transparent;
}

.changelog-item::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.changelog-item h4 {
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 4px;
}

.changelog-item time {
  display: block;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.changelog-item ul {
  padding-right: 18px;
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.8;
}

@media (max-width: 960px) {
  .live-container { grid-template-columns: 1fr; }
  .os-cards { grid-template-columns: 1fr; }
}
