
/* =========================================================
   QUALDIGIIN - PREMIUM COMMON COURSE SCROLLER
   File: public/css/course-scroller.css
   ========================================================= */

.course-section,
.course-section * {
    box-sizing: border-box;
}

.course-section {
    --course-primary: #155eef;
    --course-navy: #101c3d;
    --course-text: #26334d;
    --course-muted: #68758b;

    width: 100%;
    padding: 42px 20px 30px;
    overflow: hidden;
    background: linear-gradient(180deg, #f4f8ff 0%, #fff 100%);
    font-family: inherit;
}

/* ===================== CENTERED ANIMATED HEADING ===================== */

.course-section .course-section-heading {
    position: relative;
    display: block;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto 24px;
}

.course-section .course-heading-content {
    width: 100%;
    min-width: 0;
    text-align: center;
    animation: courseHeadingReveal .85s ease both;
}

.course-section .course-small-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 9px 18px;
    border: 1px solid #c7d2fe;
    border-radius: 50px;
    background: linear-gradient(110deg, #eff6ff, #f5f3ff, #fdf2f8);
    color: #4338ca;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 5px 18px rgba(79, 70, 229, .09);
}

.course-section .heading-label-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #ec4899;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, .12);
    animation: headingDotPulse 1.8s ease-in-out infinite;
}

.course-section .course-heading-content h2 {
    margin: 0 auto 14px;
    color: var(--course-navy);
    font-size: clamp(27px, 3.2vw, 42px);
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: -.8px;
}

.course-section .heading-gradient-text {
    display: inline-block;
    color: #5145cd;
    background: linear-gradient(
        90deg,
        #2563eb 0%,
        #7c3aed 35%,
        #db2777 68%,
        #2563eb 100%
    );
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: headingGradientFlow 5s linear infinite;
}

.course-section .course-heading-content p {
    max-width: 680px;
    margin: 0 auto;
    color: var(--course-muted);
    font-size: 15px;
    line-height: 1.8;
}

.course-section .heading-bottom-line {
    position: relative;
    width: 90px;
    height: 4px;
    margin: 20px auto 0;
    overflow: hidden;
    border-radius: 10px;
    background: #e0e7ff;
}

.course-section .heading-bottom-line::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #a855f7, #ec4899);
    animation: headingLineMove 2.5s ease-in-out infinite alternate;
}

/* Navigation arrows stay at the right on desktop */

.course-section .course-scroll-controls {
    position: absolute;
    top: 50%;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(-50%);
}

.course-section .course-arrow-btn {
    display: inline-flex;
    width: 43px;
    height: 43px;
    align-items: center;
    justify-content: center;
    border: 1px solid #dce6f7;
    border-radius: 50%;
    background: #fff;
    color: var(--course-navy);
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(16, 28, 61, .07);
    transition: background .25s ease, color .25s ease,
                transform .25s ease, box-shadow .25s ease;
}

.course-section .course-arrow-btn:hover {
    background: var(--course-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(21, 94, 239, .23);
}

/* ===================== HORIZONTAL SCROLLER ===================== */

.course-section .course-scroller {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 3px 22px;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.course-section .course-scroller::-webkit-scrollbar {
    display: none;
}

.course-section .course-track {
    display: flex;
    align-items: stretch;
    gap: 22px;
    width: max-content;
    min-width: 100%;
}

.course-section .course-slide {
    display: flex;
    flex: 0 0 300px;
    width: 300px;
    min-width: 0;
    scroll-snap-align: start;
}

/* ===================== COURSE CARD ===================== */

.course-section .modern-course-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e9eef7;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(20, 39, 76, .07);
    transition: transform .3s ease, box-shadow .3s ease,
                border-color .3s ease;
}

.course-section .modern-course-card:hover {
    transform: translateY(-6px);
    border-color: #c8d9ff;
    box-shadow: 0 18px 38px rgba(20, 39, 76, .14);
}

.course-section .modern-course-image {
    position: relative;
    height: 185px;
    overflow: hidden;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
}

.course-section .modern-course-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.course-section .modern-course-card:hover .modern-course-image img {
    transform: scale(1.06);
}

.course-section .course-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(8, 23, 54, .02) 30%,
        rgba(8, 23, 54, .58) 100%
    );
    pointer-events: none;
}

.course-section .course-duration-badge {
    position: absolute;
    top: 13px;
    left: 13px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 30px;
    background: rgba(255, 255, 255, .94);
    color: #18366e;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.course-section .modern-course-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 19px;
}

.course-section .course-category {
    display: inline-block;
    align-self: flex-start;
    max-width: 100%;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 30px;
    background: #edf4ff;
    color: #155eef;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    line-height: 1.4;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.course-section .modern-course-content h3 {
    margin: 0 0 10px;
    color: var(--course-navy);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.course-section .modern-course-content p {
    display: -webkit-box;
    min-height: 63px;
    margin: 0 0 17px;
    overflow: hidden;
    color: var(--course-muted);
    font-size: 13px;
    line-height: 1.65;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.course-section .modern-course-actions {
    display: flex;
    gap: 9px;
    margin-top: auto;
}

.course-section .modern-course-actions a,
.course-section .modern-course-actions button {
    display: inline-flex;
    flex: 1;
    min-width: 0;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all .25s ease;
}

/* Premium View Details button */

.course-section .course-view-btn {
    position: relative;
    overflow: hidden;
    border-color: rgba(99, 102, 241, .35) !important;
    background: linear-gradient(135deg, #2563eb, #5145cd 55%, #7c3aed) !important;
    color: #fff !important;
    box-shadow: 0 5px 13px rgba(79, 70, 229, .22);
}

.course-section .course-view-btn:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, #1d4ed8, #4338ca 55%, #6d28d9) !important;
    color: #fff !important;
    box-shadow: 0 9px 20px rgba(79, 70, 229, .35);
}

.course-section .course-enroll-btn {
    background: linear-gradient(135deg, #155eef, #2344c7);
    color: #fff;
    box-shadow: 0 5px 12px rgba(21, 94, 239, .15);
}

.course-section .course-enroll-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #104ac8, #172f99);
    color: #fff;
}

/* ===================== PREMIUM VIEW MORE CARD ===================== */

.course-section .view-more-slide {
    flex-basis: 300px;
    width: 300px;
}

.course-section .view-more-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 22px;
    background:
        radial-gradient(circle at 95% 5%, rgba(236, 72, 153, .48), transparent 35%),
        radial-gradient(circle at 0% 75%, rgba(6, 182, 212, .28), transparent 40%),
        linear-gradient(145deg, #10153d 0%, #243b9b 48%, #6d28d9 100%);
    color: #fff;
    box-shadow: 0 15px 38px rgba(35, 43, 115, .25);
    transition: transform .35s ease, box-shadow .35s ease;
}

.course-section .view-more-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 22px 45px rgba(35, 43, 115, .32);
}

.course-section .view-more-image {
    position: relative;
    height: 185px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(135deg, #06b6d4, #4f46e5 55%, #ec4899);
}

.course-section .view-more-image img {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    clip-path: polygon(
        0 0, 100% 0, 100% 70%, 83% 83%,
        67% 76%, 48% 100%, 28% 85%, 0 96%
    );
    transform: scale(1.04) rotate(-2deg);
    filter: saturate(1.2) contrast(1.04);
    transition: transform .55s ease, filter .4s ease;
}

.course-section .view-more-card:hover .view-more-image img {
    transform: scale(1.12) rotate(0deg);
    filter: saturate(1.35) contrast(1.06);
}

.course-section .view-more-image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        125deg,
        rgba(14, 165, 233, .32),
        transparent 42%,
        rgba(124, 58, 237, .38)
    );
}

.course-section .view-more-image::after {
    content: "";
    position: absolute;
    top: -52px;
    right: 30px;
    z-index: 2;
    width: 65px;
    height: 280px;
    transform: rotate(34deg);
    border: 2px solid rgba(255, 255, 255, .35);
    border-radius: 35px;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, .22),
        rgba(255, 255, 255, .025)
    );
    pointer-events: none;
}

.course-section .view-more-image-shape {
    position: absolute;
    top: -40px;
    right: -65px;
    z-index: 3;
    width: 175px;
    height: 245px;
    transform: rotate(32deg) skewY(-12deg);
    border: 2px solid rgba(255, 255, 255, .38);
    border-radius: 28px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, .22),
        rgba(255, 255, 255, .025)
    );
    pointer-events: none;
}

.course-section .view-more-image-shape::before {
    content: "";
    position: absolute;
    top: 38px;
    left: -52px;
    width: 150px;
    height: 205px;
    transform: rotate(-12deg);
    border: 2px solid rgba(255, 255, 255, .28);
    border-radius: 22px;
    background: rgba(255, 255, 255, .09);
}

.course-section .view-more-floating-icon {
    position: absolute;
    top: 48%;
    left: 50%;
    z-index: 4;
    display: flex;
    width: 72px;
    height: 72px;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) rotate(-10deg);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 22px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, .34),
        rgba(255, 255, 255, .10)
    );
    color: #fff;
    font-size: 38px;
    box-shadow: 0 12px 30px rgba(9, 15, 50, .3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform .35s ease, background .35s ease;
}

.course-section .view-more-card:hover .view-more-floating-icon {
    transform: translate(-50%, -50%) rotate(0deg) scale(1.08);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, .48),
        rgba(255, 255, 255, .16)
    );
}

.course-section .view-more-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
}

.course-section .view-more-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 11px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 30px;
    background: linear-gradient(
        90deg,
        rgba(6, 182, 212, .22),
        rgba(236, 72, 153, .22)
    );
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.3px;
}

.course-section .view-more-content h3 {
    margin: 14px 0 11px;
    color: #fff;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.35;
    text-shadow: 0 3px 12px rgba(0, 0, 0, .18);
}

.course-section .view-more-content p {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, .88);
    font-size: 13px;
    line-height: 1.75;
}

.course-section .view-more-btn {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
    padding: 12px 15px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 12px;
    background: linear-gradient(110deg, #fff, #e0f2fe, #fce7f3);
    color: #29358f;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 7px 20px rgba(7, 15, 55, .2);
    transition: transform .3s ease, box-shadow .3s ease;
}

.course-section .view-more-btn span {
    display: inline-flex;
    width: 25px;
    height: 25px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-size: 17px;
    transition: transform .3s ease;
}

.course-section .view-more-btn:hover {
    transform: translateY(-3px);
    color: #312e81;
    box-shadow: 0 12px 25px rgba(7, 15, 55, .3);
}

.course-section .view-more-btn:hover span {
    transform: translateX(4px);
}

.course-section .view-more-decoration {
    position: absolute;
    right: -38px;
    bottom: -55px;
    z-index: 1;
    width: 165px;
    height: 165px;
    border: 2px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 255, 255, .12),
        rgba(255, 255, 255, .01) 70%
    );
    pointer-events: none;
}

.course-section .view-more-decoration::before {
    content: "";
    position: absolute;
    inset: 17px;
    border: 1px dashed rgba(255, 255, 255, .3);
    border-radius: 50%;
}

/* ===================== SWIPE HINT ===================== */

.course-section .course-swipe-hint {
    display: none;
    margin: 0;
    padding: 0 3px;
    color: #75819a;
    font-size: 11px;
}

/* ===================== ANIMATIONS ===================== */

@keyframes courseHeadingReveal {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes headingGradientFlow {
    0% { background-position: 0% center; }
    100% { background-position: 220% center; }
}

@keyframes headingDotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: .7; }
}

@keyframes headingLineMove {
    from { left: 0; }
    to { left: 55%; }
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 767px) {
    .course-section {
        padding: 30px 12px 22px;
    }

    .course-section .course-section-heading {
        margin-bottom: 17px;
    }

    .course-section .course-heading-content h2 {
        font-size: 27px;
        line-height: 1.4;
        letter-spacing: -.4px;
    }

    .course-section .course-small-label {
        gap: 8px;
        margin-bottom: 12px;
        padding: 8px 12px;
        font-size: 9px;
        letter-spacing: 1px;
    }

    .course-section .course-heading-content p {
        padding: 0 5px;
        font-size: 13px;
        line-height: 1.7;
    }

    .course-section .heading-bottom-line {
        margin-top: 16px;
    }

    /* Arrows appear centered below the heading on mobile */
    .course-section .course-scroll-controls {
        position: static;
        justify-content: center;
        margin-top: 16px;
        transform: none;
    }

    .course-section .course-arrow-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .course-section .course-track {
        gap: 14px;
    }

    .course-section .course-slide,
    .course-section .view-more-slide {
        flex-basis: min(78vw, 290px);
        width: min(78vw, 290px);
    }

    .course-section .modern-course-image,
    .course-section .view-more-image {
        height: 165px;
    }

    .course-section .modern-course-content {
        padding: 16px;
    }

    .course-section .modern-course-content h3 {
        font-size: 16px;
    }

    .course-section .modern-course-content p {
        min-height: 60px;
        font-size: 12px;
    }

    .course-section .modern-course-actions {
        gap: 7px;
    }

    .course-section .modern-course-actions a,
    .course-section .modern-course-actions button {
        padding: 9px 7px;
        font-size: 11px;
    }

    .course-section .view-more-content {
        padding: 19px 16px;
    }

    .course-section .view-more-content h3 {
        font-size: 21px;
    }

    .course-section .view-more-floating-icon {
        width: 62px;
        height: 62px;
        border-radius: 19px;
        font-size: 32px;
    }

    .course-section .course-swipe-hint {
        display: block;
    }
}

/* Accessibility: respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
    .course-section .course-scroller {
        scroll-behavior: auto;
    }

    .course-section *,
    .course-section *::before,
    .course-section *::after {
        animation: none !important;
        transition: none !important;
    }
}
