/*
 * ===================================================
 * LingoMotivate AI - style.css
 * ملف التصميم الرئيسي
 * ===================================================
 */

/* ===== استيراد الخط العربي ===== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ===== متغيرات التصميم ===== */
:root {
  --primary: #6C63FF;
  --primary-dark: #5a52d5;
  --primary-light: #a29bfe;
  --secondary: #FF6B6B;
  --secondary-dark: #e55a5a;
  --accent: #FFA726;
  --accent-dark: #fb8c00;
  --success: #4CAF50;
  --success-light: #e8f5e9;
  --warning: #FF9800;
  --warning-light: #fff3e0;
  --error: #F44336;
  --error-light: #ffebee;
  --info: #2196F3;
  --info-light: #e3f2fd;

  --bg-primary: #f0f4ff;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-dark: #1a1a2e;
  --bg-dark-card: #16213e;

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #8a8aaa;
  --text-light: #ffffff;

  --border-color: #e0e0f0;
  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-lg: 24px;
  --border-radius-full: 50px;

  --shadow-sm: 0 2px 8px rgba(108, 99, 255, 0.08);
  --shadow-md: 0 8px 24px rgba(108, 99, 255, 0.12);
  --shadow-lg: 0 16px 48px rgba(108, 99, 255, 0.18);
  --shadow-xl: 0 24px 64px rgba(108, 99, 255, 0.24);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.5s ease;

  --font-main: 'Cairo', 'Tajawal', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
}

/* ===== إعادة الضبط والأساس ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: var(--font-size-base);
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

ul, ol { list-style: none; }

/* ===== الهيدر الرئيسي ===== */
.main-header {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, #ec4899 100%);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.brand-tagline {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.8);
  font-weight: 400;
}

.header-title-center {
  flex: 1;
  text-align: center;
}

.page-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.user-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  background: rgba(255,255,255,0.15);
  padding: 0.4rem 0.75rem;
  border-radius: var(--border-radius-sm);
  backdrop-filter: blur(4px);
}

.user-badge span {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.8);
}

.user-badge strong {
  font-size: var(--font-size-sm);
  color: white;
}

/* ===== الأزرار ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-full);
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 99, 255, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(108, 99, 255, 0.5);
  color: white;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.35);
}

.btn-secondary:hover { box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5); color: white; }

.btn-success {
  background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.35);
}

.btn-success:hover { box-shadow: 0 8px 25px rgba(76, 175, 80, 0.5); color: white; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 167, 38, 0.35);
}

.btn-accent:hover { box-shadow: 0 8px 25px rgba(255, 167, 38, 0.5); color: white; }

.btn-outline {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.25);
  color: white;
}

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 2px solid rgba(255,255,255,0.3);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.btn-sm { padding: 0.5rem 1rem; font-size: var(--font-size-sm); }
.btn-lg { padding: 1rem 2.5rem; font-size: var(--font-size-lg); }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== البطاقات ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ===== بطاقات الإحصاء ===== */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary), var(--primary-light));
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.stat-card.secondary::before { background: linear-gradient(to bottom, var(--secondary), #ff9a9a); }
.stat-card.success::before { background: linear-gradient(to bottom, var(--success), #81c784); }
.stat-card.accent::before { background: linear-gradient(to bottom, var(--accent), #ffcc80); }
.stat-card.info::before { background: linear-gradient(to bottom, var(--info), #64b5f6); }

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.stat-value {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== شريط التقدم ===== */
.progress-wrap {
  margin: 0.5rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.progress-bar {
  background: var(--border-color);
  border-radius: var(--border-radius-full);
  height: 12px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--border-radius-full);
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

.progress-fill.success { background: linear-gradient(90deg, var(--success), #81c784); }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), #ffcc02); }
.progress-fill.error { background: linear-gradient(90deg, var(--error), #ef9a9a); }

/* ===== حاوية الصفحة الرئيسية ===== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem;
}

/* ===== شبكة العرض ===== */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ===== الشارات والعلامات ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.badge-success { background: var(--success-light); color: #2e7d32; }
.badge-warning { background: var(--warning-light); color: #e65100; }
.badge-error { background: var(--error-light); color: #c62828; }
.badge-info { background: var(--info-light); color: #1565c0; }
.badge-primary { background: #ede9fe; color: var(--primary-dark); }

/* ===== الإشعارات ===== */
.notification {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 500px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  border-right: 4px solid var(--success);
}

.notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.notification-success { border-right-color: var(--success); }
.notification-error { border-right-color: var(--error); }
.notification-warning { border-right-color: var(--warning); }
.notification-info { border-right-color: var(--info); }

.notif-icon { font-size: 1.5rem; }
.notif-text { flex: 1; font-weight: 600; color: var(--text-primary); }
.notif-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0;
}

/* ===== المساعد الذكي ===== */
.ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(6px);
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.ai-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.ai-modal {
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  width: 380px;
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(30px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-modal-overlay.active .ai-modal { transform: translateY(0); }

.ai-modal-header {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.ai-modal-header h3 {
  color: white;
  font-size: var(--font-size-base);
  font-weight: 700;
}

.ai-status { color: rgba(255,255,255,0.8); font-size: var(--font-size-xs); }
.ai-status::before { content: '● '; color: #4ade80; }

.ai-close-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-fast);
}

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

.ai-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 200px;
  max-height: 300px;
}

.chat-message { display: flex; }
.chat-message.bot { justify-content: flex-start; }
.chat-message.user { justify-content: flex-end; }

.msg-bubble {
  padding: 0.75rem 1rem;
  border-radius: 16px;
  max-width: 85%;
  font-size: var(--font-size-sm);
  line-height: 1.6;
}

.chat-message.bot .msg-bubble {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.chat-message.user .msg-bubble {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-bottom-left-radius: 4px;
}

.ai-quick-btns {
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border-color);
}

.quick-btn {
  padding: 0.4rem 0.85rem;
  border-radius: var(--border-radius-full);
  border: 2px solid var(--primary-light);
  background: transparent;
  color: var(--primary);
  font-family: var(--font-main);
  font-size: var(--font-size-xs);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.ai-modal-footer {
  padding: 0.75rem 1rem;
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.ai-modal-footer input {
  flex: 1;
  padding: 0.65rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-full);
  font-family: var(--font-main);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-fast);
  text-align: right;
}

.ai-modal-footer input:focus { border-color: var(--primary); }

.send-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: var(--border-radius-full);
  font-family: var(--font-main);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.send-btn:hover { transform: scale(1.05); }

/* ===== زر المساعد الطافي ===== */
.ai-fab {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(108, 99, 255, 0.4);
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-fab:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 32px rgba(108, 99, 255, 0.6);
}

.ai-fab-label {
  position: absolute;
  bottom: 70px;
  left: 0;
  background: white;
  color: var(--primary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 700;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  animation: bounce 2s infinite;
}

/* ===== قسم Hero ===== */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, #ec4899 100%);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  color: white;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.hero-title {
  font-size: var(--font-size-3xl);
  font-weight: 900;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hero-subtitle {
  font-size: var(--font-size-lg);
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

/* ===== بطاقات المفردات ===== */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.vocab-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

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

.vocab-card.flipped {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-color: transparent;
}

.vocab-emoji { font-size: 2.2rem; margin-bottom: 0.5rem; display: block; }
.vocab-word { font-size: var(--font-size-base); font-weight: 700; color: var(--text-primary); }
.vocab-card.flipped .vocab-word { color: white; }
.vocab-meaning { font-size: var(--font-size-sm); color: var(--text-muted); margin-top: 0.25rem; }
.vocab-card.flipped .vocab-meaning { color: rgba(255,255,255,0.85); }
.vocab-hint { font-size: var(--font-size-xs); color: var(--primary); margin-top: 0.5rem; }
.vocab-card.flipped .vocab-hint { color: rgba(255,255,255,0.7); }

/* ===== الاختبار Quiz ===== */
.quiz-progress-bar-wrap {
  background: var(--border-color);
  border-radius: var(--border-radius-full);
  height: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--border-radius-full);
  transition: width 0.5s ease;
}

.quiz-counter {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.quiz-question-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.quiz-question-text {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
  line-height: 1.5;
}

.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; }

.quiz-option-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: white;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  text-align: right;
  transition: var(--transition);
}

.quiz-option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: #ede9fe;
}

.quiz-option-btn.selected { border-color: var(--primary); background: #ede9fe; }
.quiz-option-btn.correct { border-color: var(--success) !important; background: var(--success-light) !important; }
.quiz-option-btn.wrong { border-color: var(--error) !important; background: var(--error-light) !important; }

.option-letter {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: var(--font-size-sm);
  color: var(--primary);
  flex-shrink: 0;
}

.quiz-option-btn.correct .option-letter { background: var(--success); color: white; }
.quiz-option-btn.wrong .option-letter { background: var(--error); color: white; }

.option-text { flex: 1; }

/* ===== مقياس ليكرت ===== */
.likert-question {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
  transition: var(--transition);
}

.likert-question:hover { border-color: var(--primary-light); }
.likert-question.answered { border-color: var(--success); }

.likert-dimension-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.dim-attention { background: #fef3c7; color: #92400e; }
.dim-relevance { background: #dbeafe; color: #1e40af; }
.dim-confidence { background: #dcfce7; color: #166534; }
.dim-satisfaction { background: #fce7f3; color: #9d174d; }

.likert-text {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.likert-scale {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.likert-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: white;
  cursor: pointer;
  font-family: var(--font-main);
  min-width: 70px;
  transition: var(--transition);
}

.likert-btn:hover {
  border-color: var(--primary);
  background: #ede9fe;
}

.likert-btn.selected {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border-color: transparent;
  transform: scale(1.05);
}

.likert-value {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  line-height: 1;
}

.likert-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

/* ===== خطوات التعلم ===== */
.learning-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}

.step-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateX(-4px);
  color: var(--text-primary);
}

.step-card.completed {
  border-color: var(--success);
  background: linear-gradient(to right, var(--success-light), white);
}

.step-card.locked {
  opacity: 0.6;
  pointer-events: none;
}

.step-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-xl);
  font-weight: 800;
  flex-shrink: 0;
}

.step-card.completed .step-number {
  background: linear-gradient(135deg, var(--success), #81c784);
}

.step-card.locked .step-number {
  background: var(--text-muted);
}

.step-info { flex: 1; }

.step-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.step-desc {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.step-action {
  font-size: 1.5rem;
}

/* ===== جدول الطلاب ===== */
.students-table-wrap {
  overflow-x: auto;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.students-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.students-table th {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  padding: 1rem 1.25rem;
  text-align: right;
  font-weight: 700;
  font-size: var(--font-size-sm);
  white-space: nowrap;
}

.students-table th:first-child { border-radius: 0 var(--border-radius) 0 0; }
.students-table th:last-child { border-radius: var(--border-radius) 0 0 0; }

.students-table td {
  padding: 1rem 1.25rem;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
  font-size: var(--font-size-sm);
}

.students-table tr:last-child td { border-bottom: none; }

.students-table tr:hover td { background: var(--bg-primary); }

.student-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-avatar {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  background: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-size-xs);
}

.status-dot.done { color: var(--success); }
.status-dot.pending { color: var(--text-muted); }

/* ===== صفحة تسجيل الدخول ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.login-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bg-shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.login-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.25);
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 4px 8px rgba(108, 99, 255, 0.3));
}

.login-brand {
  font-size: var(--font-size-2xl);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.user-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.user-type-tab {
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  background: white;
  cursor: pointer;
  font-family: var(--font-main);
  text-align: center;
  transition: var(--transition);
}

.user-type-tab.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #ede9fe, #f3f0ff);
}

.tab-icon { font-size: 2.2rem; display: block; margin-bottom: 0.5rem; }
.tab-label { font-size: var(--font-size-base); font-weight: 700; color: var(--text-primary); }
.tab-sub { font-size: var(--font-size-xs); color: var(--text-muted); }

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

.form-label {
  display: block;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: var(--font-size-sm);
}

.form-input {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--font-main);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: white;
  outline: none;
  transition: var(--transition);
  text-align: right;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.1);
}

/* ===== رسالة النجاح ===== */
.success-message {
  background: linear-gradient(135deg, var(--success-light), #d1fae5);
  border: 2px solid var(--success);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
}

.success-icon { font-size: 4rem; display: block; margin-bottom: 1rem; }
.success-title { font-size: var(--font-size-2xl); font-weight: 800; color: #166534; margin-bottom: 0.5rem; }
.success-subtitle { color: #4b7c59; }

/* ===== نتيجة الاختبار البعدي ===== */
.result-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 2rem 0;
}

.result-box {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.result-box.pre { border-top: 4px solid var(--warning); }
.result-box.post { border-top: 4px solid var(--success); }

.result-score {
  font-size: var(--font-size-4xl);
  font-weight: 900;
  margin-bottom: 0.25rem;
}

.result-box.pre .result-score { color: var(--warning); }
.result-box.post .result-score { color: var(--success); }
.result-label { font-size: var(--font-size-sm); color: var(--text-muted); font-weight: 600; }

.result-arrow {
  text-align: center;
  font-size: 3rem;
}

.improvement-badge {
  background: linear-gradient(135deg, var(--success), #22c55e);
  color: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  text-align: center;
  font-size: var(--font-size-3xl);
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3);
}

/* ===== الفوتر ===== */
.main-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,0.6);
  text-align: center;
  padding: 1.5rem;
  font-size: var(--font-size-sm);
  margin-top: auto;
}

.main-footer strong { color: rgba(255,255,255,0.9); }

/* ===== أنيميشن ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

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

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

.fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.fade-in { animation: fadeInUp 0.4s ease forwards; }
.pulse { animation: pulse 2s infinite; }

/* ===== مسافات مساعدة ===== */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-container { height: auto; flex-wrap: wrap; padding: 0.75rem 1rem; gap: 0.5rem; }
  .header-title-center { order: 3; width: 100%; }
  .page-title { font-size: var(--font-size-base); }
  .brand-name { font-size: var(--font-size-base); }
  .brand-tagline { display: none; }

  .main-content { padding: 1rem; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .hero-title { font-size: var(--font-size-2xl); }
  .hero-subtitle { font-size: var(--font-size-base); }

  .login-card { padding: 2rem 1.5rem; }

  .result-comparison { grid-template-columns: 1fr; }
  .result-arrow { transform: rotate(90deg); }

  .students-table { min-width: 700px; }

  .likert-scale { gap: 0.35rem; }
  .likert-btn { min-width: 56px; padding: 0.6rem 0.35rem; }
  .likert-value { font-size: var(--font-size-xl); }

  .ai-modal { width: 100%; }
  .ai-fab { bottom: 1.5rem; left: 1.5rem; width: 56px; height: 56px; }

  .vocab-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 480px) {
  :root { --font-size-base: 0.9375rem; }
  .hero-section { padding: 1.5rem; }
  .hero-title { font-size: var(--font-size-xl); }
  .login-card { padding: 1.5rem 1.25rem; }
  .user-type-tabs { grid-template-columns: 1fr; }
}

/* ===== تخصيص Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== بطاقات Duolingo ===== */
.duolingo-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.duolingo-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}

.duolingo-card.completed::before { background: var(--success); }
.duolingo-card.in-progress::before { background: var(--warning); }
.duolingo-card.not-started::before { background: var(--border-color); }

.duolingo-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.task-week {
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.task-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.task-desc {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.task-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-points {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--accent-dark);
}
