/* ============================================ */
/* VARIABLES */
/* ============================================ */
:root {
    --page-bg: #f5f5f5;
    --text-primary: #464646;
    --text-secondary: #808080;
    --gray-light: #EAEAEA;
    --btn-black: #1C1C1C;
    --btn-dark: #222121;
    --white: #ffffff;
    --carousel-bg-start: #C2C2C2;
    --carousel-bg-mid: #E2E2E2;
    --carousel-bg-end: #E6E6E6;
    --progress-bg: #eee;
    --dot-inactive: #D9D9D9;
    --dot-hover: #B0B0B0;
    --topic-bg: #F0F0F0;
    --learning-bg: #e7e7e7;
    --divider-color: #d0cfcf;
    --stat-border: #fff;
    --font-main: "Plus Jakarta Sans", sans-serif;
    --sidebar-width: 240px;
    --navbar-height: 70px;
    
    /* Theme colors for carousel cards */
    --theme-color-1: #3A356B;
    --theme-color-2: #EEDE0E;
    --theme-color-3: #ED1B24;
    --theme-color-4: #FDBB21;
    --theme-color-5: #02B3CF;
    --theme-color-6: #30B34A;
    --theme-color-7: #962887;
}

/* ============================================ */
/* RESET */
/* ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: var(--font-main);
    background-color: var(--page-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ============================================ */
/* SCROLLBAR HIDE UTILITY */
/* ============================================ */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================ */
/* LAYOUT */
/* ============================================ */
.content-wrapper {
    width: 100%;
    /* min-height: 100vh; */
    /* padding-bottom: 80px; */
    overflow-x: hidden;
}

/* ============================================ */
/* MOBILE NAV */
/* ============================================ */
.mobile-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 16px 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-icon {
    width: 25px;
    height: 25px;
    filter: brightness(0);
}

/* ============================================ */
/* HEADER */
/* ============================================ */
.main-header {
    padding: 0 16px;
}

.welcome-section {
    padding: 1.5rem 0 1.25rem;
}

.welcome-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.welcome-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

/* ============================================ */
/* CAROUSEL */
/* ============================================ */
.carousel-wrapper {
    padding: 0 16px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.carousal-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.carousal-card {
    flex: 0 0 100%;
    min-width: 0;
    height: 148px;
    border-radius: 22px;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, var(--carousel-bg-start), var(--carousel-bg-mid), var(--carousel-bg-end));
    scroll-snap-align: start;
    cursor: pointer;
}

/* Theme color classes for carousel cards with linear gradients */
.carousal-card.theme-1 {
    background: linear-gradient(135deg, var(--theme-color-1) 0%, #5A558B 50%, #8884b1 100%);
}

.carousal-card.theme-2 {
    background: linear-gradient(135deg, var(--theme-color-2) 0%, #F0E835 50%, #f2f292 100%);
}

.carousal-card.theme-3 {
    background: linear-gradient(135deg, var(--theme-color-3) 0%, #F0414A 50%, #f9939a 100%);
}

.carousal-card.theme-4 {
    background: linear-gradient(135deg, var(--theme-color-4) 0%, #FDC948 50%, #f4dea1 100%);
}

.carousal-card.theme-5 {
    background: linear-gradient(135deg, var(--theme-color-5) 0%, #34C5DF 50%, #9bcdd8 100%);
}

.carousal-card.theme-6 {
    background: linear-gradient(135deg, var(--theme-color-6) 0%, #55C56F 50%, #97d9aa 100%);
}

.carousal-card.theme-7 {
    background: linear-gradient(135deg, var(--theme-color-7) 0%, #A64897 50%, #82657c 100%);
}

/* Update text color for light backgrounds */
.carousal-card.theme-2 .carousal-title,
.carousal-card.theme-4 .carousal-title {
    color: var(--btn-black);
}

.carousal-card.theme-2 .continue-btn,
.carousal-card.theme-4 .continue-btn {
    background-color: var(--btn-black);
    color: var(--white);
}

/* White text for dark theme backgrounds */
.carousal-card.theme-1 .carousal-title,
.carousal-card.theme-3 .carousal-title,
.carousal-card.theme-5 .carousal-title,
.carousal-card.theme-6 .carousal-title,
.carousal-card.theme-7 .carousal-title {
    color: var(--white);
}

.carousal-card.theme-1 .continue-btn,
.carousal-card.theme-3 .continue-btn,
.carousal-card.theme-5 .continue-btn,
.carousal-card.theme-6 .continue-btn,
.carousal-card.theme-7 .continue-btn {
    background-color: var(--white);
    color: var(--btn-black);
}

.carousal-content { flex: 1; min-width: 0; }

.carousal-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--btn-black);
    line-height: 1.4;
    margin-bottom: 1rem;
}

.continue-btn {
    background-color: var(--btn-black);
    color: var(--white);
    border: none;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 0 18px;
    height: 36px;
    white-space: nowrap;
}

.btn-arrow {
    width: 10px;
    height: auto;
}

.progress-circle {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    margin-left: 10px;
}

.progress-circle svg { display: block; width: 100%; height: 100%; }
.progress-bg { fill: none; stroke: var(--progress-bg); stroke-width: 3.8; }

@keyframes progress {
    0% { stroke-dasharray: 0 100; }
}

.progress-bar {
    fill: none;
    stroke-width: 3.8;
    stroke-linecap: round;
    stroke: var(--btn-black);
    animation: progress 1s ease-out forwards;
}

.carousel-dots-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 16px 0;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--dot-inactive);
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.dot:hover { background-color: var(--dot-hover); transform: scale(1.2); }
.dot-active { background-color: var(--btn-black); }

/* ============================================ */
/* LEARNING CARD */
/* ============================================ */
.learning-wrapper {
    padding: 0 16px;
    margin-top: 0.5rem;
}

.learning-card {
    background: var(--learning-bg);
    border-radius: 24px;
    padding: 20px;
    width: 100%;
    margin-bottom: 20px;
}

.learning-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #464646;
    margin-top: 8px;
}

.learning-divider {
    border: 0.5px solid var(--divider-color);
    margin: 12px 0 16px;
}

.learning-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border: 1px solid var(--stat-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--learning-bg);
    flex-shrink: 0;
}

/* Subtle colored glow shadows for stat icons */
.stat-item:nth-child(1) .stat-icon {
    box-shadow: 0 0 20px rgba(58, 53, 107, 0.15);
}

.stat-item:nth-child(2) .stat-icon {
    box-shadow: 0 0 20px rgba(2, 179, 207, 0.15);
}

.stat-item:nth-child(3) .stat-icon {
    box-shadow: 0 0 20px rgba(253, 187, 33, 0.15);
}

.stat-icon img { width: 20px; height: 20px; }

.stat-text strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: var(--btn-black);
}

.stat-text span {
    font-size: 10px;
    font-weight: 500;
    color: #808080;
    line-height: 1.3;
}

.btn-center {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

.btn-link { text-decoration: none; }

.view-details-btn {
    padding: 12px 32px;
    border-radius: 32px;
    border: none;
    background: #3A356B;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.view-details-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* ============================================ */
/* SECTIONS */
/* ============================================ */
.section-container {
    padding: 0 16px;
    /* margin: 1.5rem 0; */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--btn-black);
}

.see-all-link {
    font-size: 14px;
    font-weight: 700;
    color: #464646;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================ */
/* TOPIC GRID */
/* ============================================ */
.topic-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.topic-card {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    /* gap: 0.5rem; */
    cursor: pointer;
}

.topic-image {
    width: 100%;
    height: 130px;
    background-color: var(--topic-bg);
    border-radius: 1rem;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.topic-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--btn-black);
    line-height: 1.3;
}

.topic-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================ */
/* POPULAR COURSES */
/* ============================================ */
.popular-courses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popular-card {
    display: flex;
    gap: 12px;
    background-color: var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-radius: 1rem;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
}

.popular-thumb {
    width: 78px;
    height: 78px;
    background-color: var(--topic-bg);
    border-radius: 0.75rem;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
}

.popular-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    min-width: 0;
}

.course-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 10px;
    color: var(--text-secondary);
    align-items: center;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.course-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--btn-black);
    line-height: 1.4;
}

/* ============================================ */
/* TABLET  (600px+) */
/* ============================================ */
@media (min-width: 600px) {
    .main-header { padding: 0 24px; }
    .carousel-wrapper { padding: 0 24px; }
    .learning-wrapper { padding: 0 24px; }
    .section-container { padding: 0 24px; }

    .carousal-card {
        flex: 0 0 80%;
        height: 160px;
    }

    .carousal-title { font-size: 1.05rem; }

    .continue-btn {
        height: 40px;
        font-size: 12px;
    }

    .progress-circle { width: 68px; height: 68px; }

    .learning-card {
        border-radius: 28px;
        padding: 24px;
    }

    .learning-title { font-size: 1.25rem; }

    .learning-stats {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .stat-icon { width: 52px; height: 52px; }
    .stat-icon img { width: 24px; height: 24px; }
    .stat-text strong { font-size: 16px; }
    .stat-text span { font-size: 11px; }

    .topic-card { flex: 0 0 240px; }
    .topic-image { height: 150px; }

    .popular-thumb { width: 90px; height: 90px; }
    .course-card-title { font-size: 0.95rem; }
}

/* ============================================ */
/* DESKTOP (768px+) — sidebar appears */
/* ============================================ */
@media (min-width: 768px) {

    body { padding-bottom: 0; }

    .content-wrapper {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        padding-bottom: 30px;
    }

    .mobile-nav { display: none; }

    .main-header {
        padding: 2rem 2.5rem 0;
    }

    .welcome-section {
        padding: 0 0 1.5rem;
    }

    .welcome-title {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .welcome-subtitle { font-size: 1rem; margin-top: 0.5rem; }

    .carousel-wrapper { padding: 0 2.5rem; margin-top: 0; }
    .learning-wrapper { padding: 0 2.5rem; margin-top: 1.5rem; }
    .section-container { padding: 0 2.5rem;  }

    .carousal-card {
        flex: 0 0 72%;
        height: 200px;
        border-radius: 28px;
        padding: 2rem;
    }

    .carousal-title { font-size: 1.2rem; margin-bottom: 1.5rem; }

    .continue-btn { height: 46px; font-size: 13px; padding: 0 24px; }

    .progress-circle { width: 80px; height: 80px; }

    .carousel-dots-container { margin: 20px 0; gap: 8px; }
    .dot { width: 7px; height: 7px; }

    .learning-card {
        border-radius: 32px;
        padding: 32px 2.5rem;
        margin-bottom:0px;
    }

    .learning-title { font-size: 1.5rem; margin-top: 0; }
    .learning-divider { margin: 16px 0 24px; }

    .learning-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    .stat-icon { width: 60px; height: 60px; }
    .stat-icon img { width: 24px; height: 24px; }
    .stat-text strong { font-size: 22px; }
    .stat-text span { font-size: 12px; }

    .btn-center { justify-content: flex-start; margin-top: 24px; }

    .view-details-btn { font-size: 13px; padding: 14px 40px; }

    .section-title { font-size: 1.25rem; }

    .topic-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
        overflow: visible;
        padding-bottom: 0;
    }

    .topic-card { flex: unset; }
    .topic-image { height: 180px; border-radius: 1.25rem; }
    .topic-title { font-size: 16px; }
    .topic-author { font-size: 0.8rem; }

    .popular-courses-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        align-items: start;
    }

    .popular-card { border-radius: 1rem; padding: 0.5rem; gap: 0.5rem; }
    .popular-thumb { width: 90px; height: 90px; }
    .popular-content { gap: 0.25rem; }
    .course-meta { font-size: 12px; }
    .course-card-title { font-size: 1rem; }
}

/* ============================================ */
/* LARGE DESKTOP (1024px+) */
/* ============================================ */
@media (min-width: 1024px) {
    .main-header { padding: 2.5rem 3rem 0; }
    .carousel-wrapper { padding: 0 3rem; }
    .learning-wrapper { padding: 0 3rem; }
    .section-container { padding: 0 3rem; }

    .carousal-card {
        flex: 0 0 65%;
        height: 220px;
        padding: 2.5rem;
    }

    .carousal-title { font-size: 1.35rem; }

    .continue-btn { height: 50px; font-size: 14px; }

    .progress-circle { width: 90px; height: 90px; }

    .learning-card { padding: 40px 3rem; border-radius: 36px; }
    .learning-title { font-size: 1.75rem; }

    .stat-icon { width: 68px; height: 68px; }
    .stat-icon img { width: 24px; height: 24px; }
    .stat-text strong { font-size: 26px; }
    .stat-text span { font-size: 13px; }

    .view-details-btn { font-size: 14px; padding: 16px 48px; }

    .section-title { font-size: 1.5rem; }

    .topic-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
    .topic-image { height: 200px; }

    .popular-courses-list { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; align-items: start; }
    .popular-card { padding: 0.5rem; gap: 0.5rem; }
    .popular-thumb { width: 100px; height: 100px; }
    .popular-content { gap: 0.25rem; }
    .course-card-title { font-size: 1rem; }
    .course-meta { font-size: 13px; }
}

/* ============================================ */
/* EXTRA LARGE (1280px+) */
/* ============================================ */
@media (min-width: 1280px) {
    .carousal-card { flex: 0 0 55%; }

    .learning-stats { gap: 28px; }

    .stat-icon { width: 72px; height: 72px; }
    .stat-text strong { font-size: 28px; }
    .stat-text span { font-size: 14px; }

    .view-details-btn { font-size: 15px; padding: 18px 56px; }
}
