/* ============= متغيرات الألوان ============= */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --info: #06b6d4;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-overlay: rgba(99, 102, 241, 0.05);

  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-white: #ffffff;

  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============= الإعدادات الأساسية ============= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Cairo', 'Segoe UI', 'Tahoma', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============= شريط التنقل العلوي ============= */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text-white);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

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

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-white);
  text-decoration: none;
}

.navbar-logo-icon {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  backdrop-filter: blur(10px);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  flex-wrap: wrap;
}

.navbar-menu a {
  color: var(--text-white);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.navbar-menu a:hover,
.navbar-menu a.active {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.navbar-menu a i {
  margin-left: 0.4rem;
}

.mobile-menu-btn {
  display: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-white);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.3rem;
}

/* ============= القسم الرئيسي - الصفحة الرئيسية ============= */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text-white);
  padding: 5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white" opacity="0.3"/><circle cx="80" cy="40" r="2" fill="white" opacity="0.3"/><circle cx="40" cy="60" r="2" fill="white" opacity="0.3"/><circle cx="90" cy="80" r="2" fill="white" opacity="0.3"/></svg>');
  background-size: 200px;
  opacity: 0.3;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  opacity: 0.95;
  margin-bottom: 2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.9rem 2rem;
  border-radius: var(--radius-md);
  border: none;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
}

.btn-primary {
  background: var(--text-white);
  color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.btn-secondary {
  background: transparent;
  color: var(--text-white);
  border: 2px solid var(--text-white);
}

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

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

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

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  justify-content: center;
}

/* ============= بطاقات الأقسام ============= */
.sections {
  padding: 4rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
  border: 2px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: right;
  transition: var(--transition);
}

.section-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

.section-card:hover::before {
  transform: scaleX(1);
  transform-origin: left;
}

.section-card-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-white);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--shadow-md);
}

.section-card:nth-child(2) .section-card-icon { background: linear-gradient(135deg, #10b981, #06b6d4); }
.section-card:nth-child(3) .section-card-icon { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.section-card:nth-child(4) .section-card-icon { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.section-card:nth-child(5) .section-card-icon { background: linear-gradient(135deg, #06b6d4, #3b82f6); }

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

.section-card-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.section-card-stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.section-card-stat {
  background: var(--bg-overlay);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

/* ============= المميزات ============= */
.features {
  background: var(--bg-card);
  padding: 4rem 1.5rem;
}

.features-container {
  max-width: 1400px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-item {
  text-align: center;
  padding: 1.5rem;
}

.feature-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--primary);
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ============= التذييل ============= */
.footer {
  background: #1e293b;
  color: var(--text-white);
  padding: 2.5rem 1.5rem 1.5rem;
  text-align: center;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
}

.footer p {
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

/* ============= صفحات المحتوى ============= */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--text-white);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

.page-header-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.page-header-subtitle {
  opacity: 0.95;
  font-size: 1.05rem;
}

.page-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ============= أدوات البحث والتصفية ============= */
.toolbar {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--bg-main);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
}

.search-box i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.2rem;
  background: var(--bg-main);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

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

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

/* ============= تخطيط الصفحات (مع الشريط الجانبي) ============= */
.page-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.sidebar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-primary);
}

.sidebar-list {
  list-style: none;
}

.sidebar-item {
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sidebar-item:hover {
  background: var(--bg-overlay);
  color: var(--primary);
}

.sidebar-item.active {
  background: var(--primary);
  color: var(--text-white);
  font-weight: 600;
}

.sidebar-item i {
  font-size: 0.85rem;
}

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

.word-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 2px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.word-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.word-english {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  flex: 1;
  word-break: break-word;
}

.word-part-of-speech {
  font-size: 0.7rem;
  background: var(--bg-overlay);
  color: var(--primary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  white-space: nowrap;
}

.word-meaning {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.word-pronunciation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-main);
  border-radius: var(--radius-md);
}

.word-pronunciation i {
  color: var(--primary);
}

.word-example {
  border-top: 1px dashed var(--border);
  padding-top: 0.75rem;
  font-size: 0.9rem;
}

.word-example-en {
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-style: italic;
}

.word-example-ar {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.speak-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--text-white);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.speak-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

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

/* ============= بطاقات الجمل ============= */
.sentences-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sentence-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 2px solid var(--border);
  transition: var(--transition);
  border-right: 5px solid var(--primary);
}

.sentence-card:hover {
  transform: translateX(-5px);
  box-shadow: var(--shadow-md);
}

.sentence-context {
  display: inline-block;
  background: var(--bg-overlay);
  color: var(--primary);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.sentence-english {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.sentence-english-text {
  flex: 1;
}

.sentence-arabic {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.sentence-pronunciation {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ============= بطاقات المحادثات ============= */
.conversations-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.conversation-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.conversation-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--text-white);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.conversation-title {
  font-size: 1.3rem;
  font-weight: 700;
}

.conversation-setting {
  font-size: 0.9rem;
  opacity: 0.95;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
}

.conversation-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dialogue-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.dialogue-avatar {
  width: 45px;
  height: 45px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dialogue-item:nth-child(even) .dialogue-avatar {
  background: linear-gradient(135deg, var(--success), var(--info));
}

.dialogue-content {
  flex: 1;
  background: var(--bg-main);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  position: relative;
}

.dialogue-speaker {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.dialogue-english {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.dialogue-english-text {
  flex: 1;
}

.dialogue-arabic {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.dialogue-pronunciation {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============= بطاقات القصص ============= */
.stories-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.story-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.story-header {
  background: linear-gradient(135deg, var(--accent), var(--secondary));
  color: var(--text-white);
  padding: 1.75rem;
}

.story-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.story-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.story-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

.story-moral {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  border-right: 3px solid var(--text-white);
  margin-top: 0.5rem;
}

.story-moral::before {
  content: '💡 ';
  margin-left: 0.4rem;
}

.story-body {
  padding: 1.5rem;
}

.story-paragraph {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--border);
}

.story-paragraph:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.paragraph-english {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.paragraph-number {
  background: var(--primary);
  color: var(--text-white);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.paragraph-text {
  flex: 1;
}

.paragraph-arabic {
  background: var(--bg-main);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  margin-right: 40px;
  font-size: 0.95rem;
  border-right: 3px solid var(--secondary);
}

.paragraph-pronunciation {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 40px;
  margin-top: 0.5rem;
  font-style: italic;
}

.story-vocabulary {
  background: var(--bg-main);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  margin-right: 40px;
}

.story-vocabulary-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.vocab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vocab-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.vocab-item strong {
  color: var(--primary);
}

/* ============= بطاقات القواعد ============= */
.grammar-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.grammar-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.grammar-header {
  background: linear-gradient(135deg, var(--info), var(--primary));
  color: var(--text-white);
  padding: 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.grammar-header:hover {
  background: linear-gradient(135deg, var(--primary), var(--info));
}

.grammar-title-section h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.grammar-title-en {
  font-size: 0.95rem;
  opacity: 0.9;
}

.grammar-level-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.grammar-body {
  padding: 1.75rem;
}

.grammar-explanation {
  background: var(--bg-overlay);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border-right: 4px solid var(--primary);
}

.grammar-explanation-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.grammar-explanation p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.95rem;
}

.grammar-section {
  margin-bottom: 1.5rem;
}

.grammar-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.grammar-section-title i {
  color: var(--primary);
}

.example-box {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: var(--transition);
  border-right: 4px solid var(--success);
}

.example-box:hover {
  border-color: var(--primary);
  transform: translateX(-3px);
}

.example-english {
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.example-arabic {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.example-rule {
  display: inline-block;
  background: var(--bg-overlay);
  color: var(--primary);
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.grammar-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.grammar-type-card {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 1rem;
  border: 1px solid var(--border);
}

.grammar-type-title {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.grammar-type-explanation {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.grammar-structure {
  background: #1e293b;
  color: #4ade80;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  margin: 0.75rem 0;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
}

/* ============= رسائل فارغة ============= */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

/* ============= التحميل ============= */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-overlay);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 1s linear infinite;
}

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

/* ============= الإحصائيات السريعة ============= */
.stats-bar {
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.stat-item strong {
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 800;
}

/* ============= زر العودة للأعلى ============= */
.back-to-top {
  position: fixed;
  bottom: 30px;
  left: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary);
  color: var(--text-white);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  z-index: 999;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: var(--primary-dark);
}

.back-to-top.show {
  display: flex;
}

/* ============= الإشعارات ============= */
.notification {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--text-primary);
  color: var(--text-white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.notification.success {
  background: var(--success);
}

.notification.error {
  background: var(--danger);
}

/* ============= Responsive Design ============= */
@media (max-width: 992px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .sidebar-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sidebar-item {
    margin-bottom: 0;
  }
}

@media (max-width: 768px) {
  .navbar-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .navbar-menu.show {
    display: flex;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero {
    padding: 3rem 1rem;
  }

  .sections,
  .features {
    padding: 2.5rem 1rem;
  }

  .section-title {
    font-size: 1.7rem;
  }

  .words-grid {
    grid-template-columns: 1fr;
  }

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

  .dialogue-item {
    flex-direction: column;
    gap: 0.5rem;
  }

  .paragraph-arabic,
  .paragraph-pronunciation,
  .story-vocabulary {
    margin-right: 0;
  }

  .grammar-types-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .navbar-logo {
    font-size: 1.1rem;
  }

  .navbar-logo-icon {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

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

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

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

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

.pulse {
  animation: pulse 0.5s ease-in-out;
}

/* ============= تخصيصات إضافية ============= */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
