/* ============================================================
   THE GOAT - الموقع الجديد (النسخة الثانية من الواجهة العامة)
   ============================================================ */

:root {
    --primary-purple: #5b5ea6;
    --hover-purple: #45488c;
    --purple-light: #9a9dd4;
    --dark: #14141c;
    --dark-2: #19191e;
    --text-dark: #111111;
    --nav-height: 84px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Alexandria', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #ffffff;
    color: var(--text-dark);
}

a {
    text-decoration: none;
}

/* عكس اتجاه أيقونات الأسهم في النسخة الإنجليزية LTR */
[dir="ltr"] .flip-ltr {
    transform: scaleX(-1);
}

/* ------------------------------------------------------------
   خلفية texture متحركة مربوطة بالتمرير
   طبقة ثابتة خلف المحتوى، تظهر في الأقسام الفاتحة فقط
   (الهيرو الغامق يغطيها)، وعناصرها تتحرك مع التمرير بسرعات مختلفة
   ------------------------------------------------------------ */
.bg-texture {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-texture .tex {
    position: absolute;
    color: var(--primary-purple);
    will-change: transform;
}

@media (max-width: 768px) {
    .bg-texture .tex-md-hide {
        display: none;
    }

    .bg-texture .tex {
        opacity: 0.18 !important;
    }
}

/* ------------------------------------------------------------
   النافبار
   ------------------------------------------------------------ */
.site-nav {
    position: fixed;
    top: 0;
    inset-inline: 0;
    height: var(--nav-height);
    background: #ffffff;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.25s ease;
}

.site-nav.scrolled {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.09);
}

.site-nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 26px;
    padding-inline-start: max(28px, calc((100vw - 1320px) / 2));
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-inline-end: auto;
}

.nav-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.nav-brand span {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-purple);
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-purple);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nav-lang {
    color: #666666;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 13px;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.nav-lang:hover {
    color: var(--text-dark);
    border-color: var(--primary-purple);
}

.nav-burger {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: 8px;
}

/* زر النافبار الملتصق بحافة الشاشة مثل القالب المرجعي */
.nav-cta {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    background: var(--primary-purple);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    padding-inline: clamp(28px, 4vw, 58px);
    transition: background-color 0.25s ease;
}

.nav-cta:hover {
    background: var(--hover-purple);
}

/* ------------------------------------------------------------
   الهيرو full-width
   ------------------------------------------------------------ */
.hero {
    position: relative;
    min-height: clamp(540px, 78vh, 720px);
    padding-top: var(--nav-height);
    display: flex;
    align-items: center;
    overflow: hidden;
    /* لو أضيفت صورة في web-assets/img/hero.jpg حتظهر تلقائياً تحت التدرج */
    background-color: var(--dark);
    background-image: url('../img/hero.jpg');
    background-size: cover;
    background-position: center;
}

/* التعتيم فوق الصورة: أغمق في جهة النص حتى تبقى القراءة مريحة،
   وأفتح في الجهة الثانية حتى تبان الصورة. يتعكس تلقائياً مع اللغة */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to left,
        rgba(13, 13, 22, 0.92) 0%,
        rgba(17, 17, 28, 0.72) 45%,
        rgba(38, 38, 68, 0.38) 100%);
}

[dir="ltr"] .hero-overlay {
    background: linear-gradient(to right,
        rgba(13, 13, 22, 0.92) 0%,
        rgba(17, 17, 28, 0.72) 45%,
        rgba(38, 38, 68, 0.38) 100%);
}

/* أشكال زخرفية بلون الهوية */
.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    pointer-events: none;
}

.hero-blob-1 {
    width: 520px;
    height: 520px;
    inset-inline-end: -160px;
    top: -120px;
    background: radial-gradient(circle at 30% 30%, rgba(91, 94, 166, 0.5), rgba(91, 94, 166, 0) 70%);
}

.hero-blob-2 {
    width: 420px;
    height: 420px;
    inset-inline-start: -140px;
    bottom: -140px;
    background: radial-gradient(circle at 60% 40%, rgba(91, 94, 166, 0.35), rgba(91, 94, 166, 0) 70%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
    padding: 60px 28px;
}

.hero-tagline {
    color: var(--purple-light);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 18px;
    animation: heroUp 0.7s ease both;
}

.hero-title {
    color: #ffffff;
    font-size: clamp(2.4rem, 5.2vw, 4.2rem);
    font-weight: 700;
    line-height: 1.25;
    max-width: 15ch;
    margin-bottom: 22px;
    animation: heroUp 0.7s 0.12s ease both;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    font-weight: 500;
    line-height: 1.9;
    max-width: 52ch;
    margin-bottom: 40px;
    animation: heroUp 0.7s 0.24s ease both;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    animation: heroUp 0.7s 0.36s ease both;
}

@keyframes heroUp {
    from {
        opacity: 0;
        transform: translateY(26px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* الأزرار */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 16px 38px;
    border-radius: 4px;
    transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
    transform: translateY(-3px);
}

.btn-primary {
    background: var(--primary-purple);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(91, 94, 166, 0.4);
}

.btn-primary:hover {
    background: var(--hover-purple);
}

.btn-light {
    background: #ffffff;
    color: var(--text-dark);
}

.btn-light:hover {
    background: #eeeef6;
}

/* ------------------------------------------------------------
   الأقسام العامة
   ------------------------------------------------------------ */
.section-inner {
    max-width: 1320px;
    margin-inline: auto;
    padding: 90px 28px;
}

.section-head {
    max-width: 760px;
    margin-inline: auto;
    text-align: center;
    margin-bottom: 44px;
}

.section-tag {
    display: inline-block;
    color: var(--primary-purple);
    background: rgba(91, 94, 166, 0.1);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 30px;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 18px;
}

.section-text {
    color: #555a63;
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 2;
}

/* ظهور العناصر عند التمرير */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------------------------------------
   قسم من نكون: عمودان - النص في جهة والبطاقات 2x2 في الجهة الثانية
   ------------------------------------------------------------ */
.about {
    background: #f7f8fc;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: clamp(36px, 5vw, 80px);
    align-items: center;
}

.about-text .section-tag {
    margin-bottom: 14px;
}

.about-text .section-title {
    margin-bottom: 16px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    padding: 20px 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(91, 94, 166, 0.13);
    border-color: transparent;
}

.feature-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(91, 94, 166, 0.1);
    color: var(--primary-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.feature-card:hover .feature-icon {
    background: var(--primary-purple);
    color: #ffffff;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.feature-card p {
    color: #666c75;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.8;
}

/* ------------------------------------------------------------
   قسم تعرف على مانقدمه من كورسات
   ------------------------------------------------------------ */
.courses {
    background: #f7f8fc;
}

.course-card {
    background: #ffffff;
    border: 2px dashed rgba(91, 94, 166, 0.45);
    border-radius: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.course-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-purple);
    box-shadow: 0 18px 40px rgba(91, 94, 166, 0.14);
}

.course-badge {
    flex-shrink: 0;
    background: #ffc94d;
    color: #443300;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
}

/* شارة المستوى على البطاقة: بلون الهوية لا بالأصفر، فالأصفر للتمييز لا للتصنيف */
.course-badge-level {
    background: rgba(91, 94, 166, 0.12);
    color: var(--primary-purple);
}

/* ------------------------------------------------------------
   شارات تصفية المستويات فوق كاروسيل الكورسات
   ------------------------------------------------------------ */
.level-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.level-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1.5px solid #eef0f5;
    border-radius: 24px;
    padding: 9px 18px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.level-chip:hover {
    border-color: rgba(91, 94, 166, 0.45);
    color: var(--primary-purple);
}

.level-chip.is-active {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: #ffffff;
}

.level-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: rgba(91, 94, 166, 0.12);
    color: var(--primary-purple);
    font-size: 0.76rem;
    font-weight: 700;
}

.level-chip.is-active .level-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

@media (max-width: 600px) {
    .level-filter {
        /* شريط أفقي قابل للسحب بدل صفوف متراكمة تدفع الكاروسيل للأسفل */
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .level-chip {
        flex-shrink: 0;
    }
}

/* ------------------------------------------------------------
   غلاف بطاقة الكورس + التفاصيل
   ------------------------------------------------------------ */
.course-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
    background: #f3f4fb;
}

.course-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.course-card:hover .course-cover img {
    transform: scale(1.05);
}

/* بديل الصورة: لا نوع كورس يحمل غلافاً بعد، ومربع رمادي فارغ يبدو عطلاً */
.course-cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, rgba(91, 94, 166, 0.14) 0%, rgba(91, 94, 166, 0.05) 100%);
    color: rgba(91, 94, 166, 0.5);
    font-size: 34px;
}

.course-desc {
    /* سطران ثم "…" — النص يأتي من الإدارة بأطوال متفاوتة */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.course-actions .course-cta {
    flex: 1;
}

.course-details-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid rgba(91, 94, 166, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-purple);
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.course-details-btn:hover {
    background: rgba(91, 94, 166, 0.1);
    border-color: var(--primary-purple);
}

/* ----- محتوى نافذة تفاصيل الكورس ----- */
.course-modal-head {
    margin-bottom: 20px;
}

.course-modal-cover {
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

.course-modal-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.course-modal-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.course-modal-section {
    margin-bottom: 20px;
}

.course-modal-section h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 8px;
}

.course-modal-section p {
    color: #555a63;
    font-size: 0.95rem;
    line-height: 1.9;
}

.course-skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.course-skill-tag {
    background: rgba(91, 94, 166, 0.1);
    color: var(--primary-purple);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 13px;
    border-radius: 20px;
}

.course-modal-facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 22px;
    color: #555a63;
    font-size: 0.9rem;
}

.course-modal-facts li {
    display: flex;
    align-items: center;
    gap: 7px;
}

.course-modal-facts i {
    color: var(--primary-purple);
}

.course-card-body {
    padding: 24px 22px;
}

.course-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.course-name {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-dark);
}

.course-desc {
    color: #666c75;
    font-size: 0.88rem;
    line-height: 1.9;
    margin-bottom: 14px;
}

.course-meta {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.course-meta li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555a63;
    font-size: 0.88rem;
    font-weight: 500;
}

.course-meta li i {
    color: var(--primary-purple);
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

/* زر التسجيل داخل البطاقة */
.course-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    background: rgba(91, 94, 166, 0.08);
    color: var(--primary-purple);
    font-size: 0.92rem;
    font-weight: 700;
    padding: 12px;
    border-radius: 10px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.course-cta:hover {
    background: var(--primary-purple);
    color: #ffffff;
}

/* ------------------------------------------------------------
   قسم الخطط المتاحة
   ------------------------------------------------------------ */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.plan-card {
    /* كل ألوان الكرت تمرّ من هنا، فتكفي إعادة تعريف متغيّرين من الإدارة
       (--plan-bg و --plan-text) لتتبعهما الأيقونة وعلامات الصح والزر */
    --plan-bg: #ffffff;
    --plan-text: var(--text-dark);
    --plan-text-rgb: 91, 94, 166;
    --plan-muted: #555a63;
    --plan-accent: var(--primary-purple);

    position: relative;
    background: var(--plan-bg);
    border: 1.5px solid #eef0f5;
    border-radius: 18px;
    padding: 34px 26px 28px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.plan-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 44px rgba(91, 94, 166, 0.14);
    border-color: rgba(91, 94, 166, 0.4);
}

/* الخطة الأكثر طلباً: بارزة بلون الهوية */
.plan-card.is-popular {
    --plan-bg: linear-gradient(160deg, var(--primary-purple) 0%, #3f4280 100%);
    --plan-text: #ffffff;
    --plan-text-rgb: 255, 255, 255;
    --plan-muted: rgba(255, 255, 255, 0.92);
    --plan-accent: #ffffff;

    border-color: transparent;
    box-shadow: 0 20px 46px rgba(91, 94, 166, 0.32);
}

.plan-badge {
    position: absolute;
    top: -13px;
    inset-inline-start: 50%;
    transform: translateX(50%);
    background: #ffc94d;
    color: #443300;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

[dir="ltr"] .plan-badge {
    transform: translateX(-50%);
}

.plan-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(var(--plan-text-rgb), 0.12);
    color: var(--plan-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--plan-text);
    letter-spacing: 0.5px;
    margin-bottom: 22px;
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    margin-bottom: 26px;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--plan-muted);
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.85;
}

.plan-features li i {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 5px;
    border-radius: 50%;
    background: rgba(var(--plan-text-rgb), 0.18);
    color: var(--plan-accent);
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plan-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(var(--plan-text-rgb), 0.1);
    color: var(--plan-accent);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 14px;
    border-radius: 12px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.plan-cta:hover {
    background: var(--plan-accent);
    color: var(--plan-bg);
}

/* الخطة الأكثر طلباً: الزر معكوس ليبقى بارزاً على التدرّج */
.plan-card.is-popular .plan-cta {
    background: #ffffff;
    color: var(--primary-purple);
}

.plan-card.is-popular .plan-cta:hover {
    background: #f0f0fa;
}

/* كرت بألوان مختارة من الإدارة يتخلّى عن معالجة «الأكثر طلباً» الثابتة،
   وإلا بقي زرّه أبيض على بنفسجي مهما اختير من ألوان */
.plan-card.is-popular.has-custom-colors .plan-cta {
    background: rgba(var(--plan-text-rgb), 0.12);
    color: var(--plan-accent);
}

.plan-card.is-popular.has-custom-colors .plan-cta:hover {
    background: var(--plan-accent);
    color: var(--plan-bg);
}

/* ------------------------------------------------------------
   قسم المدربين
   ------------------------------------------------------------ */
.trainer-card {
    background: #ffffff;
    border: 1px solid #eef0f5;
    border-radius: 16px;
    padding: 30px 20px 26px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.trainer-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(91, 94, 166, 0.14);
}

.trainer-avatar {
    width: 96px;
    height: 96px;
    margin: 0 auto 16px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--primary-purple), rgba(91, 94, 166, 0.25));
}

.trainer-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid #ffffff;
}

.trainer-name {
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.trainer-role {
    color: var(--primary-purple);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
}

/* إحصائيات المدرب: كورسات وطلاب */
.trainer-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.trainer-stat {
    flex: 1;
    background: #f7f8fc;
    border-radius: 10px;
    padding: 10px 6px;
}

.trainer-stat strong {
    display: block;
    color: var(--primary-purple);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.trainer-stat span {
    color: #666c75;
    font-size: 0.72rem;
    font-weight: 500;
}

/* مستويات ومهارات المدرب */
.trainer-tags {
    text-align: start;
    border-top: 1px solid #f1f3f8;
    padding-top: 10px;
    margin-top: 10px;
}

.trainer-tags-label {
    display: block;
    color: #8a8f98;
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 7px;
}

.trainer-tags-label i {
    color: var(--primary-purple);
    font-size: 0.7rem;
    margin-inline-end: 3px;
}

.trainer-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.trainer-chip {
    background: rgba(91, 94, 166, 0.09);
    color: var(--primary-purple);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.trainer-chip.is-skill {
    background: #f2f3f7;
    color: #555a63;
}

.trainer-chip.is-more {
    background: transparent;
    border: 1px dashed rgba(91, 94, 166, 0.5);
}

/* شارة "معتمد من قبل الأكاديمية" مع tooltip عند النقر */
.certified-badge {
    position: relative;
    display: inline-flex;
    background: none;
    border: none;
    padding: 0;
    color: #1d9bf0;
    font-size: 1rem;
    cursor: pointer;
    vertical-align: middle;
    margin-inline-start: 4px;
}

.certified-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    inset-inline-start: 50%;
    translate: 0;
    transform: translateX(50%);
    background: var(--dark-2);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 8px 14px;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 5;
}

[dir="ltr"] .certified-tooltip {
    transform: translateX(-50%);
}

/* السهم الصغير أسفل الـtooltip */
.certified-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    inset-inline-start: 50%;
    transform: translateX(50%);
    border: 5px solid transparent;
    border-top-color: var(--dark-2);
}

[dir="ltr"] .certified-tooltip::after {
    transform: translateX(-50%);
}

.certified-badge.show-tip .certified-tooltip,
.certified-badge:hover .certified-tooltip {
    opacity: 1;
    visibility: visible;
}

/* نجوم تقييم المدرب */
.trainer-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #ffb400;
    font-size: 0.85rem;
    margin: -8px 0 14px;
}

.trainer-rating-value {
    color: #666c75;
    font-size: 0.78rem;
    font-weight: 700;
    margin-inline-start: 5px;
}

/* شهادات المدرب في البطاقة */
.trainer-cert-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.trainer-cert-chips .trainer-chip i {
    font-size: 0.65rem;
    margin-inline-end: 3px;
}

/* أشرطة النسب: نجاح الطلاب والالتزام بالعمل */
.t-progress {
    margin-bottom: 12px;
    text-align: start;
}

.t-progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.t-progress-top span {
    color: #666c75;
    font-size: 0.78rem;
    font-weight: 600;
}

.t-progress-top strong {
    color: var(--text-dark);
    font-size: 0.82rem;
    font-weight: 700;
}

.t-progress-track {
    display: block;
    height: 8px;
    background: #eef0f5;
    border-radius: 10px;
    overflow: hidden;
}

.t-progress-fill {
    display: block;
    height: 100%;
    background: var(--primary-purple);
    border-radius: 10px;
}

.t-progress-fill.is-green {
    background: #1fb98b;
}

/* زر تفاصيل المدرب */
.trainer-details-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    background: rgba(91, 94, 166, 0.08);
    color: var(--primary-purple);
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.trainer-details-btn:hover {
    background: var(--primary-purple);
    color: #ffffff;
}

/* مودال تفاصيل المدرب */
.trainer-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(540px, 100%);
    background: #ffffff;
    border-radius: 18px;
    padding: 28px 26px;
    max-height: 86vh;
    overflow-y: auto;
    animation: heroUp 0.35s ease both;
}

.trainer-modal-close {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    background: #f2f3f7;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--text-dark);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.trainer-modal-close:hover {
    background: #e2e5ef;
}

.trainer-modal-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.trainer-modal-head img {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(91, 94, 166, 0.25);
}

.trainer-modal-head h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 3px;
}

.trainer-modal-head .certified-inline {
    color: #1d9bf0;
    font-size: 0.95rem;
}

.trainer-modal-head p {
    color: var(--primary-purple);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ملاحظات المدرب كنص ترحيبي داخل مودال التفاصيل */
.trainer-modal-notes {
    position: relative;
    background: #f7f8fc;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 18px;
    color: #555a63;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.95;
    text-align: start;
}

.trainer-modal-body .trainer-video-btn {
    width: 100%;
    justify-content: center;
}

.trainer-modal-body .trainer-tags {
    text-align: start;
}

/* زر مشاهدة الفيديو التعريفي للمدرب */
.trainer-video-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-purple);
    color: #ffffff;
    border: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 22px;
    cursor: pointer;
    margin-bottom: 14px;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.trainer-video-btn:hover {
    background: var(--hover-purple);
    transform: translateY(-2px);
}

.trainer-video-btn i {
    font-size: 0.7rem;
}

/* ------------------------------------------------------------
   قسم آراء الطلاب
   ------------------------------------------------------------ */
.testimonials {
    background: #ffffff;
}

.testimonial-card {
    flex: 0 0 min(390px, 86%);
    background: #ffffff;
    border: 1px solid #eef0f5;
    border-radius: 16px;
    padding: 26px 24px;
    display: flex;
    flex-direction: column;
}

.t-quote {
    color: rgba(91, 94, 166, 0.3);
    font-size: 26px;
    margin-bottom: 12px;
}

.t-text {
    color: #444a52;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 2;
    flex: 1;
    margin-bottom: 18px;
}

.t-author {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #f1f3f8;
    padding-top: 14px;
}

.t-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(91, 94, 166, 0.1);
    color: var(--primary-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.t-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t-author-info strong {
    display: block;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 700;
}

.t-author-info span {
    color: #8a8f98;
    font-size: 0.8rem;
    display: inline-block;
}

/* ------------------------------------------------------------
   كاروسيل عام (الكورسات، المدربون، آراء الطلاب)
   ------------------------------------------------------------ */
.carousel {
    display: flex;
    align-items: center;
    gap: 14px;
}

.carousel-track {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 10px 4px 18px;
    /* مساحة صغيرة حتى لا يُقص ظل البطاقة عند التمرير */
    align-items: stretch;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

/* كل بطاقات الكاروسيل بعرض ثابت */
.carousel-track > * {
    flex: 0 0 min(330px, 84%);
}

/* بطاقات الكاروسيل متساوية الارتفاع مع تثبيت الزر أسفلها */
.carousel-track > .course-card,
.carousel-track > .trainer-card {
    display: flex;
    flex-direction: column;
}

/* تصفية المستوى تُخفي البطاقة بخاصية hidden، والقاعدة أعلاه تتغلّب عليها
   لأن display:none في متصفّح العرض أقلّ تخصيصاً — فتُحسم هنا */
.carousel-track > [hidden] {
    display: none !important;
}

.carousel-track > .course-card .course-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.carousel-track > .course-card .course-meta {
    flex: 1;
}

.carousel-track > .course-card .course-cta,
.carousel-track > .trainer-card .trainer-details-btn {
    margin-top: auto;
}

.c-nav {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #e2e5ef;
    color: var(--primary-purple);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}

.c-nav:hover {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: #ffffff;
}

@media (max-width: 640px) {
    .c-nav {
        display: none;
    }

    .carousel-track {
        gap: 14px;
    }
}

/* ------------------------------------------------------------
   قسم الأسئلة الشائعة
   ------------------------------------------------------------ */
.faq {
    background: #f7f8fc;
}

.faq-list {
    max-width: 860px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.faq-item {
    background: #ffffff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.faq-item.open {
    border-color: rgba(91, 94, 166, 0.45);
    box-shadow: 0 10px 26px rgba(91, 94, 166, 0.08);
}

.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: none;
    border: none;
    font-family: inherit;
    text-align: start;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
    padding: 18px 22px;
    cursor: pointer;
}

.faq-q i {
    color: var(--primary-purple);
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.faq-item.open .faq-q i {
    transform: rotate(180deg);
}

/* فتح/إغلاق الإجابة بأنيميشن CSS فقط عبر grid-template-rows */
.faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.faq-item.open .faq-a {
    grid-template-rows: 1fr;
}

.faq-a-inner {
    overflow: hidden;
}

.faq-a-inner p {
    color: #555a63;
    font-size: 0.93rem;
    font-weight: 400;
    line-height: 2;
    padding: 0 22px 20px;
}

/* ------------------------------------------------------------
   الفوتر
   ------------------------------------------------------------ */
.site-footer {
    background: var(--dark);
    color: #ffffff;
}

.footer-inner {
    max-width: 1320px;
    margin-inline: auto;
    padding: 48px 28px 36px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 50%;
    padding: 3px;
}

.footer-brand span {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 26px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.footer-social a:hover {
    background: var(--primary-purple);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    padding: 18px 28px;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.85rem;
    font-weight: 400;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        text-align: center;
        padding: 40px 22px 30px;
    }

    .footer-links {
        justify-content: center;
        gap: 18px;
    }
}

/* ------------------------------------------------------------
   زر الواتساب العائم
   ------------------------------------------------------------ */
.wa-float {
    position: fixed;
    bottom: 22px;
    inset-inline-end: 22px;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wa-bubble {
    background: #ffffff;
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.14);
    text-align: start;
    transition: transform 0.25s ease;
}

.wa-bubble strong {
    display: block;
    color: var(--text-dark);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.5;
}

.wa-bubble small {
    color: #25d366;
    font-size: 0.76rem;
    font-weight: 700;
}

.wa-icon {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #25d366;
    color: #ffffff;
    font-size: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: waPulse 2.6s ease-out infinite;
    transition: transform 0.25s ease;
}

.wa-float:hover .wa-icon {
    transform: scale(1.08);
}

.wa-float:hover .wa-bubble {
    transform: translateY(-3px);
}

@keyframes waPulse {
    0%   { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(37, 211, 102, 0.4); }
    70%  { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 640px) {
    .wa-float {
        bottom: 16px;
        inset-inline-end: 16px;
    }

    .wa-bubble strong {
        font-size: 0.78rem;
    }

    .wa-bubble small {
        font-size: 0.7rem;
    }
}

/* ------------------------------------------------------------
   نافذة الفيديو المشتركة
   ------------------------------------------------------------ */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.video-modal.open {
    display: flex;
}

.video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 18, 0.85);
}

.video-modal-dialog {
    position: relative;
    z-index: 2;
    width: min(880px, 100%);
    animation: heroUp 0.35s ease both;
}

.video-modal-close {
    position: absolute;
    top: -44px;
    inset-inline-end: 0;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 6px;
}

.video-modal-body {
    aspect-ratio: 16 / 9;
    background: #000000;
    border-radius: 14px;
    overflow: hidden;
}

.video-modal-body iframe,
.video-modal-body video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ------------------------------------------------------------
   الريسبونسف
   ------------------------------------------------------------ */
/* شاشات متوسطة: تضييق المسافات وحجم الخط حتى تبقى الروابط السبعة في سطر واحد */
@media (max-width: 1240px) {
    .site-nav-inner {
        gap: 16px;
        padding-inline-start: 22px;
    }

    .nav-links {
        gap: 17px;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    .nav-brand span {
        font-size: 1.15rem;
    }

    .nav-brand img {
        width: 40px;
        height: 40px;
    }

    .nav-cta {
        font-size: 0.92rem;
        padding-inline: clamp(18px, 2.4vw, 30px);
    }

    .nav-lang {
        padding: 6px 10px;
        font-size: 0.82rem;
    }
}

@media (max-width: 920px) {
    .nav-cta {
        display: none;
    }

    .site-nav-inner {
        padding-inline-end: 22px;
    }

    .nav-burger {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        inset-inline: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: #ffffff;
        box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .nav-links.open {
        /* يتسع للروابط السبعة كاملة */
        max-height: 460px;
    }

    .nav-links a {
        padding: 15px 26px;
        border-top: 1px solid #f1f3f7;
    }

    .hero-inner {
        padding: 48px 22px;
        text-align: center;
    }

    .hero-title,
    .hero-subtitle {
        margin-inline: auto;
    }

    .hero-actions {
        justify-content: center;
    }

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

    .about-text {
        text-align: center;
    }

    .plans-grid {
        grid-template-columns: 1fr;
        max-width: 460px;
        margin-inline: auto;
        gap: 28px;
    }

    .section-inner {
        padding: 64px 22px;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        justify-content: center;
    }

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

/* ============================================================
   صفحتا «كل الكورسات» و«كل المدربين»

   الرئيسية تعرضهما في كاروسيل يمرّ: جيّد للتصفّح، سيّئ لمن يبحث عن واحد
   بعينه — لا يعرف كم بقي ولا يمسحها بالعين. هنا شبكة كاملة تُصفّى بمحورين.
   ============================================================ */
.page-head {
    background: linear-gradient(160deg, #f2f3fb, #ffffff 60%);
    border-bottom: 1px solid #eef0f5;
}

/* الشريط العلوي ثابت بارتفاع 84px، والهيرو في الرئيسية يزيحه بحشوة مثله.
   بدونها كان عنوان الصفحة يمرّ تحت الشريط ويُقصّ سطره الأول */
.page-head .section-inner { padding: calc(84px + 44px) 28px 40px; text-align: center; }
.page-head .section-title { margin-bottom: 10px; }
.page-head .section-text { margin-inline: auto; max-width: 60ch; }

.filter-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 18px;
}

.filter-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
}

.filter-label i { color: var(--primary-purple); font-size: 0.85rem; }

/* الشريط داخل صفّه لا وحده في سطر: العنوان يسبقه فيبقيان على خطّ واحد */
.filter-row .level-filter { margin-bottom: 0; justify-content: flex-start; }

/* شريط التصنيفات على الرئيسية يلي شريط المستويات مباشرةً */
.cat-filter { margin-top: -12px; }

.courses-count {
    text-align: center;
    margin: 6px 0 26px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
}

.courses-count [data-courses-shown],
.trainers-count [data-trainers-shown] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    margin-inline-end: 6px;
    border-radius: 13px;
    background: var(--primary-purple);
    color: #ffffff;
    font-weight: 700;
}

.courses-grid,
.trainers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 22px;
    align-items: start;
}

/* البطاقة في الشبكة تملأ عمودها: عرضها الثابت في الكاروسيل يترك فجوات هنا */
.courses-grid .course-card,
.trainers-grid .trainer-card { width: 100%; min-width: 0; }

.courses-empty,
.trainers-empty {
    text-align: center;
    padding: 46px 20px;
    color: var(--text-muted, #6b7280);
    font-size: 0.95rem;
}

.courses-empty i,
.trainers-empty i { color: var(--primary-purple); margin-inline-end: 8px; }

/* رابط الصفحة الكاملة أسفل كاروسيل الرئيسية */
.courses-more,
.trainers-more { text-align: center; margin-top: 28px; }
