
.courses-page {
    --navy: #173e50;
    --navy-deep: #123444;
    --teal: #258b8c;
    --teal-deep: #176d73;
    --text: #355463;
    --muted: #657b84;

    --cream: #fffdf7;
    --paper: #ffffff;
    --line: #e3eae5;

    --yellow: #f0d58d;
    --yellow-deep: #94701f;
    --green: #a8c69b;
    --purple: #b9add9;
    --pink: #dfabb9;
    --blue: #a9cbe0;

    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 100%;
    overflow: clip;
    background:
        radial-gradient(
            ellipse at 5% 8%,
            rgba(240, 220, 157, 0.20),
            transparent 26%
        ),
        radial-gradient(
            ellipse at 95% 24%,
            rgba(159, 205, 190, 0.22),
            transparent 28%
        ),
        radial-gradient(
            ellipse at 12% 60%,
            rgba(198, 183, 225, 0.15),
            transparent 26%
        ),
        radial-gradient(
            ellipse at 94% 82%,
            rgba(237, 190, 199, 0.16),
            transparent 25%
        ),
        linear-gradient(160deg, #fffdf8 0%, #f8fbf8 48%, #f7faf9 100%);
    color: var(--text);
    font-family: "Cairo", sans-serif;
    font-size: 17px;
    line-height: 1.85;
    direction: rtl;
}

.courses-page *,
.courses-page *::before,
.courses-page *::after {
    box-sizing: border-box;
}

.courses-page a {
    color: inherit;
    text-decoration: none;
}

.courses-page img {
    max-width: 100%;
}

.courses-page a:focus-visible {
    outline: 3px solid #278c9b;
    outline-offset: 5px;
    border-radius: 8px;
}

.courses-page .paths-section,
.courses-page .suggested-section,
.courses-page .learning-cta {
    width: min(1280px, calc(100% - 64px));
    margin-inline: auto;
}


/* =========================================================
   2. SHARED DECORATIVE ATMOSPHERE
========================================================= */

.courses-page .paths-section,
.courses-page .suggested-section {
    position: relative;
    z-index: 1;
}

.courses-page .paths-section::before,
.courses-page .suggested-section::before {
    position: absolute;
    z-index: -1;
    width: 74px;
    height: 74px;
    border: 2px solid rgba(37, 139, 140, 0.13);
    border-radius: 38% 62% 55% 45% / 50% 42% 58% 50%;
    content: "";
    pointer-events: none;
    animation: courses-orbit 12s ease-in-out infinite;
}

.courses-page .paths-section::before {
    top: 20px;
    left: 2%;
    transform: rotate(18deg);
}

.courses-page .suggested-section::before {
    top: 15px;
    right: 1%;
    width: 53px;
    height: 53px;
    border-color: rgba(190, 151, 65, 0.2);
    animation-delay: -5s;
}


/* =========================================================
   3. SECTION HEADINGS
========================================================= */

.paths-section {
    margin-top: 42px;
    margin-bottom: 88px;
}

.section-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.section-header > div:first-child {
    min-width: 0;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 7px;
    color: var(--teal-deep);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.35px;
}

.section-label::before {
    width: 23px;
    height: 4px;
    border-radius: 10px;
    background: #e3c46f;
    content: "";
}

.section-header h1,
.section-header h2 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(30px, 3vw, 39px);
    font-weight: 900;
    line-height: 1.5;
    letter-spacing: -0.6px;
}

.section-header p {
    max-width: 760px;
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.95;
}

.section-header-icon {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border: 2px solid #fffdf8;
    border-radius: 24px 19px 25px 18px;
    background: #e8f4ee;
    color: #258b8c;
    font-size: 29px;
    box-shadow:
        0 0 0 2px #cfe4d8,
        0 8px 0 rgba(37, 139, 140, 0.06);
    transform: rotate(-5deg);
    transition:
        transform 0.3s ease,
        background 0.3s ease,
        box-shadow 0.3s ease;
}

.section-header:hover .section-header-icon {
    background: #dcefe5;
    box-shadow:
        0 0 0 2px #bfdccf,
        0 12px 22px rgba(37, 139, 140, 0.11);
    transform: rotate(4deg) translateY(-3px);
}


/* =========================================================
   4. LEARNING PATHS GRID
========================================================= */

.paths-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 25px;
}

.path-card {
    --path-color: #287c9b;
    --path-light: #f5faf9;
    --path-border: #d6e7e5;
    --path-title: #173e50;

    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 345px;
    padding: 25px;
    overflow: hidden;

    border: 1.5px solid var(--path-border);
    border-radius: 29px 24px 31px 23px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.98),
            var(--path-light)
        );

    box-shadow:
        0 5px 0 rgba(255, 255, 255, 0.85),
        0 8px 20px rgba(29, 69, 76, 0.055);

    animation: courses-card-enter 0.55s both;
    animation-delay: calc(var(--card-index, 0) * 55ms);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}


/* Remove the large decorative shape from every learning path card */
.courses-page .path-card::before,
.courses-page .path-card:hover::before {
    content: none !important;
    display: none !important;
}


.path-card::after {
    position: absolute;
    right: 24px;
    bottom: 82px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--path-color);
    content: "";
    opacity: 0.32;
    box-shadow:
        16px 8px 0 -2px var(--path-color),
        8px 22px 0 -3px var(--path-color);
    pointer-events: none;
}

.path-card:hover {
    z-index: 2;
    border-color: var(--path-color);
    box-shadow:
        0 5px 0 rgba(255, 255, 255, 0.85),
        0 17px 34px rgba(29, 69, 76, 0.11);
    transform: translateY(-6px);
}

.path-card:hover::before {
    opacity: 0.16;
    transform: scale(1.12) rotate(12deg);
}

.path-card-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.path-number {
    color: var(--path-color);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 1.3px;
}

.path-arrow {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    border: 1px solid var(--path-border);
    border-radius: 13px;
    background: #fffefa;
    color: var(--path-color);
    font-size: 16px;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.path-card:hover .path-arrow {
    background: var(--path-color);
    color: #ffffff;
    transform: translate(-3px, -3px);
}

.path-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    margin-top: 18px;
    border: 2px solid #fffefa;
    border-radius: 22px 18px 23px 17px;
    background: var(--path-light);
    color: var(--path-color);
    font-size: 29px;
    box-shadow:
        0 0 0 1px var(--path-border),
        0 6px 12px rgba(35, 75, 90, 0.045);
    transition:
        transform 0.35s ease,
        border-radius 0.35s ease;
}

.path-card:hover .path-icon {
    border-radius: 50%;
    transform: rotate(-7deg) scale(1.05);
}

.path-card-content {
    position: relative;
    z-index: 1;
    flex: 1;
    margin-top: 17px;
}

.path-card h2 {
    margin: 0;
    color: var(--path-title);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.path-card-content p {
    margin: 9px 0 19px;
    color: #536d77;
    font-size: 16px;
    line-height: 1.95;
}

.path-card-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--path-border);
}


/* ==========================================================
   PATH COURSE COUNT — PLAYFUL MINI BADGE
========================================================== */

.courses-page .path-card .path-course-count {
    position: relative;
    isolation: isolate;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    flex-shrink: 0;
    min-height: 34px;
    padding: 6px 11px;

    color: var(--path-ink);
    background: var(--path-badge);

    border: 1.5px dashed
        color-mix(in srgb, var(--path-accent) 45%, white);

    border-radius: 11px 15px 10px 14px;

    font-size: 12px;
    font-weight: 900;
    line-height: 1.4;
    white-space: nowrap;

    box-shadow:
        0 3px 0
        color-mix(in srgb, var(--path-accent) 13%, white);

    transform: rotate(-2deg);

    transition:
        transform 0.28s ease,
        background-color 0.28s ease,
        box-shadow 0.28s ease;
}

/* Tiny decorative sparkle */
.courses-page .path-card .path-course-count::before {
    content: "✳";

    position: absolute;
    top: -9px;
    right: -6px;

    color: var(--path-accent);
    font-size: 12px;
    line-height: 1;

    transform: rotate(12deg);
    pointer-events: none;
}

/* Small accent dot */
.courses-page .path-card .path-course-count::after {
    content: "";

    position: absolute;
    bottom: -4px;
    left: 7px;

    width: 7px;
    height: 7px;

    background: var(--path-accent);
    border: 2px solid var(--path-light);
    border-radius: 50%;

    pointer-events: none;
}

.courses-page .path-card .path-course-count i {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--path-accent);
    font-size: 14px;

    transition: transform 0.28s ease;
}

/* Playful movement on hover */
.courses-page .path-card:hover .path-course-count,
.courses-page .path-card:focus-visible .path-course-count {
    background: #ffffff;
    transform: rotate(0deg) translateY(-2px);

    box-shadow:
        0 5px 0
        color-mix(in srgb, var(--path-accent) 17%, white);
}

.courses-page .path-card:hover .path-course-count i,
.courses-page .path-card:focus-visible .path-course-count i {
    transform: rotate(-12deg) scale(1.12);
}

/* Compact badge on small screens */
@media (max-width: 650px) {
    .courses-page .path-card .path-course-count {
        min-height: 32px;
        padding: 5px 9px;
        font-size: 11px;
    }
}


.path-explore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--path-color);
    font-size: 15px;
    font-weight: 900;
    transition: gap 0.25s ease;
}

.path-card:hover .path-explore {
    gap: 12px;
}


/* =========================================================
   5. PATH COLOR PALETTE
========================================================= */

.path-yellow {
    --path-color: #a9822d;
    --path-light: #fffaf0;
    --path-border: #eadbb8;
    --path-title: #57461d;
}

.path-teal {
    --path-color: #258b87;
    --path-light: #f1f9f6;
    --path-border: #cfe7de;
    --path-title: #185c5b;
}

.path-blue {
    --path-color: #397da5;
    --path-light: #f1f7fc;
    --path-border: #d2e4f0;
    --path-title: #285773;
}

.path-purple {
    --path-color: #7965a7;
    --path-light: #f8f5fc;
    --path-border: #e2d9ef;
    --path-title: #50416e;
}

.path-pink {
    --path-color: #b65e79;
    --path-light: #fff6f7;
    --path-border: #efd6dc;
    --path-title: #793c50;
}

.path-green {
    --path-color: #58834f;
    --path-light: #f4f9f0;
    --path-border: #d9e7d1;
    --path-title: #355b32;
}


/* =========================================================
   6. ALL COURSES BUTTON
========================================================= */

.all-courses-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.all-courses-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    min-height: 56px;
    padding: 12px 29px;
    border: 2px solid var(--navy);
    border-radius: 15px 19px 15px 19px;
    background: var(--navy);
    color: #ffffff !important;
    font-size: 17px;
    font-weight: 900;
    box-shadow: 0 5px 0 #dbe7df;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.all-courses-button:hover {
    background: #ffffff;
    color: var(--navy) !important;
    box-shadow: 0 7px 0 #dbe7df;
    transform: translateY(-3px);
}

.all-courses-button i {
    transition: transform 0.25s ease;
}

.all-courses-button:hover i {
    transform: translateX(-4px);
}

/* ==========================================
   FEATURED COURSE CARDS — FIXED INTERACTION
========================================== */

.suggested-card {
    --course-accent: #65538d;

    position: relative;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    overflow: hidden;
    min-width: 0;
    min-height: 330px;
    padding: 22px;
    border: 1px solid rgba(48, 66, 76, 0.10);
    border-radius: 25px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(35, 59, 68, 0.07);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.suggested-card.course-purple {
    --course-accent: #65538d;
    background: linear-gradient(145deg, #fbf8ff 0%, #f1ebfa 100%);
}

.suggested-card.course-orange {
    --course-accent: #b96c32;
    background: linear-gradient(145deg, #fffaf3 0%, #f9eddd 100%);
}

.suggested-card.course-green {
    --course-accent: #397b60;
    background: linear-gradient(145deg, #f7fcf8 0%, #e9f4ec 100%);
}

.suggested-card::before,
.suggested-card::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
    opacity: 0.45;
}

.suggested-card::before {
    width: 150px;
    height: 150px;
    top: -75px;
    left: -55px;
    border: 1px solid var(--course-accent);
    opacity: 0.15;
}

.suggested-card::after {
    width: 95px;
    height: 95px;
    right: -45px;
    bottom: 45px;
    background: var(--course-accent);
    opacity: 0.045;
}

/* Hide the image area without hiding the path label or the button. */

.suggested-card .suggested-image-link,
.suggested-card .suggested-image,
.suggested-card .suggested-image img,
.suggested-card .course-image-fallback,
.suggested-card .course-image-icon {
    display: none !important;
}

/* Path name: always visible at the top. */

.suggested-card .course-category {
    position: relative;
    z-index: 2;
    display: inline-flex !important;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 16px;
    padding: 8px 12px;
    border: 1px solid rgba(70, 90, 100, 0.10);
    border-right: 3px solid var(--course-accent);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--course-accent);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.7;
    white-space: normal;
    overflow-wrap: anywhere;
}

.suggested-card .course-category i {
    flex: 0 0 auto;
}

/* Content occupies the flexible middle of the card. */

.suggested-card .suggested-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 8px 0 18px;
}

/* Keep metadata readable. */

.suggested-card .course-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 12px;
    color: #536b73;
    font-size: 0.8rem;
    line-height: 1.7;
}

.suggested-card .course-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.suggested-card .course-meta i {
    color: var(--course-accent);
}

/* Title begins around the middle of the card. */

.suggested-card .suggested-content h3 {
    margin: 0;
    color: #263f4b;
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    font-weight: 800;
    line-height: 1.8;
    text-align: center;
    overflow-wrap: anywhere;
    transform: translateY(20px);
    transition:
        transform 0.35s ease,
        text-align 0.35s ease;
}

.suggested-card .suggested-content h3 a {
    color: inherit;
    text-decoration: none;
}

.suggested-card .suggested-content h3 a:hover {
    color: var(--course-accent);
}

/* Description appears on hover and keyboard focus. */

.suggested-card .suggested-content > p {
    max-height: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    color: #536b73;
    font-size: 0.92rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
    transform: translateY(8px);
    transition:
        max-height 0.4s ease,
        margin 0.3s ease,
        opacity 0.3s ease,
        transform 0.3s ease;
}

.suggested-card:hover .suggested-content h3,
.suggested-card:focus-within .suggested-content h3 {
    text-align: right;
    transform: translateY(0);
}

.suggested-card:hover .suggested-content > p,
.suggested-card:focus-within .suggested-content > p {
    max-height: 180px;
    margin-top: 10px;
    opacity: 1;
    transform: translateY(0);
}

/* The discover button remains visible at the bottom. */

.suggested-card .course-details-link {
    position: relative;
    z-index: 3;
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    margin-top: auto;
    padding: 11px 15px;
    border: 1px solid var(--course-accent);
    border-radius: 13px;
    background: var(--course-accent);
    color: #fff !important;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.5;
    text-decoration: none;
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.suggested-card .course-details-link:hover {
    background: #fff;
    color: var(--course-accent) !important;
    transform: translateY(-2px);
}

.suggested-card .course-details-link i {
    flex: 0 0 auto;
    transition: transform 0.25s ease;
}

.suggested-card .course-details-link:hover i {
    transform: translateX(-4px);
}

.suggested-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 34px rgba(35, 59, 68, 0.12);
}

/* Responsive layout */

@media (max-width: 1000px) {
    .suggested-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .suggested-card {
        min-height: 320px;
    }
}

@media (max-width: 620px) {
    .suggested-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .suggested-card {
        min-height: 0;
        padding: 19px;
    }

    .suggested-card .suggested-content {
        padding: 5px 0 16px;
    }

    .suggested-card .suggested-content h3 {
        text-align: right;
        transform: none;
    }

    .suggested-card .suggested-content > p {
        max-height: none;
        margin-top: 10px;
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .suggested-card,
    .suggested-card *,
    .suggested-card::before,
    .suggested-card::after {
        transition: none !important;
        animation: none !important;
    }
}


/* =========================================================
   8. EMPTY STATE
========================================================= */

.empty-state {
    position: relative;
    padding: 50px 25px;
    overflow: hidden;
    border: 2px dashed #cfe2da;
    border-radius: 27px;
    background: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.empty-state::before,
.empty-state::after {
    position: absolute;
    width: 75px;
    height: 75px;
    border: 13px solid #dceee4;
    border-radius: 50%;
    content: "";
    opacity: 0.55;
    pointer-events: none;
}

.empty-state::before {
    top: -35px;
    left: -25px;
}

.empty-state::after {
    right: -25px;
    bottom: -35px;
    border-color: #eee4c8;
}

.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    border: 2px solid #fffefa;
    border-radius: 25px 20px 25px 20px;
    background: #e8f4ec;
    color: var(--teal);
    font-size: 33px;
    box-shadow: 0 0 0 1px #cfe5d6;
    transform: rotate(-4deg);
}

.empty-state h2 {
    margin: 0;
    color: var(--navy);
    font-size: 24px;
    font-weight: 900;
}

.empty-state p {
    max-width: 600px;
    margin: 11px auto 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.95;
}


/* =========================================================
   9. CLOSING CALL TO ACTION
========================================================= */

.learning-cta {
    position: relative;
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 65px;
    padding: 35px 38px;
    overflow: hidden;
    isolation: isolate;

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 29px;

    background:
        radial-gradient(
            circle at 5% 110%,
            rgba(116, 202, 191, 0.22),
            transparent 35%
        ),
        linear-gradient(115deg, #173e50 0%, #205f70 60%, #287c83 100%);

    color: #ffffff;
    box-shadow: 0 12px 28px rgba(23, 62, 80, 0.12);
}

.learning-cta::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    background:
        radial-gradient(
            circle at 95% 0%,
            rgba(255, 219, 145, 0.19),
            transparent 28%
        );
    content: "";
}

.cta-decoration {
    position: absolute;
    z-index: -1;
    border: 18px solid rgba(255, 255, 255, 0.07);
    border-radius: 44% 56% 50% 50%;
    pointer-events: none;
    animation: courses-orbit 15s ease-in-out infinite;
}

.cta-decoration-one {
    top: -65px;
    left: 23%;
    width: 170px;
    height: 170px;
}

.cta-decoration-two {
    right: -50px;
    bottom: -80px;
    width: 200px;
    height: 200px;
    animation-delay: -7s;
}

.cta-icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 73px;
    height: 73px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 23px 18px 24px 18px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffe09a;
    font-size: 31px;
    transform: rotate(-5deg);
}

.cta-content {
    flex: 1;
    min-width: 0;
}

.cta-content h2 {
    margin: 0;
    color: #ffffff;
    font-size: 27px;
    font-weight: 900;
    line-height: 1.6;
}

.cta-content p {
    max-width: 700px;
    margin: 7px 0 0;
    color: #e4f0f1;
    font-size: 16px;
    line-height: 1.95;
}

.cta-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 55px;
    padding: 12px 21px;
    border: 2px solid #ffe09a;
    border-radius: 14px 18px 14px 18px;
    background: #ffe09a;
    color: #173e50 !important;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 5px 0 rgba(15, 43, 52, 0.12);
    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.cta-button:hover {
    background: transparent;
    color: #ffe09a !important;
    transform: translateY(-3px);
}


/* =========================================================
   10. ANIMATIONS
========================================================= */

@keyframes courses-card-enter {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes courses-orbit {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-9px) rotate(9deg);
    }
}


/* =========================================================
   11. TABLETS AND SMALL LAPTOPS
========================================================= */

@media (max-width: 1050px) {
    .courses-page .paths-section,
    .courses-page .suggested-section,
    .courses-page .learning-cta {
        width: calc(100% - 44px);
        max-width: 900px;
    }

    .paths-grid,
    .suggested-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 21px;
    }

    .path-card {
        min-height: 325px;
    }

    .suggested-image {
        height: 215px;
    }

    .learning-cta {
        flex-wrap: wrap;
    }

    .cta-content {
        flex: 1 1 calc(100% - 110px);
    }

    .cta-button {
        margin-right: 98px;
    }
}


/* =========================================================
   12. MOBILE
========================================================= */

@media (max-width: 700px) {
    .courses-page {
        font-size: 16px;
    }

    .courses-page .paths-section,
    .courses-page .suggested-section,
    .courses-page .learning-cta {
        width: calc(100% - 32px);
    }

    .paths-section {
        margin-top: 28px;
        margin-bottom: 60px;
    }

    .suggested-section {
        margin-bottom: 55px;
    }

    .courses-page .paths-section::before,
    .courses-page .suggested-section::before {
        width: 42px;
        height: 42px;
        border-width: 1.5px;
    }

    .section-header {
        align-items: flex-start;
        gap: 13px;
        margin-bottom: 24px;
    }

    .section-label {
        gap: 7px;
        font-size: 14px;
    }

    .section-label::before {
        width: 18px;
    }

    .section-header h1,
    .section-header h2 {
        font-size: 28px;
        line-height: 1.55;
        letter-spacing: -0.3px;
    }

    .section-header p {
        margin-top: 7px;
        font-size: 16px;
        line-height: 1.9;
    }

    .section-header-icon {
        width: 49px;
        height: 49px;
        border-radius: 16px;
        font-size: 21px;
    }

    .paths-grid,
    .suggested-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 19px;
    }

    .path-card {
        min-height: 0;
        padding: 22px;
        border-radius: 25px 21px 26px 21px;
    }

    .path-icon {
        width: 63px;
        height: 63px;
        margin-top: 15px;
        font-size: 27px;
    }

    .path-card h2 {
        font-size: 21px;
    }

    .path-card-content p {
        font-size: 16px;
        line-height: 1.9;
    }

    .path-course-count,
    .path-explore {
        font-size: 14px;
    }

    .path-card-footer {
        align-items: center;
        gap: 10px;
    }

    .all-courses-wrapper {
        margin-top: 25px;
    }

    .all-courses-button {
        width: 100%;
        min-height: 54px;
        padding: 12px 16px;
        font-size: 16px;
    }

    .suggested-image {
        height: 225px;
    }

    .suggested-content {
        padding: 20px;
    }

    .suggested-content h3 {
        font-size: 21px;
    }

    .suggested-content > p {
        font-size: 16px;
        line-height: 1.9;
    }

    .course-meta {
        gap: 8px 13px;
    }

    .course-meta span {
        font-size: 13px;
    }

    .course-details-link {
        font-size: 15px;
    }

    .featured-all-link {
        margin-top: 24px;
    }

    .featured-all-link a {
        width: 100%;
        min-height: 49px;
        padding: 11px 15px;
        font-size: 15px;
    }

    .empty-state {
        padding: 37px 18px;
        border-radius: 23px;
    }

    .empty-state-icon {
        width: 68px;
        height: 68px;
        font-size: 29px;
    }

    .empty-state h2 {
        font-size: 21px;
    }

    .empty-state p {
        font-size: 16px;
    }

    .learning-cta {
        flex-direction: column;
        align-items: flex-start;
        gap: 17px;
        margin-bottom: 42px;
        padding: 25px 21px;
        border-radius: 24px;
    }

    .cta-icon {
        width: 59px;
        height: 59px;
        border-radius: 19px;
        font-size: 26px;
    }

    .cta-content {
        width: 100%;
    }

    .cta-content h2 {
        font-size: 23px;
    }

    .cta-content p {
        font-size: 15px;
        line-height: 1.9;
    }

    .cta-button {
        width: 100%;
        min-height: 53px;
        margin-right: 0;
        font-size: 15px;
    }
}


/* =========================================================
   13. VERY SMALL PHONES
========================================================= */

@media (max-width: 380px) {
    .courses-page .paths-section,
    .courses-page .suggested-section,
    .courses-page .learning-cta {
        width: calc(100% - 24px);
    }

    .section-header h1,
    .section-header h2 {
        font-size: 25px;
    }

    .section-header-icon {
        width: 43px;
        height: 43px;
        font-size: 18px;
    }

    .path-card {
        padding: 18px;
    }

    .path-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .suggested-image {
        height: 195px;
    }

    .suggested-content {
        padding: 18px;
    }
}


/* =========================================================
   14. ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .courses-page *,
    .courses-page *::before,
    .courses-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================
   PATHS HEADING — DISTINCT SOLID DECORATIVE SHAPE
========================================================== */

.paths-section h2 {
    display: block !important;
    width: fit-content !important;
    max-width: calc(100% - 36px);
    box-sizing: border-box;

    margin: 0 auto 28px !important;
    padding: 17px 34px !important;

    /* Its own solid background */
    background: #e5f1eb !important;
    background-image: none !important;

    /* Clearly defined shape */
    border: 2px solid #8fb9a6 !important;
    border-radius: 24px 24px 24px 6px !important;

    /* Decorative outline effect */
    box-shadow: 5px 5px 0 #c8ded1 !important;

    color: #173e50 !important;
    font-size: clamp(21px, 2.4vw, 29px) !important;
    font-weight: 800 !important;
    line-height: 1.6 !important;
    text-align: center;
}

/* Smaller screens */
@media (max-width: 600px) {
    .paths-section h2 {
        padding: 13px 19px !important;
        font-size: 20px !important;
        border-radius: 19px 19px 19px 5px !important;
    }
}

/* ==========================================================
   HOMEPAGE — SOLID RECTANGLE TITLE BACKGROUNDS
========================================================== */

/* Title 1: Discover your learning path */
.paths-section h2 {
    display: table !important;
    width: fit-content !important;
    max-width: calc(100% - 30px);
    box-sizing: border-box;

    margin: 0 auto 28px !important;
    padding: 14px 28px !important;

    background: #eaf3e7 !important;
    background-image: none !important;

    border: 2px solid #b5cdae !important;
    border-radius: 12px !important;
    box-shadow: 4px 4px 0 #d7e5d0 !important;

    color: #173e50 !important;
    text-align: center;
    font-weight: 800 !important;
    line-height: 1.6;
}

/* Title 2: Learn in a way that opens horizons */
.features-section h2 {
    display: table !important;
    width: fit-content !important;
    max-width: calc(100% - 30px);
    box-sizing: border-box;

    margin: 0 auto 28px !important;
    padding: 14px 28px !important;

    background: #fff5dc !important;
    background-image: none !important;

    border: 2px solid #e5d19b !important;
    border-radius: 12px !important;
    box-shadow: 4px 4px 0 #f0e4c3 !important;

    color: #173e50 !important;
    text-align: center;
    font-weight: 800 !important;
    line-height: 1.6;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .paths-section h2,
    .features-section h2 {
        max-width: calc(100% - 24px);
        padding: 11px 16px !important;
        font-size: 20px !important;
    }
}

/* ==========================================================
   KALIMA WA QALAM — PROFESSIONAL COURSES REDESIGN
   Compact • Creative • Rich Colors • Premium Educational UI
   Arabic RTL • Responsive
========================================================== */

/* ----------------------------------------------------------
   1. COLOR SYSTEM
---------------------------------------------------------- */

.courses-page {
    --navy: #173e50;
    --navy-deep: #102f40;
    --teal: #168b87;
    --teal-deep: #126b6b;
    --text: #344f5b;
    --muted: #657b85;

    --yellow: #e9bd52;
    --green: #57966c;
    --purple: #8067bb;
    --pink: #ce6885;
    --blue: #428bb8;
    --orange: #d68a42;

    background:
        radial-gradient(
            ellipse at 8% 12%,
            rgba(234, 190, 82, 0.13),
            transparent 30%
        ),
        radial-gradient(
            ellipse at 92% 30%,
            rgba(48, 161, 145, 0.12),
            transparent 32%
        ),
        radial-gradient(
            ellipse at 10% 75%,
            rgba(132, 105, 190, 0.09),
            transparent 28%
        ),
        linear-gradient(155deg, #fffdf8 0%, #f5faf8 55%, #f9f7fc 100%);
}

/* ----------------------------------------------------------
   2. SECTION SPACING
---------------------------------------------------------- */

.courses-page .paths-section,
.courses-page .suggested-section {
    width: min(1160px, calc(100% - 64px));
}

.courses-page .paths-section {
    margin-top: 32px;
    margin-bottom: 65px;
}

.courses-page .suggested-section {
    margin-bottom: 62px;
}

.courses-page .section-header {
    margin-bottom: 25px;
    gap: 18px;
}

.courses-page .section-header h1,
.courses-page .section-header h2 {
    color: #173e50;
    font-size: clamp(26px, 2.5vw, 34px);
    font-weight: 900;
    letter-spacing: -0.5px;
}

.courses-page .section-label {
    color: #147b76;
    font-size: 14px;
}

.courses-page .section-header-icon {
    width: 61px;
    height: 61px;
    border-radius: 19px 15px 20px 15px;
    background: #dff2e9;
    color: #168b87;
    box-shadow:
        0 0 0 2px #c2e3d4,
        0 6px 0 rgba(22, 139, 135, 0.08);
}

/* ----------------------------------------------------------
   3. LEARNING PATHS — SMALLER, MORE DISTINCTIVE CARDS
---------------------------------------------------------- */

.courses-page .paths-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 19px;
    align-items: stretch;
}

.courses-page .path-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    padding: 21px 21px 18px;
    overflow: hidden;

    border: 1.5px solid var(--path-border);
    border-radius: 23px 18px 23px 18px;

    background: var(--path-light);

    box-shadow:
        0 3px 0 rgba(255, 255, 255, 0.95),
        0 7px 18px rgba(25, 58, 73, 0.065);

    animation-delay: calc(var(--card-index, 0) * 45ms);

    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease;
}


/* Small decorative circles */
.courses-page .path-card::after {
    right: auto;
    bottom: 22px;
    left: 21px;
    width: 7px;
    height: 7px;
    background: var(--path-color);
    opacity: 0.65;

    box-shadow:
        -12px 10px 0 -2px var(--path-color),
        -1px 17px 0 -3px var(--path-color);
}

.courses-page .path-card:hover::before {
    width: 8px;
    opacity: 1;
    transform: none;
}

.courses-page .path-card-top {
    gap: 10px;
}

.courses-page .path-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 35px;
    height: 27px;
    padding: 2px 9px;

    border-radius: 8px;
    background: var(--path-badge);
    color: var(--path-color);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.7px;
}

.courses-page .path-arrow {
    width: 33px;
    height: 33px;
    border: 1px solid var(--path-border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--path-color);
    font-size: 14px;
}

.courses-page .path-card:hover .path-arrow {
    background: var(--path-color);
    color: #fff;
    transform: translate(-2px, -2px);
}

/* Icon tile */
.courses-page .path-icon {
    width: 57px;
    height: 57px;
    margin-top: 16px;

    border: 0;
    border-radius: 17px 13px 18px 13px;
    background: var(--path-icon-bg);
    color: var(--path-color);
    font-size: 25px;

    box-shadow: inset 0 0 0 1px var(--path-border);

    transition:
        transform 0.3s ease,
        border-radius 0.3s ease;
}

.courses-page .path-card:hover .path-icon {
    border-radius: 19px;
    transform: rotate(-6deg) scale(1.06);
}

/* IMPORTANT: isolate card titles from section headings */
.courses-page .path-card h2 {
    margin: 0;
    color: var(--path-title) !important;
    font-size: 19px !important;
    font-weight: 900;
    line-height: 1.65;
    letter-spacing: -0.2px;
    overflow-wrap: anywhere;
}

.courses-page .path-card-content {
    margin-top: 13px;
}

.courses-page .path-card-content p {
    margin: 7px 0 15px;
    color: #4d6570;
    font-size: 14.5px;
    line-height: 1.85;
}

.courses-page .path-card-footer {
    gap: 10px;
    padding-top: 13px;
    border-top: 1px solid var(--path-border);
}

.courses-page .path-course-count {
    gap: 6px;
    color: #4b626c;
    font-size: 13px;
    font-weight: 800;
}

.courses-page .path-course-count i {
    color: var(--path-color);
}

.courses-page .path-explore {
    gap: 6px;
    color: var(--path-color);
    font-size: 13px;
    font-weight: 900;
}

.courses-page .path-card:hover .path-explore {
    gap: 9px;
}

/* ----------------------------------------------------------
   4. RICHER COLOR PALETTE FOR LEARNING PATHS
---------------------------------------------------------- */

.courses-page .path-yellow {
    --path-color: #a87516;
    --path-light: #fff9e9;
    --path-border: #eddaa5;
    --path-title: #66480f;
    --path-badge: #f9e9b8;
    --path-icon-bg: #f8e7ae;
}

.courses-page .path-teal {
    --path-color: #137d75;
    --path-light: #eff9f4;
    --path-border: #c2e4d5;
    --path-title: #15594f;
    --path-badge: #d7f0e4;
    --path-icon-bg: #d8efe4;
}

.courses-page .path-blue {
    --path-color: #2c72a1;
    --path-light: #f0f7fd;
    --path-border: #c8e0f1;
    --path-title: #245574;
    --path-badge: #dcecf9;
    --path-icon-bg: #d9ebf8;
}

.courses-page .path-purple {
    --path-color: #7653a8;
    --path-light: #f7f2fc;
    --path-border: #ded0f0;
    --path-title: #503873;
    --path-badge: #e9def8;
    --path-icon-bg: #e9ddf7;
}

.courses-page .path-pink {
    --path-color: #b7476b;
    --path-light: #fff3f5;
    --path-border: #efced9;
    --path-title: #79334b;
    --path-badge: #f8dfe7;
    --path-icon-bg: #f7dfe6;
}

.courses-page .path-green {
    --path-color: #477e3e;
    --path-light: #f2f8ed;
    --path-border: #d2e5c7;
    --path-title: #31582b;
    --path-badge: #e0efd6;
    --path-icon-bg: #dfefd5;
}

/* ----------------------------------------------------------
   5. ALL COURSES BUTTON
---------------------------------------------------------- */

.courses-page .all-courses-wrapper {
    margin-top: 27px;
}

.courses-page .all-courses-button {
    min-height: 49px;
    padding: 10px 24px;
    border: 2px solid #173e50;
    border-radius: 13px 16px 13px 16px;
    background: #173e50;
    box-shadow: 0 4px 0 #d3e5dc;
    font-size: 15px;
}

.courses-page .all-courses-button:hover {
    background: #fff;
    color: #173e50 !important;
    transform: translateY(-2px);
}

/* ----------------------------------------------------------
   6. FEATURED COURSES — COMPACT EDITORIAL CARDS
---------------------------------------------------------- */

.courses-page .suggested-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.courses-page .suggested-card {
    border: 1px solid var(--course-border);
    border-radius: 22px 17px 22px 17px;
    background: #fffefa;

    box-shadow:
        0 4px 0 rgba(255, 255, 255, 0.9),
        0 7px 19px rgba(26, 66, 83, 0.065);

    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease;
}

.courses-page .suggested-card:hover {
    border-color: var(--course-accent);
    box-shadow:
        0 4px 0 rgba(255, 255, 255, 0.9),
        0 14px 28px rgba(26, 66, 83, 0.12);
    transform: translateY(-5px);
}

/* Shorter images reduce overall card height */
.courses-page .suggested-image {
    height: 175px;
    background: var(--course-soft);
}

.courses-page .course-category {
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    border: 1px solid var(--course-border);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--course-accent);
    font-size: 12px;
}

.courses-page .course-image-icon {
    bottom: 11px;
    left: 11px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #fff;
    color: var(--course-accent);
    font-size: 18px;
}

.courses-page .suggested-content {
    padding: 18px;
}

.courses-page .course-meta {
    gap: 7px 12px;
    margin-bottom: 9px;
}

.courses-page .course-meta span {
    font-size: 12px;
}

.courses-page .suggested-content h3 {
    color: #173e50;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.65;
}

.courses-page .suggested-content > p {
    margin: 8px 0 15px;
    color: #536b75;
    font-size: 14px;
    line-height: 1.85;
}

.courses-page .course-details-link {
    gap: 9px;
    padding-top: 12px;
    font-size: 14px;
}

.courses-page .course-purple {
    --course-accent: #7653a8;
    --course-soft: #f3ebfb;
    --course-border: #e0d0f0;
}

.courses-page .course-orange {
    --course-accent: #a96922;
    --course-soft: #fff1dc;
    --course-border: #ecd4b2;
}

.courses-page .course-green {
    --course-accent: #477e3e;
    --course-soft: #eaf5e4;
    --course-border: #d0e4c6;
}

.courses-page .featured-all-link {
    margin-top: 25px;
}

.courses-page .featured-all-link a {
    min-height: 46px;
    padding: 10px 20px;
    border-radius: 12px;
    background: #edf7f0;
    border-color: #cde5d6;
    font-size: 14px;
}

.courses-page .featured-all-link a:hover {
    background: #dff0e5;
    border-color: #9fcdb1;
}

/* ----------------------------------------------------------
   7. CLOSING CTA — CLEANER AND MORE PREMIUM
---------------------------------------------------------- */

.courses-page .learning-cta {
    gap: 22px;
    padding: 29px 32px;
    border-radius: 24px;
    background:
        radial-gradient(
            circle at 8% 100%,
            rgba(95, 211, 177, 0.20),
            transparent 35%
        ),
        linear-gradient(115deg, #15394c 0%, #176c70 100%);
    box-shadow: 0 10px 26px rgba(23, 62, 80, 0.14);
}

.courses-page .cta-icon {
    width: 63px;
    height: 63px;
    border-radius: 19px;
    font-size: 27px;
}

.courses-page .cta-content h2 {
    font-size: 24px;
}

.courses-page .cta-content p {
    font-size: 14.5px;
}

.courses-page .cta-button {
    min-height: 48px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
}

/* ----------------------------------------------------------
   8. SECTION HEADINGS — KEEP THEM DISTINCT
---------------------------------------------------------- */

/*
   Prevent the decorative section-heading rules from
   unintentionally changing every path-card title.
*/

.courses-page .paths-section > .section-header h1,
.courses-page .paths-section > .section-header h2,
.courses-page .suggested-section > .section-header h1,
.courses-page .suggested-section > .section-header h2 {
    display: block;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: #173e50;
    text-align: right;
}

/* ----------------------------------------------------------
   9. TABLETS
---------------------------------------------------------- */

@media (max-width: 1050px) {
    .courses-page .paths-section,
    .courses-page .suggested-section,
    .courses-page .learning-cta {
        width: calc(100% - 44px);
        max-width: 900px;
    }

    .courses-page .paths-grid,
    .courses-page .suggested-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .courses-page .path-card {
        padding: 19px;
    }

    .courses-page .suggested-image {
        height: 180px;
    }

    .courses-page .learning-cta {
        flex-wrap: wrap;
    }

    .courses-page .cta-content {
        flex: 1 1 calc(100% - 100px);
    }

    .courses-page .cta-button {
        margin-right: 85px;
    }
}

/* ----------------------------------------------------------
   10. MOBILE
---------------------------------------------------------- */

@media (max-width: 700px) {
    .courses-page .paths-section,
    .courses-page .suggested-section,
    .courses-page .learning-cta {
        width: calc(100% - 30px);
    }

    .courses-page .paths-section {
        margin-top: 24px;
        margin-bottom: 48px;
    }

    .courses-page .suggested-section {
        margin-bottom: 45px;
    }

    .courses-page .section-header {
        gap: 12px;
        margin-bottom: 20px;
    }

    .courses-page .section-header h1,
    .courses-page .section-header h2 {
        font-size: 25px;
        line-height: 1.6;
    }

    .courses-page .section-header p {
        font-size: 14px;
    }

    .courses-page .section-header-icon {
        flex: 0 0 auto;
        width: 45px;
        height: 45px;
        border-radius: 14px;
        font-size: 19px;
    }

    .courses-page .paths-grid,
    .courses-page .suggested-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 15px;
    }

    .courses-page .path-card {
        padding: 19px;
        border-radius: 20px 16px 20px 16px;
    }

    .courses-page .path-icon {
        width: 51px;
        height: 51px;
        margin-top: 13px;
        border-radius: 15px;
        font-size: 23px;
    }

    .courses-page .path-card-content {
        margin-top: 11px;
    }

    .courses-page .path-card h2 {
        font-size: 18px !important;
    }

    .courses-page .path-card-content p {
        margin-bottom: 13px;
        font-size: 14px;
    }

    .courses-page .path-card-footer {
        padding-top: 11px;
    }

    .courses-page .all-courses-button {
        width: 100%;
        min-height: 48px;
    }

    .courses-page .suggested-image {
        height: 195px;
    }

    .courses-page .suggested-content {
        padding: 17px;
    }

    .courses-page .suggested-content h3 {
        font-size: 18px;
    }

    .courses-page .suggested-content > p {
        font-size: 14px;
    }

    .courses-page .featured-all-link a {
        width: 100%;
    }

    .courses-page .learning-cta {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 23px 19px;
        border-radius: 20px;
    }

    .courses-page .cta-icon {
        width: 52px;
        height: 52px;
        font-size: 23px;
    }

    .courses-page .cta-content {
        width: 100%;
    }

    .courses-page .cta-content h2 {
        font-size: 21px;
    }

    .courses-page .cta-content p {
        font-size: 14px;
    }

    .courses-page .cta-button {
        width: 100%;
        margin-right: 0;
    }
}

/* ----------------------------------------------------------
   11. SMALL PHONES
---------------------------------------------------------- */

@media (max-width: 380px) {
    .courses-page .paths-section,
    .courses-page .suggested-section,
    .courses-page .learning-cta {
        width: calc(100% - 22px);
    }

    .courses-page .section-header h1,
    .courses-page .section-header h2 {
        font-size: 22px;
    }

    .courses-page .path-card {
        padding: 16px;
    }

    .courses-page .path-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .courses-page .suggested-image {
        height: 170px;
    }
}

/* ----------------------------------------------------------
   12. ACCESSIBILITY
---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .courses-page .path-card,
    .courses-page .suggested-card,
    .courses-page .path-icon,
    .courses-page .path-arrow,
    .courses-page .all-courses-button,
    .courses-page .cta-button {
        animation: none !important;
        transition: none !important;
    }
}

/* ==========================================================
   KALIMA WA QALAM — PLAYFUL INTERACTIVE PATH CARDS
   Organic decorations | Smooth title and description reveal
   Arabic RTL | Responsive | Footer always readable
========================================================== */


/* ==========================================================
   1. PATHS GRID
========================================================== */

.courses-page .paths-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
    width: 100%;
}


/* ==========================================================
   2. BASE CARD
========================================================== */

.courses-page .path-card {
    --path-accent: #258b8c;
    --path-light: #e8f5f1;
    --path-ink: #175b5b;

    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-width: 0;
    min-height: 290px;
    padding: 28px 24px 68px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;
    text-decoration: none;

    background: var(--path-light);

    border: 1px solid
        color-mix(in srgb, var(--path-accent) 24%, white);

    border-radius: 30px 30px 30px 17px;

    box-shadow:
        0 5px 0
            color-mix(in srgb, var(--path-accent) 10%, white),
        0 12px 28px rgba(35, 63, 72, 0.055);

    transition:
        transform 0.38s cubic-bezier(.2, .8, .2, 1),
        box-shadow 0.38s ease,
        background-color 0.35s ease,
        border-color 0.35s ease,
        border-radius 0.38s ease;
}


/* ==========================================================
   3. PASTEL COLORS
========================================================== */

.courses-page .path-card.path-yellow {
    --path-accent: #bd8618;
    --path-light: #fff2ce;
    --path-ink: #65470e;
}

.courses-page .path-card.path-teal {
    --path-accent: #16877f;
    --path-light: #dff3ed;
    --path-ink: #155a55;
}

.courses-page .path-card.path-blue {
    --path-accent: #397db4;
    --path-light: #e5f0fc;
    --path-ink: #294f76;
}

.courses-page .path-card.path-purple {
    --path-accent: #8062b6;
    --path-light: #eee8fa;
    --path-ink: #4e3a73;
}

.courses-page .path-card.path-pink {
    --path-accent: #c34d75;
    --path-light: #fbe6ed;
    --path-ink: #78334c;
}

.courses-page .path-card.path-green {
    --path-accent: #548747;
    --path-light: #e8f2df;
    --path-ink: #34582d;
}


/* ==========================================================
   4. ORGANIC BACKGROUND DECORATIONS
========================================================== */

.courses-page .path-card::before {
    content: "";
    position: absolute;
    z-index: -1;

    top: -48px;
    right: -43px;

    width: 155px;
    height: 125px;

    background: color-mix(
        in srgb,
        var(--path-accent) 16%,
        white
    );

    border-radius: 43% 57% 61% 39% / 48% 38% 62% 52%;

    transform: rotate(-18deg);

    transition:
        transform 0.6s ease,
        border-radius 0.5s ease,
        width 0.5s ease,
        height 0.5s ease;
}

.courses-page .path-card::after {
    content: "";
    position: absolute;
    z-index: -1;

    bottom: -35px;
    left: -22px;

    width: 78px;
    height: 78px;

    border: 2px solid
        color-mix(in srgb, var(--path-accent) 34%, white);

    border-radius: 48% 52% 40% 60%;

    transform: rotate(-25deg);

    transition:
        transform 0.55s ease,
        border-radius 0.55s ease,
        width 0.45s ease,
        height 0.45s ease;
}


/* ==========================================================
   5. HIDE LEGACY DECORATIONS
========================================================== */

.courses-page .path-card .path-card-top,
.courses-page .path-card .path-icon,
.courses-page .path-card .path-arrow,
.courses-page .path-card .path-number,
.courses-page .path-card .icon-wrapper,
.courses-page .path-card .path-card-icon {
    display: none !important;
}


/* ==========================================================
   6. CARD CONTENT
   Keep title and description in one predictable area.
========================================================== */

.courses-page .path-card .path-card-content {
    position: relative;
    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-width: 0;
    margin: 0;

    /* Reserve room at the bottom for the footer. */
    padding: 0 0 12px;
}


/* ==========================================================
   7. PLAYFUL TITLE
   No rectangular background or underline.
========================================================== */

.courses-page .path-card .path-card-content h2,
.courses-page .path-card .path-card-content h3,
.courses-page .path-card .path-card-content .path-title {
    position: relative;
    z-index: 2;
    isolation: isolate;

    display: block;

    width: fit-content;
    max-width: 100%;
    margin: 0;

    padding: 9px 8px 12px;

    color: var(--path-ink);
    font-family: inherit;

    font-size: clamp(19px, 1.55vw, 23px);
    font-weight: 900;
    line-height: 1.65;
    letter-spacing: -0.4px;
    text-align: center;

    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    transform: translateY(0) rotate(0deg);

    transition:
        transform 0.42s cubic-bezier(.2, .8, .2, 1),
        color 0.3s ease;
}


/* Floating sparkle */

.courses-page .path-card .path-card-content h2::before,
.courses-page .path-card .path-card-content h3::before,
.courses-page .path-card .path-card-content .path-title::before {
    content: "✳";

    position: absolute;
    z-index: 3;

    top: -8px;
    right: -12px;

    color: var(--path-accent);
    font-size: 17px;
    line-height: 1;

    background: none;
    border: none;

    transform: rotate(-12deg);

    transition: transform 0.4s ease;
}


/* Small floating oval */

.courses-page .path-card .path-card-content h2::after,
.courses-page .path-card .path-card-content h3::after,
.courses-page .path-card .path-card-content .path-title::after {
    content: "";

    position: absolute;
    z-index: -1;

    top: 12px;
    left: -12px;

    width: 9px;
    height: 16px;

    background: color-mix(
        in srgb,
        var(--path-accent) 70%,
        white
    );

    border-radius: 50%;

    transform: rotate(-35deg);

    transition: transform 0.4s ease;
}


/* ==========================================================
   8. DESCRIPTION — POSITIONED HIGHER
   The description now sits immediately below the title.
========================================================== */

.courses-page .path-card .path-card-content p,
.courses-page .path-card .path-card-content .path-description {
    position: relative;
    z-index: 2;

    display: block;

    width: 100%;
    max-width: 330px;

    margin: 0;
    padding: 0 4px;

    color: var(--path-ink);

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.85;
    text-align: center;

    /* Hidden without removing its layout space. */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    max-height: 0;
    overflow: hidden;

    transform: translateY(8px);

    transition:
        opacity 0.28s ease,
        transform 0.35s ease,
        max-height 0.35s ease,
        margin 0.35s ease,
        visibility 0.28s ease;
}


/* ==========================================================
   9. FOOTER — FIXED AT THE BOTTOM
   The description can never overlap these links.
========================================================== */

.courses-page .path-card .path-card-footer {
    position: absolute;
    z-index: 4;

    right: 20px;
    bottom: 17px;
    left: 20px;

    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
    width: auto;
    min-width: 0;
    margin: 0;
    padding-top: 12px;

    border-top: 1px solid
        color-mix(in srgb, var(--path-accent) 20%, transparent);

    color: var(--path-ink);
    font-size: 12px;
    line-height: 1.5;

    transition:
        border-color 0.3s ease,
        opacity 0.3s ease;
}


/* Course count */

.courses-page .path-card .path-course-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    flex-shrink: 0;

    color: var(--path-ink);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.courses-page .path-card .path-course-count i {
    color: var(--path-accent);
    font-size: 13px;
}


/* Explore link */

.courses-page .path-card .path-explore {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;

    min-width: 0;

    color: var(--path-ink);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;

    transition:
        gap 0.25s ease,
        color 0.25s ease;
}

.courses-page .path-card .path-explore i {
    font-size: 12px;
    transition: transform 0.25s ease;
}


/* ==========================================================
   10. HOVER — MOVE TITLE UP, REVEAL DESCRIPTION
========================================================== */

.courses-page .path-card:hover,
.courses-page .path-card:focus-visible {
    transform: translateY(-6px) rotate(-0.3deg);

    border-color: color-mix(
        in srgb,
        var(--path-accent) 60%,
        white
    );

    border-radius: 24px 34px 22px 32px;

    background: color-mix(
        in srgb,
        var(--path-light) 92%,
        white
    );

    box-shadow:
        0 7px 0
            color-mix(in srgb, var(--path-accent) 14%, white),
        0 19px 35px
            color-mix(in srgb, var(--path-accent) 14%, transparent);
}


/* Organic shapes animate */

.courses-page .path-card:hover::before,
.courses-page .path-card:focus-visible::before {
    width: 175px;
    height: 145px;

    border-radius: 60% 40% 34% 66% / 42% 58% 42% 58%;

    transform: translate(-7px, 8px) rotate(8deg);
}

.courses-page .path-card:hover::after,
.courses-page .path-card:focus-visible::after {
    width: 92px;
    height: 92px;

    border-radius: 60% 40% 56% 44%;

    transform: translate(7px, -9px) rotate(12deg);
}


/* Move title up slightly — no large jump */

.courses-page .path-card:hover .path-card-content h2,
.courses-page .path-card:hover .path-card-content h3,
.courses-page .path-card:hover .path-card-content .path-title,
.courses-page .path-card:focus-visible .path-card-content h2,
.courses-page .path-card:focus-visible .path-card-content h3,
.courses-page .path-card:focus-visible .path-card-content .path-title {
    transform: translateY(-10px) rotate(-0.6deg);
}


/* Sparkle animation */

.courses-page .path-card:hover .path-card-content h2::before,
.courses-page .path-card:hover .path-card-content h3::before,
.courses-page .path-card:hover .path-card-content .path-title::before,
.courses-page .path-card:focus-visible .path-card-content h2::before,
.courses-page .path-card:focus-visible .path-card-content h3::before,
.courses-page .path-card:focus-visible .path-card-content .path-title::before {
    transform: translate(2px, -4px) rotate(55deg) scale(1.2);
}


/* Oval animation */

.courses-page .path-card:hover .path-card-content h2::after,
.courses-page .path-card:hover .path-card-content h3::after,
.courses-page .path-card:hover .path-card-content .path-title::after,
.courses-page .path-card:focus-visible .path-card-content h2::after,
.courses-page .path-card:focus-visible .path-card-content h3::after,
.courses-page .path-card:focus-visible .path-card-content .path-title::after {
    transform: translate(-2px, -3px) rotate(20deg) scale(1.2);
}


/* Reveal description directly below the title */

.courses-page .path-card:hover .path-card-content p,
.courses-page .path-card:hover .path-card-content .path-description,
.courses-page .path-card:focus-visible .path-card-content p,
.courses-page .path-card:focus-visible .path-card-content .path-description {
    margin-top: 0;

    max-height: 115px;

    opacity: 1;
    visibility: visible;
    transform: translateY(-5px);

    transition-delay: 0.04s;
}


/* Footer stays visible and readable */

.courses-page .path-card:hover .path-card-footer,
.courses-page .path-card:focus-visible .path-card-footer {
    border-top-color: color-mix(
        in srgb,
        var(--path-accent) 30%,
        transparent
    );
}

.courses-page .path-card:hover .path-explore,
.courses-page .path-card:focus-visible .path-explore {
    gap: 9px;
}

.courses-page .path-card:hover .path-explore i,
.courses-page .path-card:focus-visible .path-explore i {
    transform: translateX(-3px);
}


/* ==========================================================
   11. MEDIUM SCREENS
========================================================== */

@media (max-width: 1050px) {
    .courses-page .paths-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .courses-page .path-card {
        min-height: 285px;
    }

    .courses-page .path-card .path-card-content h2,
    .courses-page .path-card .path-card-content h3,
    .courses-page .path-card .path-card-content .path-title {
        font-size: 21px;
    }
}


/* ==========================================================
   12. SMALL SCREENS
========================================================== */

@media (max-width: 650px) {
    .courses-page .paths-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 17px;
    }

    .courses-page .path-card {
        min-height: 255px;
        padding: 25px 20px 67px;

        border-radius: 25px 25px 25px 15px;
    }

    .courses-page .path-card .path-card-content h2,
    .courses-page .path-card .path-card-content h3,
    .courses-page .path-card .path-card-content .path-title {
        font-size: 20px;
    }

    .courses-page .path-card .path-card-content p,
    .courses-page .path-card .path-card-content .path-description {
        max-width: 100%;
        font-size: 13px;
        line-height: 1.8;
    }

    .courses-page .path-card .path-card-footer {
        right: 16px;
        left: 16px;
        bottom: 15px;
        gap: 6px;
    }

    .courses-page .path-card .path-course-count,
    .courses-page .path-card .path-explore {
        font-size: 11px;
    }
}


/* ==========================================================
   13. TOUCH DEVICES
   Show descriptions without requiring hover.
========================================================== */

@media (hover: none) {
    .courses-page .path-card {
        min-height: 255px;
    }

    .courses-page .path-card .path-card-content {
        padding-bottom: 8px;
    }

    .courses-page .path-card .path-card-content p,
    .courses-page .path-card .path-card-content .path-description {
        position: relative;

        max-height: none;
        overflow: visible;

        margin-top: 10px;
        padding-bottom: 0;

        opacity: 1;
        visibility: visible;
        transform: none;

        pointer-events: auto;
    }

    .courses-page .path-card:hover .path-card-content h2,
    .courses-page .path-card:hover .path-card-content h3,
    .courses-page .path-card:hover .path-card-content .path-title,
    .courses-page .path-card:focus-visible .path-card-content h2,
    .courses-page .path-card:focus-visible .path-card-content h3,
    .courses-page .path-card:focus-visible .path-card-content .path-title {
        transform: none;
    }

    .courses-page .path-card:hover,
    .courses-page .path-card:focus-visible {
        transform: none;
    }
}


/* ==========================================================
   14. ACCESSIBILITY
========================================================== */

@media (prefers-reduced-motion: reduce) {
    .courses-page .path-card,
    .courses-page .path-card *,
    .courses-page .path-card::before,
    .courses-page .path-card::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================
   FIX: RESTORE VERTICAL COURSE CARDS
   Keep the original grid layout
========================================== */

/* Preserve the existing grid columns and spacing */
.suggested-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    align-items: stretch;
}

/* Keep each course card vertical */
.suggested-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 330px;
    box-sizing: border-box;
}

/* Keep the course path name at the top */
.suggested-card .course-category {
    display: inline-flex !important;
    align-self: flex-start;
    order: 0;
    margin-bottom: 14px;
}

/* Keep the course information in the middle */
.suggested-card .suggested-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    order: 1;
}

/* Keep the discover button at the bottom */
.suggested-card .course-details-link {
    display: flex !important;
    order: 2;
    width: 100%;
    margin-top: auto;
}

/* Two columns on tablets */
@media (max-width: 1000px) {
    .suggested-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* One card per row on mobile */
@media (max-width: 620px) {
    .suggested-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .suggested-card {
        min-height: 0;
    }
}
/* ==========================================
   FORCE HOVER GROWTH — FEATURED COURSE CARDS
========================================== */

/* Allow the hovered card to grow outside its own boundaries */
.suggested-section,
.suggested-grid {
    overflow: visible !important;
}

/* Normal card state */
.suggested-grid .suggested-card {
    position: relative;
    z-index: 1;
    transform: scale(1) !important;
    transform-origin: center center;
    transition:
        transform 350ms ease,
        box-shadow 350ms ease !important;
    will-change: transform;
}

/* ONLY the card under the mouse grows */
.suggested-grid .suggested-card:hover {
    z-index: 20;
    transform: scale(1.06) !important;
    box-shadow: 0 18px 38px rgba(35, 59, 68, 0.20) !important;
}

/* Keep every other card at its original size */
.suggested-grid:hover .suggested-card:not(:hover) {
    transform: scale(1) !important;
}

/* Preserve the existing title and description interaction */
.suggested-grid .suggested-card:hover .suggested-content h3 {
    transform: translateY(0);
    text-align: right;
}

.suggested-grid .suggested-card:hover .suggested-content > p {
    max-height: 180px;
    margin-top: 10px;
    opacity: 1;
    transform: translateY(0);
}

/* Mobile: don't scale cards on touchscreens */
@media (max-width: 620px) {
    .suggested-grid .suggested-card:hover {
        transform: none !important;
    }
}

/* Accessible motion */
@media (prefers-reduced-motion: reduce) {
    .suggested-grid .suggested-card {
        transition: none !important;
    }
}

/* Connect the courses background to the navbar and footer */

html,
body {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    background: #f8fbf8;
}

.courses-page {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove unwanted space above and below the main page */
main.courses-page {
    display: flow-root;
}

/* Avoid an extra gap before the footer */
footer {
    margin-top: 0 !important;
}

/* ==========================================================
   ACADEMY BRAND — CLEAN, PLAYFUL & POLISHED
   Minimal colors | Balanced shapes | Arabic RTL | Responsive
========================================================== */

.courses-brand {
    --brand-ink: #164b61;
    --brand-teal: #278c9b;
    --brand-yellow: #f5c957;

    position: relative;
    isolation: isolate;

    display: flex;
    align-items: center;
    justify-content: center;

    width: fit-content;
    max-width: calc(100% - 32px);

    margin: 12px auto 38px;
    padding: 20px 42px 22px;

    direction: rtl;
    text-align: center;
}

/* Main content */
.courses-brand-inner {
    position: relative;
    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Small label */
.brand-mini-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 10px;
    padding: 5px 14px;

    color: var(--brand-ink);
    background: #fff8df;

    border: 1px solid rgba(22, 75, 97, 0.09);
    border-radius: 30px;

    font-family: 'Cairo', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.brand-mini-label::before {
    content: "";
    width: 7px;
    height: 7px;

    background: var(--brand-teal);
    border-radius: 50%;
}

/* Academy name */
.courses-brand-name {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;

    font-family: 'Cairo', sans-serif;
    font-size: clamp(29px, 3.8vw, 45px);
    font-weight: 1000;
    line-height: 1.6;
    letter-spacing: -0.8px;
}

.brand-word-academy {
    color: var(--brand-ink);
}

/* Signature teal word */
.brand-word-kalima {
    position: relative;
    display: inline-block;

    padding: 0 12px;

    color: #fff;
    background: var(--brand-teal);

    border-radius: 10px 4px 10px 4px;
    box-shadow: 3px 4px 0 var(--brand-yellow);

    transform: rotate(-2deg);

    transition:
        transform 220ms ease,
        box-shadow 220ms ease;
}

/* Online word */
.brand-word-online {
    position: relative;
    display: inline-block;

    color: var(--brand-ink);
}

/* One neat accent underline */
.brand-word-online::after {
    content: "";
    position: absolute;

    right: 2px;
    bottom: 5px;
    left: 2px;

    height: 5px;

    background: var(--brand-yellow);
    border-radius: 99px;

    z-index: -1;
}

/* Tagline */
.brand-tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    margin-top: 12px;

    color: #536b73;

    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.brand-tagline-line {
    width: 20px;
    height: 2px;

    background: var(--brand-teal);
    border-radius: 99px;
}

.brand-tagline-line:last-child {
    background: var(--brand-yellow);
}

/* Minimal decorative accents */
.brand-confetti {
    position: absolute;
    z-index: 1;

    pointer-events: none;
    line-height: 1;
}

/* Keep one small sparkle only */
.brand-confetti-one {
    top: 14px;
    right: 7%;

    color: var(--brand-yellow);
    font-size: 23px;

    animation: brandSparkle 3s ease-in-out infinite;
}

/* Hide extra decorations to keep the design clean */
.brand-confetti-two,
.brand-confetti-three,
.brand-floating-shape {
    display: none !important;
}

/* Subtle hover interaction */
@media (hover: hover) {
    .courses-brand:hover .brand-word-kalima {
        transform: rotate(0deg) translateY(-3px);
        box-shadow: 3px 7px 0 var(--brand-yellow);
    }
}

/* Gentle animation */
@keyframes brandSparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.75;
    }

    50% {
        transform: scale(1.12) rotate(12deg);
        opacity: 1;
    }
}

/* Tablet and mobile */
@media (max-width: 600px) {
    .courses-brand {
        max-width: calc(100% - 20px);
        margin: 10px auto 28px;
        padding: 17px 8px 18px;
    }

    .courses-brand-name {
        gap: 6px;
        font-size: clamp(23px, 6.2vw, 34px);
        letter-spacing: 0;
    }

    .brand-word-kalima {
        padding: 0 9px;
        border-radius: 8px 4px 8px 4px;
        box-shadow: 2px 3px 0 var(--brand-yellow);
    }

    .brand-mini-label {
        margin-bottom: 9px;
        padding: 5px 11px;
        font-size: 10px;
    }

    .brand-tagline {
        gap: 7px;
        margin-top: 10px;
        font-size: 10px;
    }

    .brand-tagline-line {
        width: 14px;
    }

    .brand-confetti-one {
        top: 8px;
        right: 2%;
        font-size: 18px;
    }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .brand-confetti-one {
        animation: none !important;
    }

    .brand-word-kalima {
        transition: none !important;
    }
}
