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

:root {
  /* الألوان الأساسية - هوية بصرية موحدة */
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #818cf8;
  --primary-gradient: linear-gradient(135deg, #4f46e5, #7c3aed);

  --secondary-color: #7c3aed;
  --secondary-hover: #6d28d9;
  --secondary-light: #a78bfa;
  --secondary-gradient: linear-gradient(135deg, #7c3aed, #a855f7);

  --success-color: #10b981;
  --success-hover: #059669;
  --success-light: #34d399;
  --success-gradient: linear-gradient(135deg, #10b981, #059669);

  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #f87171;
  --danger-gradient: linear-gradient(135deg, #ef4444, #dc2626);

  --warning-color: #f59e0b;
  --warning-hover: #d97706;
  --warning-light: #fbbf24;
  --warning-gradient: linear-gradient(135deg, #f59e0b, #d97706);

  --info-color: #3b82f6;
  --info-hover: #2563eb;
  --info-light: #60a5fa;
  --info-gradient: linear-gradient(135deg, #3b82f6, #2563eb);

  /* خلفيات وألوان الواجهة */
  --light-bg: #f8fafc;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* حدود وظلال */
  --border-color: #e5e7eb;
  --border-radius-sm: 8px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;

  /* ظلال متدرجة */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);

  /* انتقالات موحدة */
  --transition-fast: 0.15s ease-out;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* تباعد موحد */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
}

body {
  font-family: "Cairo", sans-serif;
  background: var(--light-bg);
  direction: rtl;
  margin: 0;
  min-height: 100vh;
  padding: 0;
}

/* شريط التنقل - تصميم محسن */
.navbar {
  background: var(--white);
  padding: var(--spacing) var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
}

.navbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0.02;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  position: relative;
  z-index: 1;
}

.navbar-brand i {
  font-size: 2rem;
  background: var(--primary-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: iconPulse 3s ease-in-out infinite;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  position: relative;
  z-index: 1;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--gray-700);
  font-weight: 500;
}

.user-info i {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.logout-btn {
  background: var(--danger-gradient);
  color: var(--white);
  border: none;
  padding: var(--spacing-sm) var(--spacing);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  position: relative;
  overflow: hidden;
}

.logout-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.5s ease;
}

.logout-btn:hover::before {
  left: 100%;
}

.logout-btn:hover {
  background: var(--danger-gradient);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* التبويبات - تصميم محسن مع أنيميشن */
.nav-tabs {
  display: flex;
  background: var(--white);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  gap: var(--spacing-xs);
  position: relative;
  overflow: hidden;
}

.nav-tabs::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0.02;
  border-radius: var(--border-radius-lg);
}

.nav-tab {
  flex: 1;
  padding: var(--spacing) var(--spacing-lg);
  background: transparent;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  color: var(--gray-600);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.nav-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transform: translateY(100%);
  transition: all var(--transition);
  border-radius: var(--border-radius);
}

.nav-tab:hover::before {
  opacity: 0.1;
  transform: translateY(0);
}

.nav-tab:hover {
  color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.nav-tab.active {
  background: var(--primary-gradient);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.nav-tab.active::before {
  opacity: 0;
}

.nav-tab i {
  font-size: 1.2rem;
  transition: all var(--transition);
}

.nav-tab:hover i {
  transform: scale(1.1);
}

.nav-tab.active i {
  transform: scale(1.15);
  animation: iconPulse 2s ease-in-out infinite;
}

/* محتوى التبويبات مع انتقالات سلسة */
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--transition-slow);
}

.tab-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp var(--transition-slow) ease-out;
}

/* شاشة التحميل */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: var(--primary-color);
}

.loading-content i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.loading-content p {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
}

/* المحتوى الرئيسي */
#mainContent {
  display: none;
  padding: 2rem 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 32px;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

h1 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 32px;
  font-weight: 700;
}

.info-block {
  background: var(--light-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.info-block label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 1rem;
}

.info-block input {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  font-size: 1.5rem;
  transition: all 0.3s ease;
}

.info-block input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.question-block {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.question-block:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.question-number {
  background: var(--primary-color);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-left: 1rem;
}

.question-title {
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
  display: flex;
  align-items: center;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #374151;
  font-weight: 600;
}

textarea {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  font-family: "Cairo", sans-serif;
  resize: vertical;
  min-height: 100px;
  transition: all 0.3s ease;
}

textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

select {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 1rem;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  outline: none;
}

.question-type-selector {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.type-btn {
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--border-color);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.type-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.type-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.options-container {
  background: var(--light-bg);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.option-item input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.option-item input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  padding: 0;
  margin: 0;
}

.option-item button {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  margin: 0;
}

.option-item button:hover {
  opacity: 1;
}

.add-option-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-weight: 500;
}

.add-option-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
}

.true-false-options {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-check-input {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.form-check-label {
  cursor: pointer;
  font-weight: 500;
  margin: 0;
}

.answer-section {
  background: var(--light-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.hidden {
  display: none !important;
}

.delete-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.delete-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.add-question-btn {
  background: var(--primary-gradient);
  color: var(--white);
  border: none;
  padding: var(--spacing) var(--spacing-xl);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 var(--spacing-sm);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.add-question-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.5s ease;
}

.add-question-btn:hover::before {
  left: 100%;
}

.add-question-btn:hover {
  background: var(--primary-gradient);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.add-question-btn i {
  transition: all var(--transition);
  animation: rotateIn 0.6s ease-out;
}

.add-question-btn:hover i {
  transform: scale(1.1) rotate(90deg);
  animation: bounce 0.6s ease-in-out;
}

.save-btn {
  background: var(--info-gradient);
  color: var(--white);
  border: none;
  padding: var(--spacing) var(--spacing-xl);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 var(--spacing-sm);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.save-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.5s ease;
}

.save-btn:hover::before {
  left: 100%;
}

.save-btn:hover {
  background: var(--info-gradient);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.save-btn i {
  transition: all var(--transition);
}

.save-btn:hover i {
  transform: scale(1.1);
  animation: saveIcon 0.8s ease-in-out;
}

.preview-btn {
  background: var(--warning-gradient);
  color: var(--white);
  border: none;
  padding: var(--spacing) var(--spacing-xl);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 var(--spacing-sm);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.preview-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.5s ease;
}

.preview-btn:hover::before {
  left: 100%;
}

.preview-btn:hover {
  background: var(--warning-gradient);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.preview-btn i {
  transition: all var(--transition);
}

.preview-btn:hover i {
  transform: scale(1.1);
  animation: previewIcon 0.6s ease-in-out;
}

.export-btn {
  background: var(--success-gradient);
  color: var(--white);
  border: none;
  padding: var(--spacing) var(--spacing-xl);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 var(--spacing-sm);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.export-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.5s ease;
}

.export-btn:hover::before {
  left: 100%;
}

.export-btn:hover {
  background: var(--success-gradient);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.export-btn i {
  transition: all var(--transition);
}

.export-btn:hover i {
  transform: scale(1.1);
  animation: exportIcon 0.8s ease-in-out;
}

.export-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.save-export-btn {
  background: var(--secondary-gradient);
  color: var(--white);
  border: none;
  padding: var(--spacing) var(--spacing-xl);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin: 0 var(--spacing-sm);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.save-export-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.5s ease;
}

.save-export-btn:hover::before {
  left: 100%;
}

.save-export-btn:hover {
  background: var(--secondary-gradient);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.4);
}

.save-export-btn:active {
  transform: translateY(-1px);
}

.save-export-btn i {
  font-size: 1rem;
  transition: all var(--transition);
}

.save-export-btn:hover i {
  transform: scale(1.1);
  animation: saveExportIcon 1s ease-in-out;
}

/* زر التصفير وحاوي العنوان */
.create-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.create-header h1 {
  margin: 0;
  flex-grow: 1;
}

.reset-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.reset-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

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

.reset-btn i {
  animation: rotateReset 2s ease-in-out infinite;
}

@keyframes rotateReset {
  0%,
  90%,
  100% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(360deg);
  }
}

/* الزر العائم للتراجع عن التصفير */
#floatingUndoBtn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 10000;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

#floatingUndoBtn.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

#floatingUndoBtn.hide {
  transform: translateX(-50%) translateY(100px);
  opacity: 0;
  pointer-events: none;
}

.floating-undo-content {
  background: linear-gradient(135deg, #1f2937, #374151);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 350px;
  backdrop-filter: blur(10px);
}

.floating-undo-text {
  flex-grow: 1;
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.floating-undo-text i {
  color: #f59e0b;
  font-size: 1.1rem;
}

#floatingCountdown {
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.floating-undo-button {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.floating-undo-button:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.floating-undo-button:active {
  transform: translateY(0);
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 768px) {
  .create-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .create-header h1 {
    font-size: 1.5rem;
  }

  .reset-btn {
    align-self: flex-end;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .floating-undo-content {
    min-width: 300px;
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .floating-undo-text {
    font-size: 0.9rem;
    justify-content: center;
  }

  .floating-undo-button {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}

.image-preview img {
  max-width: 180px;
  max-height: 120px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  display: block;
  margin: 0 auto;
}

/* أنماط زر حذف الصورة */
.delete-image-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 10;
}

.delete-image-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.image-container {
  position: relative;
  display: inline-block;
  margin: 10px 0;
}

/* السجلات المحفوظة */
.saved-forms-list {
  margin-top: 2rem;
}

/* شريط الإجراءات الجماعية */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.bulk-actions .selected-count {
  color: #374151;
  font-weight: 600;
}

.bulk-actions .spacer {
  flex: 1;
}

.bulk-actions .action-btn {
  background: #eef2ff;
  color: #374151;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bulk-actions .action-btn:hover {
  transform: translateY(-1px);
}

.bulk-actions .action-btn.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.admin-saved-tabs {
  display: flex;
  gap: 8px;
}

.saved-subtab {
  background: #eef2ff;
  color: #374151;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.saved-subtab.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow);
}

.saved-subtab:hover {
  transform: translateY(-1px);
}

/* القوائم المنسدلة لسجلات المشرف */
.collapsible-group {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.1rem;
  background: #eef2ff;
  border-right: 4px solid var(--primary-color);
  cursor: pointer;
  user-select: none;
}

.collapsible-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--primary-color);
  font-weight: 700;
}

.collapsible-title .count {
  color: #6b7280;
  font-weight: 600;
}

.collapsible-header .chevron {
  color: var(--primary-color);
  transition: transform 0.25s ease;
}

.collapsible-group.open .collapsible-header .chevron {
  transform: rotate(180deg);
}

.collapsible-content {
  display: none;
  padding: 0.75rem 0.9rem 1rem;
  background: #fafbff;
  border-top: 1px solid var(--border-color);
  max-height: 420px;
  overflow-y: auto;
}

.collapsible-group.open .collapsible-content {
  display: block;
}

.loading-spinner {
  text-align: center;
  padding: 3rem;
  color: var(--primary-color);
}

.loading-spinner i {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #6b7280;
}

.empty-state i {
  font-size: 4rem;
  color: var(--border-color);
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: #374151;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.empty-state p {
  color: #6b7280;
  margin: 0;
}

.form-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.form-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.form-card.recent-update {
  background: linear-gradient(135deg, #f8fffc, #ffffff);
  border: 2px solid #10b981;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.new-badge {
  position: absolute;
  top: -8px;
  right: 15px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  z-index: 10;
}

.new-badge i {
  margin-left: 0.3rem;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* صندوق اختيار متعدد على البطاقات */
.select-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}
.select-checkbox input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0;
}

.admin-badge {
  display: inline-block;
  margin-right: 0.5rem;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.form-date {
  font-size: 0.9rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-date i {
  color: #9ca3af;
  font-size: 0.8rem;
}

.form-info {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.form-info span {
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.form-info span i {
  color: #9ca3af;
  font-size: 0.8rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-action-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-btn {
  background: var(--primary-color);
  color: white;
}

.edit-btn:hover {
  background: var(--secondary-color);
}

.delete-btn {
  background: var(--danger-color);
  color: white;
}

.delete-btn:hover {
  background: #dc2626;
}

.export-btn {
  background: var(--success-color);
  color: white;
}

.export-btn:hover {
  background: #059669;
}

/* النافذة المنبثقة */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(30, 64, 175, 0.18);
  backdrop-filter: blur(2px);
}
.trainer-edit-modal {
  background: #fff;
  margin: 60px auto;
  border-radius: 16px;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.13);
  padding: 0;
  animation: fadeInModal 0.25s;
}
@keyframes fadeInModal {
  from {
    transform: translateY(40px) scale(0.97);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.trainer-edit-modal .modal-header {
  background: linear-gradient(90deg, #2563eb 0%, #1e40af 100%);
  color: #fff;
  border-radius: 16px 16px 0 0;
  padding: 18px 24px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.trainer-edit-modal .modal-header h3 {
  margin: 0;
  font-size: 1.25em;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}
.trainer-edit-modal .modal-header .close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3em;
  cursor: pointer;
  transition: color 0.15s;
}
.trainer-edit-modal .modal-header .close-btn:hover {
  color: #fbbf24;
}
.trainer-edit-modal .modal-body {
  padding: 24px 24px 8px 24px;
}
.trainer-edit-modal .modal-footer {
  padding: 0 24px 24px 24px;
}
@media (max-width: 600px) {
  .trainer-edit-modal {
    max-width: 98vw;
    margin: 16px auto;
    padding: 0;
  }
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--light-bg);
}

.modal-header h3 {
  margin: 0;
  color: var(--primary-color);
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.3s ease;
}

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

.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: left;
}

/* نافذة تأكيد إضافة المدرب */
.trainer-confirm-modal {
  max-width: 500px;
  width: 90%;
}

.trainer-info-summary {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--gray-200);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row label {
  font-weight: 600;
  color: var(--gray-700);
  min-width: 120px;
}

.info-row span {
  color: var(--gray-900);
  font-weight: 500;
}

.password-display {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.password-masked {
  font-family: monospace;
  letter-spacing: 2px;
  color: var(--gray-600);
}

.password-visible {
  font-family: monospace;
  color: var(--gray-900);
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--gray-300);
}

/* أنماط قسم التعديل */
.edit-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e5e7eb;
}

.back-btn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s;
}

.back-btn:hover {
  background: #4b5563;
}

.edit-header h1 {
  margin: 0;
  color: #374151;
  font-size: 28px;
  font-weight: 600;
}

#editTab {
  display: none;
}

#editTab.active {
  display: block;
}

#editTabBtn {
  display: none;
}

#editTabBtn.show {
  display: inline-block;
}

/* تجاوب */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }

  .navbar-user {
    width: 100%;
    justify-content: space-between;
  }

  .nav-tabs {
    flex-direction: column;
  }

  .question-type-selector {
    justify-content: center;
  }

  .type-btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  .container {
    padding: 20px;
    margin: 1rem;
  }

  .add-question-btn,
  .save-btn,
  .preview-btn,
  .export-btn {
    width: 100%;
    margin: 0.5rem 0;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-action-btn {
    width: 100%;
    justify-content: center;
  }

  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}

/* أنماط الرسائل الجميلة المطورة */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
  backdrop-filter: blur(12px);
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-modal-content {
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  margin: 8% auto;
  padding: 0;
  border-radius: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 12px 30px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: scale(0.7) translateY(-50px);
  opacity: 0;
  animation: modalSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.custom-modal-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(
    90deg,
    #667eea,
    #764ba2,
    #f093fb,
    #f5576c,
    #4facfe,
    #00f2fe
  );
  background-size: 300% 100%;
  animation: gradientShift 4s ease infinite;
}

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

@keyframes modalSlideIn {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(-50px) rotateX(10deg);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02) translateY(0) rotateX(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) rotateX(0);
  }
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.custom-modal-header {
  padding: 2.5rem 2rem 1rem;
  text-align: center;
  position: relative;
  background: transparent;
}

.custom-modal-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 0, 0, 0.1),
    transparent
  );
}

.custom-modal-header i {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  position: relative;
  animation: iconPulse 2s ease-in-out infinite;
}

.custom-modal-header i::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.1;
  animation: iconGlow 2s ease-in-out infinite;
  z-index: -1;
}

.custom-modal-header.success i {
  color: #27ae60;
  text-shadow: 0 0 20px rgba(39, 174, 96, 0.3);
}

.custom-modal-header.warning i {
  color: #f39c12;
  text-shadow: 0 0 20px rgba(243, 156, 18, 0.3);
}

.custom-modal-header.danger i {
  color: #e74c3c;
  text-shadow: 0 0 20px rgba(231, 76, 60, 0.3);
}

.custom-modal-header.info i {
  color: #3498db;
  text-shadow: 0 0 20px rgba(52, 152, 219, 0.3);
}

.custom-modal-title {
  font-size: 1.8rem;
  margin: 0;
  color: #2c3e50;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
}

.custom-modal-body {
  padding: 2rem 2.5rem;
  text-align: center;
  font-size: 1.2rem;
  color: #5d6d7e;
  line-height: 1.7;
  font-weight: 400;
}

.custom-modal-footer {
  padding: 1rem 2rem 2.5rem;
  text-align: center;
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes iconGlow {
  0%,
  100% {
    opacity: 0.1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes modalSlideOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0) rotateX(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateY(-30px) rotateX(-10deg);
  }
}

/* أنيميشن الأيقونات التفاعلية */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes bounce {
  0%,
  20%,
  53%,
  80%,
  100% {
    transform: translateY(0) scale(1);
  }
  40%,
  43% {
    transform: translateY(-5px) scale(1.1);
  }
  70% {
    transform: translateY(-3px) scale(1.05);
  }
  90% {
    transform: translateY(-1px) scale(1.02);
  }
}

@keyframes saveIcon {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(-10deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
  75% {
    transform: scale(1.15) rotate(-2deg);
  }
  100% {
    transform: scale(1.1) rotate(0deg);
  }
}

@keyframes previewIcon {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2) rotateY(180deg);
  }
  100% {
    transform: scale(1.1) rotateY(0deg);
  }
}

@keyframes exportIcon {
  0% {
    transform: scale(1) translateY(0);
  }
  25% {
    transform: scale(1.1) translateY(-2px);
  }
  50% {
    transform: scale(1.2) translateY(-4px);
  }
  75% {
    transform: scale(1.1) translateY(-2px);
  }
  100% {
    transform: scale(1.1) translateY(0);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes saveExportIcon {
  0% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(90deg);
  }
  50% {
    transform: scale(1.1) rotate(180deg);
  }
  75% {
    transform: scale(1.15) rotate(270deg);
  }
  100% {
    transform: scale(1.1) rotate(360deg);
  }
}

.custom-modal-btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 120px;
  position: relative;
  overflow: hidden;
  text-transform: none;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.custom-modal-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

.custom-modal-btn:hover::before {
  left: 100%;
}

.custom-modal-btn:active {
  transform: scale(0.95);
}

.custom-modal-btn.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-modal-btn.primary:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.custom-modal-btn.secondary {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-modal-btn.secondary:hover {
  background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

.custom-modal-btn.danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-modal-btn.danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.custom-modal-btn.success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-modal-btn.success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.custom-modal-btn.warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.custom-modal-btn.warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 600px) {
  .custom-modal-content {
    margin: 5% auto;
    width: 95%;
    max-width: none;
    border-radius: 20px;
  }

  .custom-modal-header {
    padding: 2rem 1.5rem 1rem;
  }

  .custom-modal-header i {
    font-size: 3rem;
  }

  .custom-modal-title {
    font-size: 1.5rem;
  }

  .custom-modal-body {
    padding: 1.5rem;
    font-size: 1rem;
  }

  .custom-modal-footer {
    padding: 1rem 1.5rem 2rem;
    flex-direction: column;
    gap: 1rem;
  }

  .custom-modal-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
  }
}

/* تحسينات إضافية للتفاعل */
.custom-modal-content:hover {
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.2), 0 15px 35px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* أنماط أزرار إضافة الصور */
.add-image-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.add-image-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-1px);
}

.remove-image-input-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.remove-image-input-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.image-upload-section {
  margin-bottom: 1rem;
}

/* تنسيق خيارات الإدخال */
.input-options {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.option-btn {
  background: #f3f4f6;
  color: #374151;
  border: 2px solid #e5e7eb;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.option-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.option-btn.active {
  background: #1976d2;
  color: white;
  border-color: #1976d2;
}

.input-section {
  display: none;
}

.input-section.active {
  display: block;
}

/* تنسيق منطقة رفع الملفات */
.file-upload-area {
  border: 2px dashed #1976d2;
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f8faff;
  position: relative;
}

.file-upload-area:hover {
  border-color: #1565c0;
  background: #f0f4ff;
}

.upload-placeholder {
  color: #1976d2;
}

.upload-placeholder p {
  margin: 8px 0;
  font-size: 16px;
}

.upload-placeholder small {
  font-size: 12px;
  opacity: 0.8;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #e8f5e8;
  border-radius: 6px;
  border: 1px solid #c8e6c9;
}

.remove-file {
  background: #f44336;
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.remove-file:hover {
  background: #d32f2f;
}

/* تنسيق شريط التقدم */
.file-status {
  margin-top: 16px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: #1976d2;
  width: 0%;
  transition: width 0.3s ease;
}

#statusText {
  font-size: 14px;
  color: #374151;
}

/* تنسيق قسم عدد الأسئلة */
.question-count-section {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
}

.question-count-section h5 {
  color: var(--gray-800);
  font-weight: 600;
  margin-bottom: var(--spacing);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.question-count-section h5 i {
  font-size: 1.1em;
}

.question-count-section .form-control {
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
  font-weight: 500;
}

.question-count-section .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.question-count-section .form-control:hover {
  border-color: var(--gray-400);
}

/* تنسيق عداد المجموع */
#totalQuestionsCount {
  background: var(--info-color);
  color: #000000;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
  display: inline-block;
}

/* تحسينات للأعداد الكبيرة */
.question-count-section .form-control[value*="0"] {
  border-color: var(--warning-color);
}

.question-count-section .form-control[value*="0"]:focus {
  border-color: var(--warning-color);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* تحذير للأعداد الكبيرة */
.question-count-section .form-control[value*="5"][value*="0"],
.question-count-section .form-control[value*="6"][value*="0"],
.question-count-section .form-control[value*="7"][value*="0"],
.question-count-section .form-control[value*="8"][value*="0"],
.question-count-section .form-control[value*="9"][value*="0"] {
  border-color: var(--info-color);
  background-color: rgba(59, 130, 246, 0.05);
}

.question-count-section .form-control[value*="5"][value*="0"]:focus,
.question-count-section .form-control[value*="6"][value*="0"]:focus,
.question-count-section .form-control[value*="7"][value*="0"]:focus,
.question-count-section .form-control[value*="8"][value*="0"]:focus,
.question-count-section .form-control[value*="9"][value*="0"]:focus {
  border-color: var(--info-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* تحذير للأعداد الكبيرة جداً (أكثر من 200) */
.question-count-section .form-control[value*="2"][value*="0"][value*="0"],
.question-count-section .form-control[value*="3"][value*="0"][value*="0"],
.question-count-section .form-control[value*="4"][value*="0"][value*="0"],
.question-count-section .form-control[value*="5"][value*="0"][value*="0"],
.question-count-section .form-control[value*="6"][value*="0"][value*="0"],
.question-count-section .form-control[value*="7"][value*="0"][value*="0"],
.question-count-section .form-control[value*="8"][value*="0"][value*="0"],
.question-count-section .form-control[value*="9"][value*="0"][value*="0"] {
  border-color: var(--warning-color);
  background-color: rgba(245, 158, 11, 0.1);
  animation: pulse-warning 2s infinite;
}

.question-count-section .form-control[value*="2"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="3"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="4"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="5"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="6"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="7"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="8"][value*="0"][value*="0"]:focus,
.question-count-section
  .form-control[value*="9"][value*="0"][value*="0"]:focus {
  border-color: var(--warning-color);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* تحذير للأعداد الكبيرة جداً (أكثر من 500) */
.question-count-section .form-control[value*="5"][value*="0"][value*="0"],
.question-count-section .form-control[value*="6"][value*="0"][value*="0"],
.question-count-section .form-control[value*="7"][value*="0"][value*="0"],
.question-count-section .form-control[value*="8"][value*="0"][value*="0"],
.question-count-section .form-control[value*="9"][value*="0"][value*="0"] {
  border-color: var(--danger-color);
  background-color: rgba(239, 68, 68, 0.1);
  animation: pulse-danger 1.5s infinite;
}

.question-count-section .form-control[value*="5"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="6"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="7"][value*="0"][value*="0"]:focus,
.question-count-section .form-control[value*="0"][value*="0"][value*="0"]:focus,
.question-count-section
  .form-control[value*="9"][value*="0"][value*="0"]:focus {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* تحسين مظهر العدادات */
.question-count-section input[type="number"] {
  -moz-appearance: textfield;
}

.question-count-section input[type="number"]::-webkit-outer-spin-button,
.question-count-section input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* قسم الإجراءات العائم */
.floating-actions-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 2px solid var(--primary-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 15px 0;
  transition: all 0.3s ease;
}

.floating-actions-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.action-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.action-group button {
  margin: 0;
  min-width: 140px;
  height: 45px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-group button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.action-group button i {
  margin-left: 8px;
  font-size: 16px;
}

/* تحسين مظهر الأزرار في القسم العائم */
.floating-actions-bar .add-question-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none;
  color: white;
}

.floating-actions-bar .add-question-btn:hover {
  background: linear-gradient(135deg, #218838, #1ea085);
}

.floating-actions-bar .preview-btn {
  background: linear-gradient(135deg, #17a2b8, #6f42c1);
  border: none;
  color: white;
}

.floating-actions-bar .preview-btn:hover {
  background: linear-gradient(135deg, #138496, #5a32a3);
}

.floating-actions-bar .save-btn {
  background: linear-gradient(135deg, #007bff, #0056b3);
  border: none;
  color: white;
}

.floating-actions-bar .save-btn:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
}

.floating-actions-bar .export-btn {
  background: linear-gradient(135deg, #6c757d, #495057);
  border: none;
  color: white;
}

.floating-actions-bar .export-btn:hover {
  background: linear-gradient(135deg, #5a6268, #343a40);
}

.floating-actions-bar .save-export-btn {
  background: linear-gradient(135deg, #fd7e14, #e83e8c);
  border: none;
  color: white;
}

.floating-actions-bar .save-export-btn:hover {
  background: linear-gradient(135deg, #e8690b, #d63384);
}

/* إضافة مساحة في أسفل الصفحة لتجنب تداخل المحتوى مع القسم العائم */
body {
  padding-bottom: 100px;
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 768px) {
  .floating-actions-bar {
    padding: 10px 0;
  }

  .action-group {
    gap: 10px;
  }

  .action-group button {
    min-width: 120px;
    height: 40px;
    font-size: 13px;
  }

  .action-group button i {
    font-size: 14px;
    margin-left: 6px;
  }

  body {
    padding-bottom: 80px;
  }
}

@media (max-width: 480px) {
  .floating-actions-bar {
    padding: 8px 0;
  }

  .action-group {
    gap: 8px;
  }

  .action-group button {
    min-width: 100px;
    height: 35px;
    font-size: 12px;
  }

  .action-group button i {
    font-size: 13px;
    margin-left: 4px;
  }

  body {
    padding-bottom: 70px;
  }
}

/* تأثيرات تفاعلية */
.question-count-section label {
  transition: var(--transition-fast);
}

.question-count-section label:hover {
  color: var(--primary-color);
}

/* تنسيق الأيقونات */
.question-count-section .fas {
  transition: var(--transition-fast);
}

.question-count-section .fas:hover {
  transform: scale(1.1);
}

/* تنسيق زر اقتراح الأسئلة */
#suggestQuestionsBtn {
  background: #1976d2;
  border-color: #1976d2;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

#suggestQuestionsBtn:hover:not(:disabled) {
  background: #1565c0;
  border-color: #1565c0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3);
}

#suggestQuestionsBtn:disabled {
  background: #9e9e9e;
  border-color: #9e9e9e;
  cursor: not-allowed;
  opacity: 0.6;
}

#suggestQuestionsBtn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* تنسيق رسالة التحميل */
#suggestLoading {
  margin-top: 16px;
  color: #1976d2;
  font-weight: 500;
}

#suggestLoading i {
  margin-left: 8px;
}

/* تنسيق رسالة الخطأ */
#suggestError {
  margin-top: 16px;
  text-align: center;
  border-radius: 6px;
}

/* تأثيرات بصرية للأعداد الكبيرة */
@keyframes pulse-warning {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes pulse-danger {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* تحسينات للأجهزة المحمولة */
@media (max-width: 768px) {
  .question-count-section {
    padding: var(--spacing);
    margin-bottom: var(--spacing-lg);
  }

  .question-count-section .form-control {
    width: 60px;
  }

  #suggestQuestionsBtn {
    padding: 10px 24px;
    font-size: 14px;
  }
}

.question-count-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #e3f2fd 60%, #f8fafc 100%);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(25, 118, 210, 0.08);
  padding: 18px 12px 12px 12px;
  margin: 0 8px 8px 8px;
  min-width: 150px;
  flex: 1 1 180px;
  transition: box-shadow 0.3s, border-color 0.3s, background 0.3s;
  border: 2.5px solid #1976d2;
  font-weight: 700;
  font-size: 1.08rem;
}
.true-false-option {
  background: linear-gradient(90deg, #e8f5e9 60%, #f8fafc 100%);
  border-color: #43a047;
}
.multiple-choice-option {
  background: linear-gradient(90deg, #e3f2fd 60%, #f8fafc 100%);
  border-color: #1976d2;
}
.classic-option {
  background: linear-gradient(90deg, #ede7f6 60%, #f8fafc 100%);
  border-color: #6f42c1;
}
.question-count-option:hover {
  box-shadow: 0 6px 24px rgba(25, 118, 210, 0.15);
  background: linear-gradient(90deg, #e3f2fd 80%, #bbdefb 100%);
}
.true-false-option:hover {
  background: linear-gradient(90deg, #c8e6c9 80%, #e8f5e9 100%);
}
.multiple-choice-option:hover {
  background: linear-gradient(90deg, #bbdefb 80%, #e3f2fd 100%);
}
.classic-option:hover {
  background: linear-gradient(90deg, #d1c4e9 80%, #ede7f6 100%);
}
.count-label {
  font-weight: bold;
  color: #374151;
  margin-bottom: 10px;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.count-input {
  width: 70px !important;
  height: 44px;
  font-size: 1.6rem;
  text-align: center;
  border-radius: 8px;
  border: 2px solid #e3f2fd;
  background: #fff;
  box-shadow: 0 1px 2px rgba(25, 118, 210, 0.03);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.count-input:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.08);
  outline: none;
}

@media (max-width: 768px) {
  .question-count-option {
    min-width: 120px;
    padding: 12px 6px 8px 6px;
    font-size: 1em;
    border-radius: 12px;
  }
  .count-input {
    width: 55px !important;
    height: 38px;
    font-size: 1.25rem;
  }
}

.question-count-section > div[style*="display: flex"] {
  flex-wrap: wrap;
  gap: 18px 10px !important;
  justify-content: flex-start;
}

.question-total-box {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 22px auto 0 auto;
  padding: 16px 28px;
  background: linear-gradient(90deg, #e3f2fd 60%, #f8fafc 100%);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(25, 118, 210, 0.08);
  border: 2px solid #1976d2;
  width: fit-content;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1976d2;
  transition: box-shadow 0.3s;
}
.question-total-box:hover {
  box-shadow: 0 6px 24px rgba(25, 118, 210, 0.15);
  background: linear-gradient(90deg, #e3f2fd 80%, #bbdefb 100%);
}
.total-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1em;
  color: #1976d2;
}
#totalQuestionsCount {
  background: #fff;
  color: #1976d2;
  padding: 6px 18px;
  border-radius: 8px;
  font-size: 1.2em;
  font-weight: bold;
  border: 2px solid #90caf9;
  box-shadow: 0 1px 4px rgba(25, 118, 210, 0.07);
  margin-right: 8px;
  margin-left: 8px;
  min-width: 40px;
  text-align: center;
  display: inline-block;
  transition: border-color 0.2s, box-shadow 0.2s;
}
@media (max-width: 768px) {
  .question-total-box {
    padding: 10px 12px;
    font-size: 1.05rem;
    border-radius: 12px;
  }
  #totalQuestionsCount {
    padding: 4px 10px;
    font-size: 1em;
    border-radius: 6px;
    min-width: 28px;
  }
}

.total-warning-msg {
  background: linear-gradient(90deg, #fff3e0 60%, #ffebee 100%);
  color: #d84315;
  border: 2px solid #ffb300;
  border-radius: 10px;
  font-size: 1.08rem;
  font-weight: 600;
  margin: 12px auto 0 auto;
  padding: 12px 18px;
  max-width: 350px;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
}

.suggest-username-btn {
  background: linear-gradient(90deg, #2563eb 0%, #1e40af 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.suggest-username-btn:hover,
.suggest-username-btn:focus {
  background: linear-gradient(90deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}
.suggest-password-btn {
  background: linear-gradient(90deg, #16a34a 0%, #22d3ee 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(34, 211, 238, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}
.suggest-password-btn:hover,
.suggest-password-btn:focus {
  background: linear-gradient(90deg, #22d3ee 0%, #16a34a 100%);
  color: #fff;
  transform: scale(1.06);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.15);
}
.suggest-username-btn i,
.suggest-password-btn i {
  font-size: 1.1em;
  margin-left: 2px;
}

#currentTrainersSection {
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.07);
}
#trainersListTable {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(30, 64, 175, 0.06);
  font-size: 1.05em;
}
#trainersListTable th,
#trainersListTable td {
  vertical-align: middle;
  text-align: center;
  padding: 10px 8px;
}
#trainersListTable thead th {
  background: #e0e7ef;
  color: #2563eb;
  font-weight: bold;
  border-bottom: 2px solid #2563eb22;
}
#trainersListTable tbody tr:nth-child(even) {
  background: #f3f6fa;
}
#trainersListTable tbody tr:hover {
  background: #e0e7ef44;
}
.password-masked,
.password-plain {
  font-family: "Segoe UI", monospace;
  font-size: 1.1em;
  letter-spacing: 2px;
  transition: color 0.2s;
}
.btn-outline-secondary.btn-sm {
  padding: 3px 10px;
  font-size: 0.98em;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.btn-outline-secondary.btn-sm:hover,
.btn-outline-secondary.btn-sm:focus {
  background: #2563eb22;
  color: #2563eb;
}

.btn-warning.btn-sm {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e42 100%);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.08);
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-warning.btn-sm:hover,
.btn-warning.btn-sm:focus {
  background: linear-gradient(90deg, #f59e42 0%, #fbbf24 100%);
  color: #fff;
  transform: scale(1.07);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.15);
}
.btn-warning.btn-sm i {
  margin-left: 3px;
}

.admin-row {
  border: 2px solid #2563eb !important;
  background: #f0f6ff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.07);
}
.role-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 0.98em;
  font-weight: bold;
  letter-spacing: 1px;
}
.badge-admin {
  background: linear-gradient(90deg, #fbbf24 0%, #2563eb 100%);
  color: #fff;
  border: 1.5px solid #2563eb;
  box-shadow: 0 1px 6px rgba(251, 191, 36, 0.08);
}
.badge-trainer {
  background: #e0e7ef;
  color: #2563eb;
  border: 1.5px solid #e0e7ef;
}
