/* ==========================================================================
   منصة أروى التعليمية & قسم Bint El-Shemy
   التنسيق الموحد لصفحات الدروس والشروحات والاختبارات (Lesson Theme)
   الهوية المعتمدة: Study Buddy — Teen Edition
   ========================================================================== */

@import url("variables.css");
@import url("base.css");
@import url("components.css");

/* ── 1. هيدر صفحة الدرس (Lesson Header) ── */
.lesson-header,
header.lesson-hero,
.header {
  text-align: center;
  padding: 40px 20px 30px;
  margin-bottom: 30px;
  background: radial-gradient(circle at 50% 30%, rgba(235, 241, 246, 0.8) 0%, rgba(248, 243, 234, 0.5) 75%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
}

.lesson-header h1,
header.lesson-hero h1,
.header h1 {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--deep-navy);
  margin: 12px 0;
  text-shadow: none;
}

.lesson-header .intro-text,
header.lesson-hero .intro-text,
.header p {
  font-size: 1.1rem;
  color: var(--navy-light);
  max-width: 750px;
  margin: 0 auto;
}

/* ── 2. أقسام محتوى الدرس (Lesson Sections) ── */
.lesson-section,
.content-section,
section {
  margin-bottom: 36px;
}

.section-title,
.content-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--deep-navy);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--beige-mid);
}

/* ── 3. كروت التمارين والشروحات والمفاهيم ── */
.exercise,
.concept-card,
.rule-card,
.info-block {
  background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-fast);
}

.exercise:hover,
.concept-card:hover,
.rule-card:hover {
  border-color: var(--dusty-blue-border);
  box-shadow: var(--shadow-card-hover);
}

.exercise-question,
.accordion-header {
  padding: 16px 20px;
  background-color: var(--white);
  cursor: pointer;
  font-weight: 700;
  color: var(--deep-navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color var(--transition-fast);
  user-select: none;
}

.exercise-question::after {
  content: "▼";
  font-size: 0.85rem;
  color: var(--dusty-blue);
  transition: transform var(--transition-fast);
}

.exercise-question.active::after,
.accordion-header.active span:last-child {
  transform: rotate(180deg);
}

.exercise-question:hover,
.accordion-header:hover {
  background-color: var(--cream-light);
}

.exercise-answer,
.accordion-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out, padding 0.3s ease;
  background-color: var(--cream-light);
  color: var(--deep-navy);
}

.exercise-answer.open,
.exercise-question.active + .exercise-answer,
.accordion-content.open {
  padding: 18px 20px;
  max-height: 2000px;
  border-top: 1px solid var(--beige-mid);
}

/* ── 4. بطاقات المفاهيم والأسئلة (Question & Concept Cards) ── */
.question-card, .quiz-card {
  background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.question-card:hover, .quiz-card:hover {
  border-color: var(--dusty-blue-border);
  box-shadow: var(--shadow-md);
}

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--deep-navy);
  margin-bottom: 16px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.option-item {
  padding: 12px 18px;
  background: var(--cream-light);
  border: 1px solid var(--beige-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-item:hover {
  background: var(--dusty-blue-light);
  border-color: var(--dusty-blue);
  color: var(--deep-navy);
}

.option-item.correct {
  background: var(--success-light) !important;
  border-color: var(--success) !important;
  color: #1B5E20 !important;
  font-weight: 700;
}

.option-item.wrong {
  background: var(--danger-light) !important;
  border-color: var(--danger) !important;
  color: #B71C1C !important;
}

/* ── 5. حلول الأسئلة المخفية (Solution Toggles) ── */
.solution-box,
.solution,
.answer-box {
  display: none;
  margin-top: 14px;
  padding: 16px;
  background-color: var(--dusty-blue-light);
  border-right: 4px solid var(--dusty-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--deep-navy);
  animation: fadeIn 0.3s ease-out;
}

.solution-box.open,
.solution.open,
.solution-box[style*="display: block"],
.solution[style*="display: block"] {
  display: block;
}

/* ── 6. بطاقات المراجعة الذكية (Flashcards) ── */
.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.flashcard {
  perspective: 1000px;
  min-height: 180px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front, .flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}

.flashcard-front {
  background-color: var(--white);
  color: var(--deep-navy);
  font-weight: 700;
  font-size: 1.15rem;
}

.flashcard-back {
  background-color: var(--dusty-blue-light);
  color: var(--deep-navy);
  transform: rotateY(180deg);
  border-color: var(--dusty-blue-border);
  font-size: 1rem;
}

/* ── 7. جداول القواعد والمقارنات (Comparison Tables) ── */
.table-responsive {
  overflow-x: auto;
  margin: 20px 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  border: 1px solid var(--beige-mid);
}

table.lesson-table, table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  text-align: right;
}

table.lesson-table th, table th {
  background-color: var(--dusty-blue-light);
  color: var(--deep-navy);
  font-weight: 700;
  padding: 14px 18px;
  border-bottom: 2px solid var(--beige-mid);
}

table.lesson-table td, table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--beige-light);
  color: var(--text-body);
}

table.lesson-table tr:hover td, table tr:hover td {
  background-color: var(--cream-light);
}

/* ── 8. خرائط المفاهيم والروابط (Mindmap Nodes) ── */
.mindmap-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin: 24px 0;
}

.mindmap-node, .mindmap-item {
  background: var(--cream-light);
  border: 2px solid var(--dusty-blue);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-weight: 700;
  color: var(--deep-navy);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.mindmap-node:hover, .mindmap-item:hover {
  background: var(--dusty-blue);
  color: var(--pure-white);
  transform: scale(1.05);
}

/* ── 9. الصناديق التوضيحية ── */
.example-box, .example-container {
  background-color: var(--cream-light);
  border-right: 4px solid var(--dusty-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin: 14px 0;
  color: var(--deep-navy);
}

.rule-box, .definition-box {
  background-color: var(--white);
  border: 2px solid var(--dusty-blue);
  border-radius: var(--radius-md);
  padding: 18px;
  margin: 16px 0;
  color: var(--deep-navy);
}

/* ── 10. قوائم الشرح المنسقة ── */
ul, ol {
  padding-right: 24px;
  margin-bottom: 16px;
}

li {
  margin-bottom: 8px;
}

li::marker {
  color: var(--dusty-blue);
}
