/**
 * أنماط ملحق الخبرة الخارجية ومشروع التخرج — منظومة أكابرس.
 * تستخدم متغيرات القالب: --acaprs-primary / --acaprs-gold / --acaprs-cream ...
 * RTL أصيل بالخصائص المنطقية.
 */

.aex-notice {
  border-radius: 14px;
  padding: 14px 18px;
  margin-block: 14px;
  font-weight: 600;
}
.aex-notice--success { background: #eef7ee; color: #2e6b34; border-inline-start: 4px solid #2e6b34; }
.aex-notice--error { background: #fdeeee; color: #a02a2a; border-inline-start: 4px solid #a02a2a; }
.aex-notice--warning { background: #fdf6e3; color: #8a6d1b; border-inline-start: 4px solid var(--acaprs-gold); }
.aex-notice--info { background: var(--acaprs-cream); color: var(--acaprs-ink); border-inline-start: 4px solid var(--acaprs-primary); }

/* قائمة الأنواع الأربعة */
.aex-checklist {
  background: var(--acaprs-white);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(75, 44, 95, 0.08);
  padding: 28px;
  margin-block: 20px;
}
.aex-checklist__intro { color: var(--acaprs-muted); margin-block: 6px 16px; }
.aex-checklist__types { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.aex-checklist__type {
  display: flex; align-items: center; gap: 12px;
  background: var(--acaprs-cream); border-radius: 12px; padding: 12px 16px;
}
.aex-checklist__type--done { background: #eef7ee; }
.aex-checklist__mark { font-size: 1.3rem; color: var(--acaprs-gold); font-weight: 800; }
.aex-checklist__type--done .aex-checklist__mark { color: #2e6b34; }
.aex-checklist__label { font-weight: 800; flex: 1; }
.aex-checklist__state { font-size: 0.9rem; color: var(--acaprs-muted); }

/* شريط الدقائق */
.aex-minutes-bar { margin-block-start: 18px; }
.aex-minutes-bar__track { height: 10px; background: #eee7d6; border-radius: 6px; overflow: hidden; margin-block-start: 8px; }
.aex-minutes-bar__fill { height: 100%; background: linear-gradient(90deg, var(--acaprs-gold), var(--acaprs-primary)); border-radius: 6px; transition: width 0.6s; }

/* النماذج */
.aex-form {
  background: var(--acaprs-white);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(75, 44, 95, 0.08);
  padding: 28px;
  margin-block: 20px;
}
.aex-form__title { margin-block: 0 18px; color: var(--acaprs-primary); }
.aex-field { margin-block-end: 18px; }
.aex-field label { display: block; margin-block-end: 6px; }
.aex-required { color: #a02a2a; }
.aex-input {
  width: 100%; border: 1.5px solid #e5ddcf; border-radius: 10px;
  padding: 10px 14px; font-family: inherit; font-size: 1rem;
  background: #fffdf9;
}
.aex-input:focus { outline: none; border-color: var(--acaprs-primary); box-shadow: 0 0 0 3px rgba(75, 44, 95, 0.12); }
textarea.aex-input { resize: vertical; }
select.aex-input { cursor: pointer; }
.aex-hint { display: block; font-size: 0.88rem; color: var(--acaprs-muted); margin-block-start: 6px; }
.aex-actions { margin-block: 8px 0; }
.aex-btn {
  background: var(--acaprs-primary); color: #fff; border: none; border-radius: 999px;
  padding: 12px 34px; font-weight: 800; font-size: 1.02rem; cursor: pointer; font-family: inherit;
}
.aex-btn:hover { background: var(--acaprs-primary-dark); }
.aex-btn--sm { padding: 8px 20px; font-size: 0.9rem; display: inline-block; text-decoration: none; }

/* شارات الحالة */
.aex-badge {
  display: inline-block; border-radius: 999px; padding: 4px 14px;
  font-size: 0.85rem; font-weight: 700;
}
.aex-badge--pending { background: #fdf6e3; color: #8a6d1b; }
.aex-badge--approved { background: #eef7ee; color: #2e6b34; }
.aex-badge--rejected { background: #fdeeee; color: #a02a2a; }
.aex-badge--capstone { background: var(--acaprs-primary); color: #fff; }

/* مدخلات الطالب */
.aex-entries { display: grid; gap: 16px; margin-block: 16px; }
.aex-entry {
  background: var(--acaprs-white); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(75, 44, 95, 0.08);
  padding: 22px 24px;
}
.aex-entry__head { display: flex; justify-content: space-between; align-items: center; margin-block-end: 8px; }
.aex-entry__type { font-weight: 800; color: var(--acaprs-primary); }
.aex-entry__title { margin-block: 4px 10px; }
.aex-entry__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.92rem; color: var(--acaprs-muted); margin-block-end: 8px; }
.aex-entry__url a { color: var(--acaprs-gold-dark); font-weight: 700; }
.aex-entry__lessons, .aex-entry__notes { margin-block-start: 10px; font-size: 0.95rem; }
.aex-entry__notes { background: var(--acaprs-cream); border-radius: 10px; padding: 10px 14px; }

/* مقدمة وحالة التخرج */
.aex-capstone-intro, .aex-capstone-status {
  background: var(--acaprs-white); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(75, 44, 95, 0.08);
  padding: 28px; margin-block: 20px;
}
.aex-capstone-intro p { color: var(--acaprs-muted); }
.aex-status-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.aex-status-list li { background: var(--acaprs-cream); border-radius: 10px; padding: 10px 16px; }

/* kickers القالب قد لا تُحمَّل خارج الصفحة الرئيسية — نسخة احتياطية */
.aex-checklist .kicker, .aex-capstone-intro .kicker, .aex-capstone-status .kicker { text-align: start; }
.aex-checklist .kicker-line, .aex-capstone-intro .kicker-line, .aex-capstone-status .kicker-line { margin: 0 0 10px; }
.aex-checklist .kicker-text, .aex-capstone-intro .kicker-text, .aex-capstone-status .kicker-text {
  color: var(--acaprs-gold-dark, #a07f33); font-weight: 800; font-size: 0.92rem;
}

.aex-brief{margin:0 0 2rem}
.aex-brief__title{font-size:1.6rem;margin:.4rem 0 1rem}
.aex-brief__meta{color:#5b5b66}
.aex-brief__h{font-size:1.2rem;margin:1.6rem 0 .6rem;border-bottom:2px solid #EFD9A4;padding-bottom:.3rem}
.aex-brief__phases{margin:0;padding-inline-start:1.4rem}
.aex-brief__phase{margin-bottom:1rem}
.aex-brief__mins{color:#5b5b66;font-weight:400}
.aex-brief__output{margin:.4rem 0 0}
.aex-brief__rubric-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
.aex-brief__rubric{width:100%;border-collapse:collapse;margin:.6rem 0}
.aex-brief__rubric th,.aex-brief__rubric td{border:1px solid #ddd;padding:.5rem .7rem;text-align:start}
.aex-brief__rubric thead th{background:#4B2C5F;color:#fff}
.aex-brief__text{white-space:normal}

/* منتقي المسارات (?track_id=) — صفحتا التخرج والخبرة */
.aex-track-picker { margin: 1em 0; }
.aex-track-picker__list { list-style: none; margin: .5em 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5em; }
.aex-track-picker__list a { display: inline-block; padding: .45em 1em; border: 1px solid #4B2C5F; border-radius: 999px; text-decoration: none; color: #4B2C5F; }
.aex-track-picker__list a:hover { background: #4B2C5F; color: #fff; }

/* ===== تجاوب الجوال (م5 + ب5 + ب1 — 1.1.11) =====
   روبرك التخرج: تمرير أفقي محكوم داخل غلاف الجدول عند الضيق
   (حد أدنى لعرض الجدول حتى لا ينضغط عمود الوصف وتتكدس كلماته)،
   وحشوات أخف تردّ للجوال عرضه، وأهداف لمس ≥44px. */
@media (max-width: 640px) {
  .aex-brief__rubric { min-width: 540px; }
  .aex-form, .aex-checklist, .aex-capstone-intro, .aex-capstone-status { padding: 20px 16px; }
  .aex-entry { padding: 18px 16px; }
  .aex-entry__head { flex-wrap: wrap; gap: 6px 12px; }
}
.aex-entry__lessons, .aex-entry__notes, .aex-entry__url a { overflow-wrap: break-word; }
.aex-btn--sm { min-height: 44px; display: inline-flex; align-items: center; }
.aex-track-picker__list a { min-height: 44px; display: inline-flex; align-items: center; }

/* ============================================================
   التحسين البصري 1.2.0 — لغة «لوحتي»/المعاينة المعتمدة:
   ترويسات Hero بنفسجية + شارات ملخص + عناوين أقسام + بطاقات
   بشارات حالة ملوّنة + شريط مراحل التخرج.
   كل الأنماط الجديدة داخل نطاق كلاسات aex- الخاصة بهذا الملحق،
   واتجاه RTL ومحاذاة يمين مثبّتة صراحة على الجذور.
   ============================================================ */
.aex-hero, .aex-checklist, .aex-form, .aex-entries, .aex-capstone-status { direction: rtl; text-align: right; }
.aex-num { unicode-bidi: isolate; }

/* ترويسة الصفحة الموحّدة (Hero) */
.aex-hero {
  background: linear-gradient(135deg, var(--acaprs-primary, #4B2C5F) 0%, var(--acaprs-primary-dark, #3a2349) 100%);
  border-radius: 18px; color: #fff; padding: 26px 22px;
  box-shadow: 0 12px 34px rgba(75, 44, 95, 0.09);
  position: relative; overflow: hidden; margin-block: 20px 0;
}
.aex-hero::after {
  content: ""; position: absolute; inset-inline-end: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%; background: rgba(239, 217, 164, 0.14);
}
.aex-hero__title { color: #fff; font-size: 1.65rem; font-weight: 800; margin: 0; position: relative; z-index: 1; }
.aex-hero__sub { color: #e9ddf2; margin-top: 4px; max-width: 640px; position: relative; z-index: 1; }
.aex-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.aex-chip {
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(239, 217, 164, 0.45);
  color: #fff; border-radius: 999px; padding: 4px 15px; font-weight: 700; font-size: 0.9rem;
}
.aex-chip b { color: var(--acaprs-gold, #EFD9A4); font-weight: 900; }
.aex-chip--ok { background: rgba(26, 122, 58, 0.35); border-color: rgba(140, 230, 170, 0.5); }
.aex-hero__progress { margin-top: 16px; max-width: 520px; position: relative; z-index: 1; }
.aex-bar { height: 11px; background: rgba(255, 255, 255, 0.22); border-radius: 999px; overflow: hidden; }
.aex-bar i { display: block; height: 100%; background: linear-gradient(to left, #C9A24B, #EFD9A4); border-radius: 999px; }
.aex-bar i.aex-bar__fill--full { background: linear-gradient(to left, #2f9e57, #7bd79b); }

/* عناوين الأقسام */
.aex-sec-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border-bottom: 2px solid var(--acaprs-gold, #EFD9A4);
  padding-bottom: 8px; margin-block: 22px 16px;
}
.aex-sec-head h3, .aex-sec-head .aex-form__title {
  font-size: 1.28rem; font-weight: 800; color: var(--acaprs-primary, #4B2C5F); margin: 0;
}
.aex-sec-count { color: #6f6580; font-size: 0.9rem; font-weight: 700; }

/* قائمة الأنواع — صفوف تحقق بألوان الحالة */
.aex-checklist { border: 1px solid #e8e0d2; margin-block-start: 0; }
.aex-checklist__type--done { background: #e9f7ee; }
.aex-checklist__type--done .aex-checklist__mark { color: #1a7a3a; }
.aex-checklist__type--pending .aex-checklist__mark { color: #C9A24B; }
.aex-checklist__type--done .aex-checklist__state { color: #1a7a3a; font-weight: 700; }

/* شريط تقدم الدقائق */
.aex-progress-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.95rem; }
.aex-progress-row__name { font-weight: 800; }
.aex-progress-row__pct { color: var(--acaprs-primary, #4B2C5F); font-weight: 900; }
.aex-minutes-bar__track { height: 11px; background: #ece4d4; border-radius: 999px; }
.aex-minutes-bar__fill { background: linear-gradient(to left, #C9A24B, #EFD9A4); border-radius: 999px; }

/* شارات الحالة — لوحة المعاينة */
.aex-badge { border: 1px solid transparent; padding: 5px 15px; font-size: 0.82rem; font-weight: 800; white-space: nowrap; }
.aex-badge--pending { background: #fdf3d7; color: #9a6a12; border-color: #EFD9A4; }
.aex-badge--approved { background: #e9f7ee; color: #1a7a3a; border-color: #9ed3ae; }
.aex-badge--rejected { background: #fdecea; color: #a93226; border-color: #f1a9a0; }

/* بطاقات المدخلات — شارة نوع + صناديق الدروس والملاحظات */
.aex-entry { border: 1px solid #e8e0d2; position: relative; overflow: hidden; }
.aex-entry--approved::before {
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 5px;
  background: linear-gradient(to left, #C9A24B, #EFD9A4);
}
.aex-entry__type {
  display: inline-block; background: #efe7f5; color: var(--acaprs-primary, #4B2C5F);
  border-radius: 999px; padding: 3px 14px; font-size: 0.86rem;
}
.aex-entry__lessons { line-height: 1.95; }
.aex-entry__lessons strong { color: var(--acaprs-primary, #4B2C5F); }
.aex-entry__notes {
  background: #fffdf6; border: 1px solid #e8e0d2; border-inline-start: 4px solid #C9A24B;
  border-radius: 10px; padding: 12px 16px; line-height: 1.95;
}
.aex-entry__notes strong { color: #9a6a12; }
.aex-entry--rejected .aex-entry__notes { background: #fdecea; border-color: #f1a9a0; border-inline-start-color: #f1a9a0; }
.aex-entry--rejected .aex-entry__notes strong { color: #a93226; }

/* النماذج — بطاقة وحقول وخانة تأكيد */
.aex-form { border: 1px solid #e8e0d2; margin-block-start: 0; }
.aex-field label { color: var(--acaprs-primary, #4B2C5F); font-weight: 700; }
.aex-input { border-radius: 12px; padding: 11px 14px; }
.aex-btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 28px; }
.aex-check-line {
  background: var(--acaprs-cream, #F6F3EC); border: 1px solid #e8e0d2;
  border-radius: 12px; padding: 12px 16px; line-height: 1.85;
}
.aex-check-line input[type="checkbox"] {
  width: 19px; height: 19px; accent-color: var(--acaprs-primary, #4B2C5F); vertical-align: middle;
}

/* مشروع التخرج — حاويات البطاقات داخل جذر الحالة */
.aex-capstone-status { background: transparent; box-shadow: none; padding: 0; }
.aex-steps-card, .aex-status-card {
  background: var(--acaprs-white, #fff); border: 1px solid #e8e0d2; border-radius: 18px;
  box-shadow: 0 12px 34px rgba(75, 44, 95, 0.09);
  padding: 22px 20px; margin-block-end: 18px; position: relative; overflow: hidden;
}
.aex-status-card::before {
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 5px;
  background: linear-gradient(to left, #C9A24B, #EFD9A4);
}
.aex-status-card__title { font-size: 1.25rem; font-weight: 800; color: var(--acaprs-primary, #4B2C5F); margin-block: 6px 10px; }
.aex-status-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
}
.aex-status-list__main { flex: 1; min-width: 200px; }
.aex-status-list strong { color: var(--acaprs-primary, #4B2C5F); }
.aex-grade-num { color: var(--acaprs-primary, #4B2C5F); font-weight: 900; }

/* شريط مراحل مشروع التخرج */
.aex-steps { display: flex; flex-direction: column; }
.aex-step { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.aex-step:last-child { padding-bottom: 2px; }
.aex-step::before {
  content: ""; position: absolute; inset-inline-start: 17px; top: 38px; bottom: 2px;
  width: 2px; background: #e3d9c4;
}
.aex-step:last-child::before { display: none; }
.aex-step__dot {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-weight: 900;
  background: #f1ede3; color: #6f6580; border: 2px solid #e8e0d2; z-index: 1;
}
.aex-step--done .aex-step__dot { background: #1a7a3a; border-color: #1a7a3a; color: #fff; }
.aex-step--now .aex-step__dot {
  background: var(--acaprs-primary, #4B2C5F); border-color: var(--acaprs-gold, #EFD9A4);
  color: #fff; box-shadow: 0 0 0 5px rgba(239, 217, 164, 0.45);
}
.aex-step__body { flex: 1; padding-top: 3px; }
.aex-step__title { font-weight: 800; display: block; }
.aex-step__desc { color: #6f6580; font-size: 0.93rem; display: block; }

@media (min-width: 700px) {
  .aex-hero { padding: 30px 34px; }
  .aex-steps-card, .aex-status-card { padding: 26px 28px; }
  .aex-steps { flex-direction: row; }
  .aex-step { flex: 1; flex-direction: column; padding-bottom: 0; padding-inline-end: 10px; }
  .aex-step::before {
    inset-inline-start: 38px; inset-inline-end: 0; top: 17px; bottom: auto;
    width: auto; height: 2px;
  }
  .aex-step__body { padding-top: 10px; }
}
@media (max-width: 640px) {
  .aex-hero { padding: 22px 16px; }
  .aex-steps-card, .aex-status-card { padding: 18px 16px; }
  .aex-status-list__main { min-width: 0; }
}
