:root {
  --bg: #070b14;
  --card: rgba(17, 25, 44, 0.72);
  --border: rgba(99, 179, 237, 0.18);
  --primary: #38bdf8;
  --accent: #818cf8;
  --success: #34d399;
  --warning: #fbbf24;
  --text: #f1f5f9;
  --muted: #94a3b8;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Cairo', sans-serif; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.8;
  position: relative;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  z-index: -1;
  opacity: 0.35;
}
.orb-1 { width: 340px; height: 340px; background: #0284c7; top: -80px; right: -80px; }
.orb-2 { width: 380px; height: 380px; background: #6366f1; bottom: -100px; left: -100px; }

.glass {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.top-bar {
  margin: 12px auto;
  padding: 12px 18px;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px;
}

.brand-badge { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--primary); }

.icon-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  transition: 0.25s;
}
.icon-btn:hover { background: rgba(56, 189, 248, 0.25); }

.screen { display: none; max-width: 1200px; margin: 0 auto; padding: 10px 14px 40px; }
.screen.active { display: block; animation: fadeIn 0.4s ease; }

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

.hero-card { padding: 28px 22px; text-align: center; }

.uni-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(129, 140, 248, 0.15);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 16px;
}

h1 { font-size: 1.9rem; font-weight: 900; margin-bottom: 10px; }
.gradient-text {
  background: linear-gradient(135deg, #38bdf8, #818cf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.subtitle { color: var(--muted); max-width: 680px; margin: 0 auto 24px; font-size: 1rem; }

/* العداد التنازلي الدائري */
.exam-box {
  background: rgba(9, 14, 26, 0.65);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 24px;
}
.exam-date-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--warning);
  font-weight: 700;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.countdown-rings {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ring-item { position: relative; width: 88px; height: 88px; }
.ring-svg { width: 88px; height: 88px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(148, 163, 184, 0.15); stroke-width: 6; }
.ring-progress {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.7));
  transition: stroke-dashoffset 0.5s ease;
}
.ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-text span { font-size: 1.35rem; font-weight: 900; line-height: 1.1; }
.ring-text small { font-size: 0.72rem; color: var(--muted); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
  text-align: right;
}
.info-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
}
.info-card svg { color: var(--primary); margin-bottom: 6px; }
.info-card h3 { font-size: 1rem; margin-bottom: 4px; }
.info-card p { font-size: 0.85rem; color: var(--muted); }

.primary-btn {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  color: #fff;
  border: none;
  padding: 13px 28px;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(2, 132, 199, 0.4);
  transition: 0.25s;
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79, 70, 229, 0.5); }

.secondary-btn {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 11px 18px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 0.2s;
}
.secondary-btn:hover { background: rgba(148, 163, 184, 0.22); }
.full-w { width: 100%; margin-top: 12px; }

/* نافذة اختيار الجهاز */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal.hidden { display: none; }
.modal-card { max-width: 520px; width: 100%; padding: 26px; text-align: center; }
.device-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.device-choice {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 16px;
  padding: 20px 12px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: 0.25s;
}
.device-choice:hover { background: rgba(56, 189, 248, 0.15); transform: translateY(-3px); }
.device-choice svg { color: var(--primary); }
.device-choice span { font-size: 0.78rem; color: var(--muted); }

/* أوضاع العرض حسب الجهاز (Samsung M21 مقابل Dell Latitude 14") */
body.mode-mobile .study-layout { display: flex; flex-direction: column; gap: 16px; }
body.mode-mobile .lesson-nav-list { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; }
body.mode-mobile .nav-pill { white-space: nowrap; }
body.mode-mobile .lesson-stage { padding: 18px 15px; }
body.mode-mobile .typed-content { font-size: 0.98rem; }

body.mode-laptop .study-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 20px;
  align-items: start;
}
body.mode-laptop .sidebar { position: sticky; top: 14px; padding: 18px; }
body.mode-laptop .lesson-nav-list { display: flex; flex-direction: column; gap: 8px; max-height: 55vh; overflow-y: auto; }
body.mode-laptop .lesson-stage { padding: 28px 32px; }
body.mode-laptop .typed-content { font-size: 1.08rem; }

.sidebar { padding: 16px; }
.progress-header { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; }
.progress-track { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; margin-bottom: 14px; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #38bdf8, #34d399); transition: width 0.4s ease; }

.nav-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 10px;
  text-align: right;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: 0.2s;
}
.nav-pill.active { background: rgba(56, 189, 248, 0.18); border-color: var(--primary); color: #fff; }
.nav-pill.done { border-right: 4px solid var(--success); }

.lesson-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.badge { background: rgba(56, 189, 248, 0.15); color: var(--primary); padding: 4px 12px; border-radius: 8px; font-weight: 700; font-size: 0.85rem; }
.step-count { color: var(--muted); font-size: 0.85rem; }
.lesson-title { font-size: 1.45rem; font-weight: 800; margin-bottom: 16px; color: #fff; }

.teacher-box {
  background: rgba(9, 14, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.teacher-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 8px;
}
.mini-btn {
  margin-right: auto;
  background: rgba(56, 189, 248, 0.15);
  border: none;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
}

.typed-content p { margin-bottom: 12px; }
.typed-content ul { padding-right: 20px; margin-bottom: 12px; }
.typed-content li { margin-bottom: 6px; }
.formula-card {
  background: rgba(56, 189, 248, 0.08);
  border-right: 4px solid var(--primary);
  padding: 10px 14px;
  border-radius: 10px;
  margin: 10px 0;
  font-weight: 700;
  color: #e0f2fe;
}

.stat-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.9rem; }
.stat-table th, .stat-table td { border: 1px solid rgba(148, 163, 184, 0.25); padding: 8px 10px; text-align: center; }
.stat-table th { background: rgba(56, 189, 248, 0.16); color: var(--primary); }

/* المثال التفاعلي */
.interactive-box {
  background: rgba(129, 140, 248, 0.09);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 18px;
}
.interactive-box h4 { color: #c7d2fe; margin-bottom: 8px; font-size: 1.02rem; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.quiz-opt {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  text-align: right;
  cursor: pointer;
  transition: 0.2s;
}
.quiz-opt:hover { border-color: var(--primary); }
.quiz-opt.correct { background: rgba(52, 211, 153, 0.2); border-color: var(--success); color: #a7f3d0; }
.quiz-opt.wrong { background: rgba(248, 113, 113, 0.2); border-color: #f87171; }
.quiz-feedback { margin-top: 10px; font-size: 0.92rem; font-weight: 700; }

/* كراس الملاحظات */
.notebook-box {
  background: rgba(251, 191, 36, 0.08);
  border: 1px dashed rgba(251, 191, 36, 0.55);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
}
.nb-title { display: flex; align-items: center; gap: 8px; color: var(--warning); font-weight: 800; margin-bottom: 6px; }
.notebook-box p { color: #fef3c7; font-size: 0.95rem; }

.lesson-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.dev-footer { text-align: center; padding: 18px; color: var(--muted); font-size: 0.88rem; }
.dev-footer a { color: var(--primary); text-decoration: none; font-weight: 700; }
