/*
 * Bynteq 4.0 - Learner dashboard (dashboard.css)
 * Layout only. Colors, accents, radii, and shadows come from the shared
 * design tokens in style.css / themes.css so the dashboard inherits the
 * existing Bynteq identity and accent customization.
 */

.dashboard {
    max-width: var(--maxw, 1200px);
    margin: 0 auto;
    padding: 40px 24px 72px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.dash-section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text-primary);
}

/* ---- 1. Welcome hero ---- */
.dash-hero {
    background: var(--surface, #121218);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg, 20px);
    padding: 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.dash-hero__text h2 {
    font-size: clamp(22px, 3vw, 30px);
    margin: 0 0 8px;
    color: var(--text-primary);
}

.dash-hero__text p {
    margin: 0;
    color: var(--text-secondary, #a6a6b3);
    max-width: 52ch;
}

.dash-hero__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.dash-btn {
    display: inline-block;
    background: var(--accent, #6c63ff);
    color: var(--accent-contrast, #fff);
    border: none;
    border-radius: var(--radius-pill, 999px);
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.dash-btn.ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.dash-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- 2. Progress summary stats ---- */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dash-stat {
    background: var(--surface, #121218);
    border: 1px solid var(--border);
    border-radius: var(--radius, 16px);
    padding: 20px 22px;
}

.dash-stat__label {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px;
}

.dash-stat__value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.dash-stat__value .unit {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-left: 4px;
}

.dash-stat .progress-track {
    margin-top: 14px;
}

/* ---- 3 & 4 grid ---- */
.dash-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
    align-items: start;
}

.dash-panel {
    background: var(--surface, #121218);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 20px);
    padding: 24px;
}

/* Continue-learning card */
.dash-continue__course {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent, #6c63ff);
    margin: 0 0 6px;
}

.dash-continue__next {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.dash-continue__meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px;
}

.dash-continue .progress-track {
    margin-bottom: 8px;
}

.dash-continue__progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 18px;
}

/* ---- Recent activity ---- */
.dash-activity ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-activity li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 12px);
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-primary, #060608);
}

.dash-activity li a:hover {
    border-color: var(--accent);
}

.dash-activity .act-check {
    color: var(--success, #4ade80);
    font-weight: 700;
    flex: 0 0 auto;
}

.dash-activity .act-body { min-width: 0; }

.dash-activity .act-title {
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-activity .act-course {
    font-size: 12px;
    color: var(--text-secondary);
}

.dash-empty {
    text-align: center;
    padding: 26px 18px;
    border: 1px dashed var(--border);
    border-radius: var(--radius, 16px);
}

.dash-empty p {
    color: var(--text-secondary);
    margin: 0 0 14px;
}

/* ---- 4. Learning paths ---- */
.dash-paths {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.dash-path {
    background: var(--surface, #121218);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 20px);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-path__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-path__icon { font-size: 26px; }

.dash-path h4 {
    margin: 0;
    font-size: 17px;
    color: var(--text-primary);
}

.dash-path p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

.dash-path__progress {
    font-size: 13px;
    color: var(--text-secondary);
}

.dash-path .dash-btn {
    padding: 10px 16px;
    font-size: 14px;
    text-align: center;
}

.dash-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: var(--radius-pill, 999px);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* Reuse the shared progress bar from learn.css if present, but define a
   safe fallback so the dashboard works even if learn.css is not loaded. */
.dashboard .progress-track {
    height: 8px;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.dashboard .progress-fill {
    height: 100%;
    width: 0;
    background: var(--accent, #6c63ff);
    border-radius: 999px;
    transition: width 0.5s ease;
}

html[data-motion="reduced"] .dashboard .progress-fill {
    transition: none;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-stats { grid-template-columns: 1fr; }
    .dash-paths { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .dashboard { padding: 28px 16px 56px; }
    .dash-hero { padding: 24px; flex-direction: column; align-items: flex-start; }
    .dash-hero__actions { width: 100%; }
    .dash-btn { width: 100%; text-align: center; }
}
