/* =============================================================================
   CNX LMS — shared UI atoms: buttons, tags, progress, notices, empty states
   ========================================================================== */

/* --- Buttons ----------------------------------------------------------------
   One design for the whole LMS: same geometry everywhere, variants swap only
   the fill, which reads the theme's palette through the tokens layer. Any rule
   colouring links in a container must exclude .cnx-btn (see notices).
   -------------------------------------------------------------------------- */

.cnx-lms .cnx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 20px;
    border: 1.5px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.cnx-lms .cnx-btn--primary {
    background: var(--cnx-brand);
    border-color: var(--cnx-brand);
    color: #fff;
}

.cnx-lms .cnx-btn--primary:hover,
.cnx-lms .cnx-btn--primary:focus-visible {
    background: color-mix(in srgb, var(--cnx-brand) 86%, #000);
    border-color: color-mix(in srgb, var(--cnx-brand) 86%, #000);
}

.cnx-lms .cnx-btn--ghost {
    background: transparent;
    border-color: var(--cnx-brand-line);
    color: var(--cnx-brand);
}

.cnx-lms .cnx-btn--ghost:hover,
.cnx-lms .cnx-btn--ghost:focus-visible {
    background: var(--cnx-brand-soft);
    border-color: var(--cnx-brand);
    color: var(--cnx-brand);
}

.cnx-lms .cnx-btn--warning {
    background: #FFF4E0;
    border-color: #E8C275;
    color: var(--cnx-warning);
    font-size: .9rem;
}

.cnx-lms .cnx-btn[disabled],
.cnx-lms .cnx-btn[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}

/* --- Tags ------------------------------------------------------------------ */

.cnx-lms .cnx-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--cnx-radius-pill);
    background: var(--cnx-brand-soft);
    color: var(--cnx-brand);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
}

.cnx-lms .cnx-tag--free     { background: #E4F3E5; color: #1E6323; }
.cnx-lms .cnx-tag--paid     { background: #FBE9D7; color: #8A4B0F; }
.cnx-lms .cnx-tag--enrolled { background: var(--cnx-brand); color: #fff; }

/* --- Progress -------------------------------------------------------------- */

.cnx-lms .cnx-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.cnx-lms .cnx-progress__track {
    height: 8px;
    border-radius: var(--cnx-radius-pill);
    background: var(--cnx-brand-line);
    overflow: hidden;
}

.cnx-lms .cnx-progress__fill {
    height: 100%;
    border-radius: inherit;
    background: var(--cnx-accent);
    transition: width .4s ease;
}

.cnx-lms .cnx-progress__label {
    margin: 0;
    font-size: .82rem;
    color: var(--cnx-muted);
}

/* --- Notices --------------------------------------------------------------- */

.cnx-lms .cnx-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--cnx-radius-sm);
    border-inline-start: 4px solid var(--cnx-accent);
    background: var(--cnx-cream);
    color: var(--cnx-text);
}

.cnx-lms .cnx-notice p { margin: 0; }

.cnx-lms .cnx-notice--success { border-inline-start-color: var(--cnx-success); }

/* Plain links only: without :not() this repaints a button's label on its fill. */
.cnx-lms .cnx-notice a:not(.cnx-btn) {
    color: var(--cnx-brand);
    font-weight: 600;
    text-decoration: none;
}

.cnx-lms .cnx-notice a:not(.cnx-btn):hover { text-decoration: underline; }

/* --- Call to action -------------------------------------------------------- */

.cnx-lms .cnx-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.cnx-lms .cnx-cta--compact .cnx-btn { min-height: 40px; padding: 8px 16px; }

.cnx-lms .cnx-cta__price {
    margin: 0;
    flex-basis: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cnx-brand);
}

.cnx-lms .cnx-cta__note,
.cnx-lms .cnx-lesson__error,
.cnx-lms .cnx-cta__error {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: .9rem;
    color: var(--cnx-muted);
}

.cnx-lms .cnx-cta__error,
.cnx-lms .cnx-lesson__error { color: #B3261E; }

/* --- Completed marker ------------------------------------------------------ */

.cnx-lms .cnx-done {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 600;
    color: var(--cnx-success);
}

/* --- Empty state ----------------------------------------------------------- */

.cnx-lms .cnx-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: clamp(32px, 8vw, 72px) 20px;
    text-align: center;
    color: var(--cnx-muted);
}

.cnx-lms .cnx-empty p { margin: 0; }
