/*
 * arabya.ai - ملف التنسيقات الفاخر الموحد (style.css)
 * تصميم متقدم يجمع الهوية البصرية العربية الأصيلة (ألوان ذهبية وعشبية) مع الحداثة التقنية والذكاء الاصطناعي (ألوان cobalt و neon-glow).
 * يدعم معايير إتاحة الوصول العالمية (WCAG 2.1) للتنقل باللوحة وقارئات الشاشة.
 */

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

:root {
  /* نظام ألوان الهوية arabya.ai */
  --bg-dark: hsl(224, 71%, 4%);
  --surface: rgba(13, 20, 38, 0.65);
  --surface-opaque: hsl(223, 47%, 10%);
  --surface-hover: rgba(23, 37, 72, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --primary: hsl(263, 85%, 64%);      /* البنفسجي الذكي */
  --secondary: hsl(174, 90%, 41%);    /* الفيروزي العشبي */
  --accent: hsl(45, 95%, 55%);        /* الذهبي العربي الأصيل */
  --accent-glow: rgba(245, 158, 11, 0.25);
  
  --text-primary: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 25%, 78%);   /* زيادة التباين لتوافق معايير الإتاحة */
  
  --success: hsl(142, 70%, 45%);
  --error: hsl(0, 84%, 60%);
  --warning: hsl(38, 92%, 50%);
  
  --border-radius: 18px;
  --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* تمكين نسخ ولصق واختيار النصوص داخل الحقول والمدخلات */
input, textarea, select, [contenteditable="true"] {
  user-select: text !important;
  -webkit-user-select: text !important;
}

/* تمكين اختيار النصوص العربية في الصفحات التعليمية (ما عدا واجهة الامتحان النشط) */
.view-section p,
.view-section h1,
.view-section h2,
.view-section h3,
.view-section h4,
.view-section li,
.view-section label,
.hero-desc,
.service-card-desc,
.footer-desc,
.card-title,
.card-header,
.panel-title {
  user-select: text;
  -webkit-user-select: text;
}

#exam-runner-view.view-section,
#exam-runner-view.view-section *:not(input):not(textarea):not(select):not([contenteditable="true"]) {
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, hsla(263,85%,64%,0.08) 0, transparent 40%), 
    radial-gradient(at 100% 0%, hsla(174,90%,41%,0.06) 0, transparent 40%),
    radial-gradient(at 50% 50%, hsla(45,95%,55%,0.03) 0, transparent 50%),
    radial-gradient(at 50% 100%, hsla(224,71%,4%,1) 0, transparent 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
  position: relative;
}

/* مؤشر التركيز الفاخر للوحة المفاتيح (Accessibility Keyboard Focus Indicator) */
:focus-visible {
  outline: 3px solid var(--secondary) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 15px rgba(20, 184, 166, 0.5) !important;
}

/* إخفاء العناصر المخصصة لقارئ الشاشة فقط */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* شريط التنقل العلوي (Navbar) */
.navbar {
  width: 100%;
  padding: 1rem 2rem;
  background: rgba(13, 20, 38, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.6rem;
  font-weight: 800;
  text-decoration: none;
  color: white;
  letter-spacing: 0.5px;
  font-family: 'Cairo', sans-serif;
}

.logo span.net-text {
  color: var(--secondary); /* اللون الفيروزي المتناسق مع ألوان الموقع */
  font-weight: 800;
  margin-right: 1px;
  font-family: inherit;
}

.logo-img-tag {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--secondary);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.35);
  transition: var(--transition-smooth);
}

.logo:hover .logo-img-tag {
  transform: rotate(15deg) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.nav-links a:hover {
  color: white;
  text-shadow: 0 0 8px rgba(255,255,255,0.2);
}

.nav-links a.active-link {
  color: var(--secondary);
  border-bottom: 2px solid var(--secondary);
  padding-bottom: 4px;
}

/* تخطيط المحتوى الرئيسي */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
  z-index: 10;
  position: relative;
}

/* ==========================================
 * صفحة الهبوط الرئيسية (Landing Page)
 * ==========================================
 */

.hero-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 4rem 0 5rem;
}

.hero-content {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-tagline {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(245, 158, 11, 0.08);
  padding: 0.35rem 1.25rem;
  border-radius: 50px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin-bottom: 1.5rem;
  box-shadow: 0 0 20px var(--accent-glow);
  width: fit-content;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #fff 40%, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: right;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  text-align: justify;
}

.hero-cta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}

.hero-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-tag {
  width: 100%;
  max-width: 460px;
  border-radius: var(--border-radius);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4), 0 0 30px rgba(20, 184, 166, 0.15);
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.hero-image-tag:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.5), 0 0 40px rgba(20, 184, 166, 0.25);
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--secondary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* قسم الخدمات والمجالات */
.section-title-wrapper {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 5rem;
}

.service-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: var(--transition-smooth);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  opacity: 0;
  transition: var(--transition-smooth);
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255,255,255,0.12);
  background: var(--surface-hover);
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

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

.service-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-smooth);
}

.service-card:hover .service-icon {
  background: var(--secondary);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
}

.service-card:nth-child(even) .service-icon {
  color: var(--accent);
}

.service-card:nth-child(even):hover .service-icon {
  background: var(--accent);
  color: var(--bg-dark);
  box-shadow: 0 0 20px var(--accent-glow);
}

.service-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.75rem;
}

.service-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ==========================================
 * الكروت والبطاقات الفاخرة للنماذج
 * ==========================================
 */

.card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 3rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
  max-width: 800px;
  margin: 0 auto;
}

.card-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.card-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, white, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================
 * تصميم عناصر المدخلات والفورم
 * ==========================================
 */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.25rem;
  transition: var(--transition-smooth);
}

.form-control {
  width: 100%;
  padding: 0.9rem 3.2rem 0.9rem 1.25rem;
  font-size: 0.95rem;
  background: rgba(10, 15, 30, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 15px rgba(20, 184, 166, 0.25);
  background: rgba(10, 15, 30, 0.95);
}

.form-control:focus + .input-icon {
  color: var(--secondary);
}

.required-badge {
  color: var(--error);
  margin-right: 0.25rem;
}

/* التنسيق النصي المقالي */
.essay-textarea {
  width: 100%;
  min-height: 160px;
  background: rgba(10, 15, 30, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  color: white;
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
  transition: var(--transition-smooth);
}

.essay-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
  background: rgba(10, 15, 30, 0.9);
}

.char-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: left;
  margin-top: 0.25rem;
}

/* ==========================================
 * أزرار المنصة (Buttons)
 * ==========================================
 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 0.6rem;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid white !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary), #0d9488);
  color: white;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(20, 184, 166, 0.45);
  filter: brightness(1.15);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #d97706);
  color: hsl(224, 71%, 4%);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* ==========================================
 * بوابة ولوحة تحكم المعلم (Teacher Dashboard)
 * ==========================================
 */

.teacher-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.teacher-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface-opaque);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  min-height: min(85vh, 680px);
}

.teacher-app-version-label {
  margin-top: auto;
  padding: 0.75rem 0.5rem 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--accent);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-weight: 700;
}

.teacher-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.teacher-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.teacher-menu-item:hover, .teacher-menu-item.active {
  color: white;
  background: rgba(255, 255, 255, 0.04);
}

.teacher-menu-item.active {
  color: var(--secondary);
  background: rgba(20, 184, 166, 0.08);
  border-right: 3px solid var(--secondary);
}

.teacher-main-panel {
  background: var(--surface-opaque);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 2.5rem;
}

.panel-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.panel-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: white;
}

.exam-builder-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.profile-stat-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
}

.profile-stat-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.profile-stat-value {
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* روابط الامتحانات المباشرة */
.exam-direct-link-box {
  background: rgba(20, 184, 166, 0.05);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.exam-link-input {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--secondary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.85rem;
  text-align: left;
}

/* قوائم الامتحانات */
.exams-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.exam-info-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--transition-smooth);
}

.exam-info-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255,255,255,0.12);
}

.exam-info-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: white;
}

.exam-info-details {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.exam-actions-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ==========================================
 * جداول البيانات والنتائج (Tables)
 * ==========================================
 */

.table-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(0,0,0,0.15);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 0.9rem;
}

th {
  background: rgba(23, 37, 72, 0.4);
  color: white;
  padding: 1rem 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 1rem 1.25rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

tr:hover td {
  color: white;
  background: rgba(255, 255, 255, 0.01);
}

/* ==========================================
 * واجهة تشغيل الامتحان (Student Exam Runner)
 * ==========================================
 */

.exam-runner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.timer-container {
  position: relative;
  width: 60px;
  height: 60px;
}

.timer-svg {
  transform: rotate(-90deg);
  width: 60px;
  height: 60px;
}

.timer-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 4;
}

.timer-circle-fill {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 188.4;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke var(--transition-smooth);
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--secondary);
}

.timer-warning .timer-circle-fill {
  stroke: var(--error);
}

.timer-warning .timer-text {
  color: var(--error);
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 1rem;
}

.option-card:focus-visible {
  outline: 3px solid var(--accent) !important;
}

.option-card:hover {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.15);
}

.option-card.selected {
  background: rgba(20, 184, 166, 0.08);
  border-color: var(--secondary);
  box-shadow: 0 0 15px rgba(20, 184, 166, 0.1);
}

.option-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: var(--transition-smooth);
  color: var(--text-muted);
}

.option-card.selected .option-marker {
  border-color: var(--secondary);
  background: var(--secondary);
  color: white;
}

/* شاشة منع الغش والتحذير البصري */
.cheat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: white;
}

.cheat-icon-container {
  font-size: 4rem;
  color: var(--error);
  margin-bottom: 1.5rem;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(1); text-shadow: 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { transform: scale(1.08); text-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
  100% { transform: scale(1); text-shadow: 0 0 0 rgba(239, 68, 68, 0.5); }
}

.blurred-content {
  filter: blur(25px) !important;
  pointer-events: none !important;
}

.hidden {
  display: none !important;
}

/* استعلام النتائج للطلاب */
.result-query-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

.result-query-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.result-query-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
}

/* قسم التصدير والاستيراد */
.config-card-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* تعطيل الطباعة */
@media print {
  body, html, .main-content, .navbar, .cheat-overlay {
    display: none !important;
  }
}

/* استعلامات التجاوب مع الجوال والتابلت */
@media (max-width: 900px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
    padding: 2rem 0;
  }
  
  .hero-content {
    text-align: center;
    align-items: center;
  }
  
  .hero-title {
    font-size: 2.2rem;
    text-align: center;
  }
  
  .hero-desc {
    text-align: center;
  }
  
  .hero-cta {
    justify-content: center;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .stat-item {
    border-right: none !important;
    padding-right: 0 !important;
    padding: 0 1rem;
  }

  .teacher-grid {
    grid-template-columns: 1fr;
  }
  
  .teacher-sidebar {
    padding: 1.25rem;
    min-height: auto;
    display: flex;
    flex-direction: column;
  }

  .teacher-app-version-label {
    margin-top: 1rem;
    width: 100%;
    flex-shrink: 0;
  }

  .teacher-main-panel {
    padding: 1.5rem;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .exam-runner-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .table-container {
    -webkit-overflow-scrolling: touch;
  }

  .nav-container {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .main-content {
    padding: 1.5rem 1rem 4rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .teacher-menu {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  
  .teacher-menu-item {
    flex: 1 1 auto;
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    justify-content: center;
    border-right: none;
  }
  
  .teacher-menu-item.active {
    border-bottom: 3px solid var(--secondary);
    border-right: none;
    border-radius: 8px 8px 0 0;
  }
  
  .navbar {
    padding: 1rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .teacher-main-panel div[style*="grid-template-columns"],
  .exam-builder-card div[style*="grid-template-columns"],
  .config-card-box div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .logo {
    font-size: 1.25rem;
  }

  .logo-img-tag {
    width: 30px;
    height: 30px;
  }

  .teacher-main-panel {
    padding: 1.15rem;
  }

  .teacher-app-version-label {
    font-size: 0.72rem;
  }

  .panel-title {
    font-size: 1.2rem;
  }

  .exam-direct-link-box {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-title {
    font-size: 2rem;
  }
  
  .hero-desc {
    font-size: 1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .btn {
    width: 100%;
  }

  .nav-links {
    gap: 0.75rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .exams-list-container {
    grid-template-columns: 1fr;
  }

  .exam-actions-row,
  .hero-cta,
  .social-links-row {
    flex-direction: column;
    align-items: stretch;
  }

  .teacher-menu-item {
    min-width: 100%;
  }
}

/* ==========================================
 * تذييل الصفحة الفاخر (Footer Styles)
 * ==========================================
 */
.footer {
  width: 100%;
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 4rem 2rem 2rem;
  margin-top: 5rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand .logo {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
  width: fit-content;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.8;
  max-width: 400px;
}

.footer-links h4, .footer-developer h4 {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
  width: fit-content;
}

.footer-links h4::after, .footer-developer h4::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 0;
  width: 30px;
  height: 2px;
  background: var(--secondary);
}

.social-links-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.social-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: white;
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(-4px);
}

.social-btn.facebook:hover {
  border-color: #1877f2;
  box-shadow: 0 0 10px rgba(24, 119, 242, 0.25);
}

.social-btn.instagram:hover {
  border-color: #e1306c;
  box-shadow: 0 0 10px rgba(225, 48, 108, 0.25);
}

.social-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.footer-developer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dev-signature {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.dev-signature strong {
  color: var(--accent);
}

.dev-contact-btn {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  color: white !important;
  font-size: 0.85rem !important;
  padding: 0.6rem 1.25rem !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25) !important;
  width: fit-content !important;
}

.dev-contact-btn:hover {
  box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4) !important;
  transform: translateY(-2px) !important;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* أنيميشن الدوران المستخدم في أزرار المزامنة السحابية */
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* حالة المزامنة السحابية */
.cloud-sync-active {
  animation: spin 1s infinite linear;
}


}

/* حالة المزامنة السحابية */
.cloud-sync-active {
  animation: spin 1s infinite linear;
}
.teacher-stats-status-grid {
  margin-top: 1rem;
}

.teacher-stats-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.teacher-stats-card {
  padding: 1.25rem;
}

.teacher-stats-card--wide {
  margin-top: 1rem;
}

.teacher-stats-card-title {
  color: white;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.teacher-stats-card-title--secondary {
  color: var(--secondary);
}

.teacher-stats-card-title--accent {
  color: var(--accent);
}

.teacher-stats-clickable {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.teacher-stats-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.35);
}

.teacher-stats-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.teacher-stats-list-item:last-child {
  border-bottom: none;
}

.teacher-stats-bar-row {
  margin-bottom: 0.85rem;
}

.teacher-stats-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.teacher-stats-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.teacher-stats-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
}


.teacher-sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.teacher-sortable-th.is-sorted {
  color: var(--secondary);
}

.arabya-toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 1rem;
  z-index: 12000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(420px, calc(100vw - 2rem));
  pointer-events: none;
}

.arabya-toast {
  pointer-events: auto;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary, #f1f5f9);
}

.arabya-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.arabya-toast--success { border-color: rgba(34, 197, 94, 0.45); }
.arabya-toast--error { border-color: rgba(239, 68, 68, 0.45); }
.arabya-toast--warning { border-color: rgba(245, 158, 11, 0.45); }

.sync-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.sync-health-grid > div {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.82rem;
}

.sync-health-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 0.2rem;
}

.student-exam-prepare-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(6px);
}

.student-exam-prepare-overlay.hidden {
  display: none !important;
}

.student-exam-prepare-card {
  width: min(420px, 100%);
  text-align: center;
  padding: 1.75rem 1.5rem;
  border-radius: var(--border-radius);
  border: 1px solid rgba(20, 184, 166, 0.35);
  background: linear-gradient(145deg, rgba(13, 20, 38, 0.95), rgba(23, 37, 72, 0.92));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.student-exam-prepare-countdown {
  font-size: 3.25rem;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 24px var(--accent-glow);
}

.student-exam-prepare-progress {
  margin-top: 1.25rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.student-exam-prepare-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  transition: width 0.35s ease;
}

.teacher-sortable-th:hover {
