
/* ==========================================================
   KALIMA WA QALAM — ALL COURSES
   Modern • Funky • Creative • Soft Color • RTL
   Unified page background | Responsive | Laravel Blade
========================================================== */

/* ==========================================================
   1. DESIGN SYSTEM & FULL PAGE BACKGROUND
========================================================== */

.all-courses-page {
    --course-ink: #164b61;
    --course-teal: #278c9b;
    --course-text: #536b73;
    --course-muted: #73848a;
    --course-white: #ffffff;

    --course-yellow: #d5a332;
    --course-yellow-soft: #fbf1d5;

    --course-blue: #4384a8;
    --course-blue-soft: #e7f1f8;

    --course-pink: #bd6681;
    --course-pink-soft: #f8e9ef;

    --course-green: #54885c;
    --course-green-soft: #eaf3e7;

    position: relative;
    isolation: isolate;
    min-height: 100vh;
    padding: 0 0 90px;
    direction: rtl;
    overflow: hidden;

    /* One continuous background for the entire page */
    background:
        radial-gradient(
            ellipse at 5% 28%,
            rgba(249, 222, 231, 0.58) 0,
            transparent 31%
        ),
        radial-gradient(
            ellipse at 95% 53%,
            rgba(208, 237, 232, 0.62) 0,
            transparent 30%
        ),
        radial-gradient(
            ellipse at 55% 92%,
            rgba(251, 239, 204, 0.50) 0,
            transparent 34%
        ),
        linear-gradient(
            135deg,
            #fbfaf5 0%,
            #f4f9f7 48%,
            #fbf7f2 100%
        );
}

/* Subtle decorative background shapes */
.all-courses-page::before,
.all-courses-page::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
}

.all-courses-page::before {
    width: 250px;
    height: 250px;
    top: 390px;
    right: -175px;
    border: 38px solid rgba(39, 140, 155, 0.07);
}

.all-courses-page::after {
    width: 210px;
    height: 210px;
    top: 940px;
    left: -145px;
    border: 32px solid rgba(189, 102, 129, 0.07);
}

.all-courses-page *,
.all-courses-page *::before,
.all-courses-page *::after {
    box-sizing: border-box;
}


/* ==========================================================
   2. HERO HEADER
========================================================== */

.all-courses-header {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    text-align: center;
    padding: 82px 24px 76px;
    background: transparent;
}

/* Soft decorative glow — blends into the page */
.all-courses-header::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 340px;
    height: 340px;
    top: -190px;
    right: calc(50% - 170px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.68);
    filter: blur(3px);
}

.all-courses-header::after {
    content: "✳";
    position: absolute;
    z-index: -1;
    left: 12%;
    bottom: 20px;
    color: rgba(213, 163, 50, 0.38);
    font-size: 66px;
    line-height: 1;
    transform: rotate(-14deg);
    animation: courses-sparkle 7s ease-in-out infinite;
}

.header-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    margin: 0 0 22px;
    padding: 10px 18px;

    color: #53608a;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(101, 83, 141, 0.13);
    border-radius: 14px 24px 14px 24px;

    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1px;

    box-shadow: 0 7px 22px rgba(22, 75, 97, 0.045);
}

.header-label i {
    color: var(--course-teal, #278c9b);
    font-size: 15px;
}

.all-courses-header h1 {
    position: relative;
    max-width: 900px;
    margin: 0 auto;

    color: #164b61;
    font-size: clamp(34px, 4.5vw, 54px);
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: -1.2px;
}

/* Colorful emphasis without changing the HTML */
.all-courses-header h1::after {
    content: "";
    display: block;
    width: 88px;
    height: 6px;
    margin: 17px auto 0;

    border-radius: 10px;
    background: linear-gradient(
        90deg,
        #d5a332 0%,
        #e7b9c8 48%,
        #278c9b 100%
    );

    transform: rotate(-1.5deg);
}

.all-courses-header p {
    max-width: 630px;
    margin: 22px auto 0;

    color: #63777e;
    font-size: 16px;
    font-weight: 500;
    line-height: 2;
}


/* ==========================================================
   3. FLOATING HEADER DECORATIONS
========================================================== */

.header-decoration {
    position: absolute;
    z-index: -1;
    pointer-events: none;
    transition: transform 0.5s ease;
}

.decoration-one {
    width: 170px;
    height: 170px;
    top: -68px;
    right: 5%;

    border-radius: 43% 57% 55% 45%;
    background: linear-gradient(
        145deg,
        rgba(248, 219, 228, 0.78),
        rgba(248, 219, 228, 0.18)
    );

    transform: rotate(18deg);
    animation: courses-float-one 9s ease-in-out infinite;
}

.decoration-two {
    width: 105px;
    height: 105px;
    bottom: 0;
    left: 9%;

    border: 18px solid rgba(39, 140, 155, 0.12);
    border-radius: 30px;
    background: rgba(217, 240, 239, 0.23);

    transform: rotate(-19deg);
    animation: courses-float-two 8s ease-in-out infinite;
}


/* ==========================================================
   4. MAIN CONTAINER
========================================================== */

.all-courses-container {
    position: relative;
    width: min(91%, 1220px);
    margin: 0 auto;
    padding-top: 10px;
}


/* ==========================================================
   5. COURSE COUNT
========================================================== */

.courses-count {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 7px;

    margin: 0 0 27px;
    padding: 0 3px;

    color: #687b82;
    font-size: 14px;
    font-weight: 700;
}

.courses-count span {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 34px;
    min-height: 34px;
    padding: 3px 10px;

    color: #176d73;
    background: #e1f1ed;
    border: 1px solid rgba(39, 140, 155, 0.12);
    border-radius: 12px 12px 12px 4px;

    font-size: 16px;
    font-weight: 900;
}


/* ==========================================================
   6. COURSES GRID
========================================================== */

.all-courses-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 28px;
}


/* ==========================================================
   7. COURSE CARD — PLAYFUL EDITORIAL DESIGN
========================================================== */

.all-course-card {
    --card-accent: #278c9b;
    --card-soft: #e7f4f1;
    --card-deep: #185e61;

    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;

    overflow: hidden;
    isolation: isolate;

    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(22, 75, 97, 0.075);
    border-radius: 25px 25px 25px 9px;

    box-shadow:
        0 7px 18px rgba(22, 75, 97, 0.045),
        0 22px 48px rgba(22, 75, 97, 0.035);

    transition:
        transform 0.32s ease,
        box-shadow 0.32s ease,
        border-radius 0.32s ease,
        border-color 0.32s ease;
}

/* Rotate through gentle accent palettes */
.all-course-card:nth-child(4n + 1) {
    --card-accent: #b68a25;
    --card-soft: #fbf1d8;
    --card-deep: #705314;
}

.all-course-card:nth-child(4n + 2) {
    --card-accent: #387da0;
    --card-soft: #e7f1f8;
    --card-deep: #285873;
}

.all-course-card:nth-child(4n + 3) {
    --card-accent: #bd6681;
    --card-soft: #f8eaf0;
    --card-deep: #78384f;
}

.all-course-card:nth-child(4n + 4) {
    --card-accent: #59885b;
    --card-soft: #eaf3e6;
    --card-deep: #315f38;
}

/* Colored accent strip */
.all-course-card::before {
    content: "";
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;

    width: 0;
    height: 5px;

    background: var(--card-accent);
    border-radius: 0 0 0 10px;

    transition: width 0.35s ease;
}

.all-course-card:hover {
    transform: translateY(-8px);
    border-color: color-mix(
        in srgb,
        var(--card-accent) 25%,
        transparent
    );
    border-radius: 25px 25px 10px 25px;

    box-shadow:
        0 14px 28px rgba(22, 75, 97, 0.075),
        0 28px 58px rgba(22, 75, 97, 0.075);
}

.all-course-card:hover::before {
    width: 100%;
}


/* ==========================================================
   8. COURSE IMAGE
========================================================== */

.all-course-image {
    position: relative;
    height: 225px;
    flex-shrink: 0;

    overflow: hidden;
    isolation: isolate;

    background: var(--card-soft);
}

.all-course-image::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    z-index: 1;
    pointer-events: none;

    background: linear-gradient(
        to bottom,
        transparent,
        rgba(15, 44, 55, 0.16)
    );
}

.all-course-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition:
        transform 0.65s cubic-bezier(0.2, 0.7, 0.25, 1),
        filter 0.4s ease;
}

.all-course-card:hover .all-course-image img {
    transform: scale(1.07);
    filter: saturate(1.06);
}


/* ==========================================================
   9. PATH BADGE
========================================================== */

.course-path-badge {
    position: absolute;
    z-index: 2;
    top: 15px;
    right: 15px;

    display: inline-flex;
    align-items: center;
    gap: 6px;

    max-width: calc(100% - 30px);
    padding: 9px 13px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #164b61;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 12px 12px 12px 4px;

    font-size: 11px;
    font-weight: 850;
    line-height: 1.4;

    box-shadow: 0 5px 18px rgba(16, 48, 59, 0.09);
    backdrop-filter: blur(10px);
}


/* ==========================================================
   10. IMAGE PLACEHOLDER
========================================================== */

.course-image-placeholder {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;
    overflow: hidden;

    color: var(--card-accent);
    background:
        radial-gradient(
            circle at 50% 40%,
            rgba(255, 255, 255, 0.9) 0,
            transparent 43%
        ),
        var(--card-soft);
}

.course-image-placeholder::before,
.course-image-placeholder::after {
    content: "";
    position: absolute;
    border: 1px solid currentColor;
    opacity: 0.12;
    pointer-events: none;
}

.course-image-placeholder::before {
    width: 155px;
    height: 155px;
    border-radius: 50%;
}

.course-image-placeholder::after {
    width: 95px;
    height: 95px;
    border-radius: 26px;
    transform: rotate(28deg);
}

.course-image-placeholder i {
    position: relative;
    z-index: 1;

    display: grid;
    place-items: center;

    width: 90px;
    height: 90px;

    color: var(--card-accent);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 28px 28px 28px 10px;

    font-size: 38px;
    box-shadow: 0 12px 30px rgba(22, 75, 97, 0.06);

    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.all-course-card:hover .course-image-placeholder i {
    transform: rotate(0deg) scale(1.06);
}


/* ==========================================================
   11. COURSE CONTENT
========================================================== */

.all-course-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;

    padding: 24px 23px 22px;
}

.course-category {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    margin: 0 0 11px;
    padding: 6px 10px;

    color: var(--card-deep);
    background: var(--card-soft);
    border-radius: 9px 9px 9px 3px;

    font-size: 11px;
    font-weight: 850;
    line-height: 1.5;
}

.all-course-content h2 {
    width: 100%;
    margin: 0;

    color: #164b61;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.65;
    overflow-wrap: anywhere;

    transition: color 0.25s ease;
}

.all-course-card:hover .all-course-content h2 {
    color: var(--card-deep);
}

.all-course-content p {
    width: 100%;
    margin: 12px 0 20px;

    color: #687a80;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.95;

    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ==========================================================
   12. CARD FOOTER & DETAILS BUTTON
========================================================== */

.course-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;

    width: 100%;
    margin-top: auto;
    padding-top: 17px;

    border-top: 1px solid rgba(22, 75, 97, 0.075);
}

.course-details-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 43px;
    max-width: 100%;
    padding: 11px 17px;

    color: #ffffff;
    background: var(--card-accent);
    border: 1px solid transparent;
    border-radius: 13px 13px 13px 5px;

    font-size: 12px;
    font-weight: 850;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;

    box-shadow: 0 5px 13px color-mix(
        in srgb,
        var(--card-accent) 17%,
        transparent
    );

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.course-details-button i {
    font-size: 12px;
    transition: transform 0.25s ease;
}

.course-details-button:hover {
    color: #ffffff;
    background: var(--card-deep);
    transform: translateY(-2px);

    box-shadow: 0 8px 18px color-mix(
        in srgb,
        var(--card-accent) 23%,
        transparent
    );
}

.course-details-button:hover i {
    transform: translateX(-3px);
}

.course-details-button:focus-visible {
    outline: 3px solid var(--card-accent);
    outline-offset: 4px;
}


/* ==========================================================
   13. EMPTY STATE
========================================================== */

.empty-courses {
    position: relative;
    isolation: isolate;
    overflow: hidden;

    max-width: 760px;
    margin: 25px auto 0;
    padding: 65px 25px;

    text-align: center;

    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(22, 75, 97, 0.08);
    border-radius: 30px 30px 30px 10px;

    box-shadow: 0 18px 45px rgba(22, 75, 97, 0.045);
}

.empty-courses::before {
    content: "";
    position: absolute;
    z-index: -1;

    width: 180px;
    height: 180px;
    top: -100px;
    right: -65px;

    background: rgba(217, 240, 239, 0.7);
    border-radius: 50%;
}

.empty-courses i {
    display: grid;
    place-items: center;

    width: 94px;
    height: 94px;
    margin: 0 auto 22px;

    color: #278c9b;
    background: #e7f4f1;
    border-radius: 28px 28px 28px 9px;

    font-size: 42px;
    transform: rotate(-5deg);
}

.empty-courses h2 {
    margin: 0 0 12px;

    color: #164b61;
    font-size: 25px;
    font-weight: 900;
    line-height: 1.6;
}

.empty-courses p {
    max-width: 480px;
    margin: 0 auto;

    color: #687a80;
    font-size: 14px;
    line-height: 1.9;
}


/* ==========================================================
   14. ANIMATIONS
========================================================== */

@keyframes courses-float-one {
    0%,
    100% {
        transform: translateY(0) rotate(18deg);
    }

    50% {
        transform: translateY(13px) rotate(24deg);
    }
}

@keyframes courses-float-two {
    0%,
    100% {
        transform: translateY(0) rotate(-19deg);
    }

    50% {
        transform: translateY(-10px) rotate(-11deg);
    }
}

@keyframes courses-sparkle {
    0%,
    100% {
        transform: rotate(-14deg) scale(1);
        opacity: 0.75;
    }

    50% {
        transform: rotate(8deg) scale(1.1);
        opacity: 1;
    }
}


/* ==========================================================
   15. TABLET
========================================================== */

@media (max-width: 1000px) {
    .all-courses-container {
        width: 92%;
    }

    .all-courses-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 23px;
    }

    .all-courses-header {
        padding-top: 70px;
        padding-bottom: 65px;
    }

    .all-course-image {
        height: 220px;
    }

    .all-course-content {
        padding: 22px;
    }
}


/* ==========================================================
   16. MOBILE
========================================================== */

@media (max-width: 620px) {
    .all-courses-page {
        padding-bottom: 60px;
    }

    .all-courses-header {
        padding: 52px 20px 43px;
    }

    .all-courses-header::after {
        left: 4%;
        bottom: 5px;
        font-size: 43px;
    }

    .decoration-one {
        width: 115px;
        height: 115px;
        top: -52px;
        right: -25px;
    }

    .decoration-two {
        width: 78px;
        height: 78px;
        left: -8px;
        bottom: 0;
        border-width: 13px;
        border-radius: 23px;
    }

    .header-label {
        gap: 7px;
        margin-bottom: 17px;
        padding: 9px 13px;
        font-size: 11px;
    }

    .all-courses-header h1 {
        font-size: clamp(29px, 8vw, 38px);
        line-height: 1.5;
        letter-spacing: -0.5px;
    }

    .all-courses-header h1::after {
        width: 68px;
        height: 5px;
        margin-top: 13px;
    }

    .all-courses-header p {
        max-width: 420px;
        margin-top: 17px;
        font-size: 13px;
        line-height: 1.95;
    }

    .all-courses-container {
        width: calc(100% - 32px);
        padding-top: 13px;
    }

    .courses-count {
        margin-bottom: 19px;
        font-size: 13px;
    }

    .all-courses-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 21px;
    }

    .all-course-card {
        border-radius: 22px 22px 22px 8px;
    }

    .all-course-card:hover {
        transform: translateY(-3px);
    }

    .all-course-image {
        height: clamp(190px, 56vw, 245px);
    }

    .course-path-badge {
        top: 12px;
        right: 12px;
        padding: 8px 11px;
        font-size: 10px;
    }

    .all-course-content {
        padding: 21px 19px 19px;
    }

    .all-course-content h2 {
        font-size: 19px;
    }

    .all-course-content p {
        margin-top: 10px;
        margin-bottom: 17px;
        font-size: 13px;
    }

    .course-card-footer {
        padding-top: 15px;
    }

    .course-details-button {
        min-height: 42px;
        padding: 10px 15px;
    }

    .empty-courses {
        padding: 48px 20px;
        border-radius: 24px 24px 24px 8px;
    }

    .empty-courses i {
        width: 80px;
        height: 80px;
        font-size: 35px;
    }

    .empty-courses h2 {
        font-size: 21px;
    }

    .empty-courses p {
        font-size: 13px;
    }
}


/* ==========================================================
   17. SMALL MOBILE
========================================================== */

@media (max-width: 360px) {
    .all-courses-container {
        width: calc(100% - 24px);
    }

    .all-courses-header {
        padding-right: 14px;
        padding-left: 14px;
    }

    .all-courses-header h1 {
        font-size: 28px;
    }

    .all-course-image {
        height: 180px;
    }

    .all-course-content {
        padding: 18px 16px;
    }

    .all-course-content h2 {
        font-size: 18px;
    }
}


/* ==========================================================
   18. ACCESSIBILITY — REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {
    .all-courses-page *,
    .all-courses-page *::before,
    .all-courses-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
