/* =========================================================
   LEARNHIVE STUDENT UI
   Shared styles for the Student Dashboard and My Learning
   ========================================================= */

:root {
    --lh-primary: #0f766e;
    --lh-primary-dark: #115e59;
    --lh-primary-light: #ccfbf1;

    --lh-navy: #0f172a;
    --lh-text: #334155;
    --lh-muted: #64748b;
    --lh-light-text: #94a3b8;

    --lh-background: #f8fafc;
    --lh-surface: #ffffff;
    --lh-border: #e2e8f0;

    --lh-success: #15803d;
    --lh-success-bg: #dcfce7;

    --lh-warning: #b45309;
    --lh-warning-bg: #fef3c7;

    --lh-radius-sm: 10px;
    --lh-radius-md: 16px;
    --lh-radius-lg: 22px;

    --lh-shadow-sm:
        0 1px 2px rgba(15, 23, 42, 0.04);

    --lh-shadow-md:
        0 8px 30px rgba(15, 23, 42, 0.07);

    --lh-transition:
        180ms ease;
}


/* =========================================================
   DASHBOARD CONTAINER
   ========================================================= */

.learnhive-dashboard {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 70px;

    color: var(--lh-text);
    font-family: inherit;
}


/* =========================================================
   GLOBAL RESET (scoped)
   ========================================================= */

.learnhive-dashboard *,
.learnhive-dashboard *::before,
.learnhive-dashboard *::after,
.learnhive-my-learning *,
.learnhive-my-learning *::before,
.learnhive-my-learning *::after {
    box-sizing: border-box;
}

.learnhive-dashboard h1,
.learnhive-dashboard h2,
.learnhive-dashboard h3,
.learnhive-dashboard p,
.learnhive-my-learning h1,
.learnhive-my-learning h2,
.learnhive-my-learning h3,
.learnhive-my-learning p {
    margin-top: 0;
}

.learnhive-dashboard a,
.learnhive-my-learning a {
    text-decoration: none;
}


/* =========================================================
   WELCOME HEADER
   ========================================================= */

.learnhive-welcome,
.learnhive-dashboard-header {
    position: relative;

    overflow: hidden;

    margin-bottom: 28px;
    padding: 42px 44px;

    border-radius: var(--lh-radius-lg);

    background:
        linear-gradient(
            135deg,
            #0f172a 0%,
            #134e4a 100%
        );

    color: #ffffff;

    box-shadow: var(--lh-shadow-md);
}

.learnhive-welcome::after,
.learnhive-dashboard-header::after {
    content: "";

    position: absolute;

    width: 280px;
    height: 280px;

    right: -80px;
    top: -120px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.06);
}

.learnhive-welcome::before,
.learnhive-dashboard-header::before {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    right: 120px;
    bottom: -120px;

    border-radius: 50%;

    background: rgba(20, 184, 166, 0.15);
}

.learnhive-welcome > div,
.learnhive-dashboard-header > div {
    position: relative;
    z-index: 2;
}

.learnhive-eyebrow {
    display: inline-block;

    margin-bottom: 9px;

    color: var(--lh-primary);

    font-size: 11px;
    font-weight: 700;

    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.learnhive-welcome .learnhive-eyebrow,
.learnhive-dashboard-header .learnhive-eyebrow {
    color: #5eead4;
}

.learnhive-welcome h1,
.learnhive-dashboard-header h1 {
    margin-bottom: 10px;

    color: #ffffff;

    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.1;
    font-weight: 750;

    letter-spacing: -0.035em;
}

.learnhive-welcome p,
.learnhive-dashboard-header p {
    max-width: 650px;

    margin-bottom: 0;

    color: rgba(255, 255, 255, 0.72);

    font-size: 16px;
    line-height: 1.7;
}


/* =========================================================
   STATISTICS
   ========================================================= */

.learnhive-stats {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 16px;

    margin-bottom: 46px;
}

.learnhive-stat-card {
    position: relative;

    min-height: 140px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 24px;

    background: var(--lh-surface);

    border: 1px solid var(--lh-border);
    border-radius: var(--lh-radius-md);

    box-shadow: var(--lh-shadow-sm);

    transition:
        transform var(--lh-transition),
        box-shadow var(--lh-transition),
        border-color var(--lh-transition);
}

.learnhive-stat-card:hover {
    transform: translateY(-2px);

    border-color: #cbd5e1;

    box-shadow: var(--lh-shadow-md);
}

.learnhive-stat-card::before {
    content: "";

    position: absolute;

    left: 0;
    top: 24px;
    bottom: 24px;

    width: 3px;

    border-radius: 0 4px 4px 0;

    background: var(--lh-primary);
}

.learnhive-stat-label {
    display: block;

    margin-bottom: 8px;

    color: var(--lh-muted);

    font-size: 13px;
    font-weight: 600;
}

.learnhive-stat-card strong {
    display: block;

    color: var(--lh-navy);

    font-size: 38px;
    line-height: 1;

    font-weight: 750;

    letter-spacing: -0.04em;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.learnhive-section,
.learnhive-dashboard-section {
    margin-bottom: 48px;
}

.learnhive-section-header,
.learnhive-section-heading {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.learnhive-section-header h2,
.learnhive-section-heading h2 {
    margin: 0;

    color: var(--lh-navy);

    font-size: 25px;
    line-height: 1.2;
    font-weight: 750;

    letter-spacing: -0.025em;
}

.learnhive-section-count {
    flex-shrink: 0;

    color: var(--lh-muted);

    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   CONTINUE LEARNING
   ========================================================= */

.learnhive-course-card-featured {
    display: grid;

    grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);

    overflow: hidden;

    background: var(--lh-surface);

    border: 1px solid var(--lh-border);

    border-radius: var(--lh-radius-lg);

    box-shadow: var(--lh-shadow-sm);
}

.learnhive-course-card-featured .learnhive-course-image {
    min-height: 300px;
}

.learnhive-course-card-featured .learnhive-course-content {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 42px;
}

.learnhive-course-card-featured h3 {
    margin-bottom: 20px;

    color: var(--lh-navy);

    font-size: 30px;
    line-height: 1.2;
    font-weight: 750;

    letter-spacing: -0.025em;
}


/* =========================================================
   COURSE GRID
   ========================================================= */

.learnhive-course-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 20px;
}


/* =========================================================
   COURSE CARDS
   ========================================================= */

.learnhive-course-card {
    overflow: hidden;

    background: var(--lh-surface);

    border: 1px solid var(--lh-border);

    border-radius: var(--lh-radius-md);

    box-shadow: var(--lh-shadow-sm);

    transition:
        transform var(--lh-transition),
        box-shadow var(--lh-transition),
        border-color var(--lh-transition);
}

.learnhive-course-card:hover {
    transform: translateY(-3px);

    border-color: #cbd5e1;

    box-shadow: var(--lh-shadow-md);
}

.learnhive-course-image {
    position: relative;

    width: 100%;
    min-height: 180px;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #e2e8f0,
            #cbd5e1
        );
}

.learnhive-course-image img {
    display: block;

    width: 100%;
    height: 100%;

    min-height: 180px;

    object-fit: cover;

    transition: transform 350ms ease;
}

.learnhive-course-card:hover .learnhive-course-image img {
    transform: scale(1.035);
}

/* Fallback tile when a course has no featured image. */
.learnhive-course-image-fallback {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 180px;

    color: var(--lh-light-text);

    font-size: 46px;
    font-weight: 750;

    background:
        linear-gradient(
            135deg,
            #e2e8f0,
            #f8fafc
        );
}

.learnhive-course-content {
    padding: 22px;
}

.learnhive-course-content h3 {
    margin-bottom: 13px;

    color: var(--lh-navy);

    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
}

.learnhive-course-content p {
    margin-bottom: 18px;

    color: var(--lh-muted);

    font-size: 14px;
    line-height: 1.6;
}

/* Programme eyebrow sits directly above the course title in cards. */
.learnhive-course-content .learnhive-eyebrow {
    margin-bottom: 6px;
}


/* =========================================================
   COURSE STATUS
   ========================================================= */

.learnhive-course-status {
    margin-bottom: 16px;
}

.learnhive-course-status span {
    display: inline-flex;

    align-items: center;

    padding: 6px 10px;

    border-radius: 999px;

    font-size: 11px;
    line-height: 1;

    font-weight: 700;
}

.status-completed {
    color: var(--lh-success);

    background: var(--lh-success-bg);
}

.status-progress {
    color: var(--lh-primary-dark);

    background: var(--lh-primary-light);
}

.status-not-started {
    color: var(--lh-warning);

    background: var(--lh-warning-bg);
}


/* =========================================================
   PROGRESS
   ========================================================= */

.learnhive-progress {
    margin-top: 18px;
}

.learnhive-progress > span {
    display: block;

    margin-top: 8px;

    color: var(--lh-muted);

    font-size: 12px;
    font-weight: 600;
}

.learnhive-progress-bar {
    width: 100%;
    height: 7px;

    overflow: hidden;

    background: #e2e8f0;

    border-radius: 999px;
}

.learnhive-progress-bar span {
    display: block;

    width: 0;
    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            var(--lh-primary),
            #14b8a6
        );

    transition: width 500ms ease;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.learnhive-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-height: 44px;

    margin-top: 20px;

    padding: 0 18px;

    color: #ffffff !important;

    background: var(--lh-primary);

    border-radius: 10px;

    font-size: 13px;
    font-weight: 700;

    transition:
        background var(--lh-transition),
        transform var(--lh-transition),
        box-shadow var(--lh-transition);
}

.learnhive-button:hover {
    color: #ffffff !important;

    background: var(--lh-primary-dark);

    transform: translateY(-1px);

    box-shadow:
        0 6px 15px rgba(15, 118, 110, 0.18);
}


/* =========================================================
   EMPTY STATES
   ========================================================= */

.learnhive-empty-card,
.learnhive-empty-state {
    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 220px;

    padding: 40px;

    text-align: center;

    background: var(--lh-surface);

    border: 1px dashed #cbd5e1;

    border-radius: var(--lh-radius-md);
}

.learnhive-empty-card h3,
.learnhive-empty-state h3 {
    margin-bottom: 8px;

    color: var(--lh-navy);

    font-size: 17px;
    font-weight: 700;
}

.learnhive-empty-card p,
.learnhive-empty-state p {
    max-width: 480px;

    margin-bottom: 0;

    color: var(--lh-muted);

    font-size: 14px;
    line-height: 1.6;
}

.learnhive-empty-icon {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    margin-bottom: 16px;

    border-radius: 14px;

    color: var(--lh-primary);

    background: var(--lh-primary-light);

    font-size: 22px;
}


/* =========================================================
   ACTIVITY
   ========================================================= */

.learnhive-activity-list {
    overflow: hidden;

    background: var(--lh-surface);

    border: 1px solid var(--lh-border);

    border-radius: var(--lh-radius-md);
}

.learnhive-activity-item {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 18px 22px;

    border-bottom: 1px solid var(--lh-border);
}

.learnhive-activity-item:last-child {
    border-bottom: 0;
}

.learnhive-activity-item > div {
    display: flex;

    flex-direction: column;

    gap: 4px;
}

.learnhive-activity-item strong {
    color: var(--lh-navy);

    font-size: 14px;
    font-weight: 700;
}

.learnhive-activity-item span {
    color: var(--lh-muted);

    font-size: 12px;
}

.learnhive-activity-item > span {
    flex-shrink: 0;

    color: var(--lh-primary);

    font-weight: 700;
}


/* =========================================================
   MY LEARNING
   Reuses the card / progress / status / button styles above.
   Only the page container, header and filter bar are new.
   ========================================================= */

.learnhive-my-learning {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 70px;

    color: var(--lh-text);
    font-family: inherit;
}

.learnhive-my-learning-header {
    margin-bottom: 26px;
}

.learnhive-my-learning-header h1 {
    margin-bottom: 8px;

    color: var(--lh-navy);

    font-size: clamp(26px, 3.4vw, 36px);
    line-height: 1.15;
    font-weight: 750;

    letter-spacing: -0.03em;
}

.learnhive-my-learning-header p {
    max-width: 620px;

    margin-bottom: 0;

    color: var(--lh-muted);

    font-size: 15px;
    line-height: 1.6;
}

/* Filter pills */
.learnhive-filter-bar {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-bottom: 28px;
}

.learnhive-filter {
    display: inline-flex;
    align-items: center;

    padding: 9px 16px;

    color: var(--lh-muted);

    background: var(--lh-surface);

    border: 1px solid var(--lh-border);
    border-radius: 999px;

    font-size: 13px;
    font-weight: 600;
    font-family: inherit;

    cursor: pointer;

    transition:
        color var(--lh-transition),
        background var(--lh-transition),
        border-color var(--lh-transition);
}

.learnhive-filter:hover {
    border-color: #cbd5e1;

    color: var(--lh-navy);
}

.learnhive-filter.is-active {
    color: #ffffff;

    background: var(--lh-navy);

    border-color: var(--lh-navy);
}

.learnhive-filter:focus-visible {
    outline: 3px solid rgba(20, 184, 166, 0.35);
    outline-offset: 3px;
}

/*
 * My Learning uses a responsive auto-fill grid so any number of courses
 * lays out cleanly. This only overrides the column rule inside My Learning;
 * the dashboard grid is untouched.
 */
.learnhive-my-learning .learnhive-course-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.learnhive-my-learning .learnhive-course-content {
    display: flex;
    flex-direction: column;
}

/* Push the action button to the bottom so cards line up on their baselines. */
.learnhive-my-learning .learnhive-course-content .learnhive-button {
    margin-top: auto;
}

.learnhive-empty-filter {
    margin-top: 20px;
}

.learnhive-empty-filter p {
    margin: 0;

    color: var(--lh-muted);

    font-size: 14px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1024px) {

    .learnhive-dashboard,
    .learnhive-my-learning {
        padding: 26px 20px 60px;
    }

    .learnhive-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .learnhive-course-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .learnhive-course-card-featured {
        grid-template-columns: 1fr;
    }

    .learnhive-course-card-featured .learnhive-course-image {
        min-height: 240px;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {

    .learnhive-dashboard,
    .learnhive-my-learning {
        padding: 18px 14px 45px;
    }

    .learnhive-welcome,
    .learnhive-dashboard-header {
        margin-bottom: 20px;

        padding: 30px 24px;

        border-radius: 18px;
    }

    .learnhive-welcome h1,
    .learnhive-dashboard-header h1 {
        font-size: 30px;
    }

    .learnhive-welcome p,
    .learnhive-dashboard-header p {
        font-size: 14px;
    }

    .learnhive-stats {
        grid-template-columns: repeat(2, 1fr);

        gap: 10px;

        margin-bottom: 38px;
    }

    .learnhive-stat-card {
        min-height: 115px;

        padding: 18px;
    }

    .learnhive-stat-card strong {
        font-size: 30px;
    }

    .learnhive-stat-card::before {
        top: 18px;
        bottom: 18px;
    }

    .learnhive-section,
    .learnhive-dashboard-section {
        margin-bottom: 38px;
    }

    .learnhive-section-header,
    .learnhive-section-heading {
        align-items: flex-start;

        flex-direction: column;

        gap: 6px;

        margin-bottom: 16px;
    }

    .learnhive-section-header h2,
    .learnhive-section-heading h2 {
        font-size: 22px;
    }

    .learnhive-course-grid,
    .learnhive-my-learning .learnhive-course-grid {
        grid-template-columns: 1fr;

        gap: 14px;
    }

    .learnhive-course-card-featured {
        grid-template-columns: 1fr;
    }

    .learnhive-course-card-featured .learnhive-course-image {
        min-height: 200px;
    }

    .learnhive-course-card-featured .learnhive-course-content {
        padding: 26px 22px;
    }

    .learnhive-course-card-featured h3 {
        font-size: 24px;
    }

    .learnhive-course-image {
        min-height: 170px;
    }

    .learnhive-course-image img,
    .learnhive-course-image-fallback {
        min-height: 170px;
    }

    .learnhive-course-content {
        padding: 19px;
    }

    .learnhive-empty-card,
    .learnhive-empty-state {
        min-height: 190px;

        padding: 28px 20px;
    }

    .learnhive-activity-item {
        align-items: flex-start;

        padding: 16px;
    }

}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.learnhive-button:focus-visible,
.learnhive-course-card a:focus-visible {
    outline: 3px solid rgba(20, 184, 166, 0.35);

    outline-offset: 3px;
}


/* =========================================================
   REDUCE MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .learnhive-dashboard *,
    .learnhive-dashboard *::before,
    .learnhive-dashboard *::after,
    .learnhive-my-learning *,
    .learnhive-my-learning *::before,
    .learnhive-my-learning *::after {
        transition: none !important;
        animation: none !important;
    }

}


/* =========================================================
   HIDE LEARNPRESS SELF-ENROLMENT / PURCHASE BUTTONS
   Enrolment is controlled by LearnHive admins/owners, so the
   public enroll & purchase buttons on course pages are removed.
   ========================================================= */

.lp-button.button-enroll-course,
.lp-button.button-purchase-course,
form.enroll-course,
form.purchase-course,
.lp-course-buttons form.enroll-course,
.lp-course-buttons form.purchase-course,
.lp-single-course .button-enroll-course,
.lp-single-course .button-purchase-course {
    display: none !important;
}
