/* ================================================================
   Learning Progress Mini – Frontend CSS v2.0
   Design: Spanisch-Lernen-Stil (orange / beige / navy)
   ================================================================ */

:root {
    --lpm-bg:          #fdf5ec;
    --lpm-white:       #ffffff;
    --lpm-orange:      #f47b20;
    --lpm-orange-lt:   #ffa04d;
    --lpm-orange-ul:   #fff3e8;
    --lpm-navy:        #1a2744;
    --lpm-soft:        #6b7280;
    --lpm-muted:       #9ca3af;
    --lpm-border:      #f0e4d4;
    --lpm-green:       #16a34a;
    --lpm-green-lt:    #dcfce7;
    --lpm-shadow:      0 4px 20px rgba(244,123,32,.10);
    --lpm-shadow-hov:  0 8px 32px rgba(244,123,32,.18);
    --lpm-radius:      18px;
    --lpm-font:        'Nunito', 'Segoe UI', sans-serif;
}

/* ── Dashboard-Wrapper ─────────────────────────────────────────── */
.lpm-dashboard {
    font-family: var(--lpm-font);
    color: var(--lpm-navy);
    max-width: 1100px;
    margin: 0 auto;
}

/* ── Header-Statistiken ────────────────────────────────────────── */
.lpm-dash-header {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.lpm-dash-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--lpm-white);
    border: 2px solid var(--lpm-border);
    border-radius: var(--lpm-radius);
    padding: 18px 24px;
    flex: 1 1 160px;
    box-shadow: var(--lpm-shadow);
    transition: border-color .2s, box-shadow .2s;
}

.lpm-dash-stat:hover {
    border-color: var(--lpm-orange);
    box-shadow: var(--lpm-shadow-hov);
}

.lpm-dash-stat-icon {
    font-size: 28px;
    line-height: 1;
}

.lpm-dash-stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--lpm-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 4px;
}

.lpm-dash-stat-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--lpm-navy);
    line-height: 1;
}

/* ── Level-Cards ───────────────────────────────────────────────── */
.lpm-levels-wrap {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lpm-level-card {
    background: var(--lpm-white);
    border: 2px solid var(--lpm-border);
    border-radius: var(--lpm-radius);
    overflow: hidden;
    box-shadow: var(--lpm-shadow);
    transition: border-color .25s, box-shadow .25s;
}

.lpm-level-card:hover {
    border-color: var(--lpm-orange);
    box-shadow: var(--lpm-shadow-hov);
}

.lpm-level-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    border-bottom: 2px solid transparent;
    background: var(--lpm-white);
    transition: background .2s;
}

.lpm-level-card.lpm-open .lpm-level-header {
    border-bottom-color: var(--lpm-border);
    background: var(--lpm-orange-ul);
}

.lpm-level-header:hover { background: var(--lpm-orange-ul); }

.lpm-level-badge {
    background: var(--lpm-orange);
    color: var(--lpm-white);
    font-weight: 900;
    font-size: 18px;
    border-radius: 12px;
    padding: 6px 16px;
    min-width: 56px;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.lpm-level-info {
    flex: 1;
    min-width: 0;
}

.lpm-level-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--lpm-navy);
}

.lpm-level-sub {
    font-size: 12px;
    color: var(--lpm-muted);
    font-weight: 500;
    margin-top: 2px;
}

.lpm-level-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--lpm-orange);
    background: var(--lpm-orange-ul);
    border: 1px solid #f8c89e;
    border-radius: 100px;
    padding: 4px 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lpm-toggle-arrow {
    color: var(--lpm-orange);
    font-size: 18px;
    transition: transform .3s;
    flex-shrink: 0;
}

.lpm-level-card.lpm-open .lpm-toggle-arrow { transform: rotate(180deg); }

/* Level-Body */
.lpm-level-body {
    display: none;
    padding: 20px;
    background: var(--lpm-bg);
    flex-direction: column;
    gap: 12px;
}

.lpm-level-card.lpm-open .lpm-level-body { display: flex; }

/* ── Module ────────────────────────────────────────────────────── */
.lpm-modul {
    background: var(--lpm-white);
    border: 2px solid var(--lpm-border);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.lpm-modul:hover {
    border-color: var(--lpm-orange);
    box-shadow: 0 2px 12px rgba(244,123,32,.10);
}

.lpm-modul-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    cursor: pointer;
    user-select: none;
}

.lpm-modul-icon { font-size: 16px; flex-shrink: 0; }

.lpm-modul-title {
    flex: 1;
    font-size: 14px;
    font-weight: 800;
    color: var(--lpm-navy);
}

.lpm-modul-pct {
    font-size: 11px;
    font-weight: 700;
    color: var(--lpm-muted);
    background: var(--lpm-bg);
    border: 1px solid var(--lpm-border);
    border-radius: 100px;
    padding: 2px 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lpm-mod-arrow {
    color: var(--lpm-orange);
    font-size: 13px;
    transition: transform .3s;
    flex-shrink: 0;
}

.lpm-modul.lpm-open .lpm-mod-arrow { transform: rotate(90deg); }

/* Lektionen-Liste */
.lpm-lektion-list {
    display: none;
    border-top: 1px solid var(--lpm-border);
    padding: 10px 18px 14px 18px;
    flex-direction: column;
    gap: 2px;
}

.lpm-modul.lpm-open .lpm-lektion-list { display: flex; }

.lpm-lektion-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--lpm-border);
}

.lpm-lektion-row:last-child { border-bottom: none; }

.lpm-lektion-title {
    flex: 1;
    font-size: 13px;
    color: var(--lpm-navy);
    text-decoration: none;
    font-weight: 500;
    transition: color .15s;
}

.lpm-lektion-title:hover { color: var(--lpm-orange); }

.lpm-lektion-pts {
    font-size: 11px;
    color: var(--lpm-muted);
    white-space: nowrap;
}

.lpm-lektion-empty {
    font-size: 13px;
    color: var(--lpm-muted);
    font-style: italic;
    padding: 8px 0;
}

/* Modul-Fortschrittsbalken */
.lpm-modul-bar-wrap {
    padding: 0 18px 12px;
}

.lpm-modul-bar {
    height: 4px;
    background: var(--lpm-border);
    border-radius: 4px;
    overflow: hidden;
}

.lpm-modul-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lpm-orange), var(--lpm-orange-lt));
    border-radius: 4px;
    transition: width .5s ease;
}

/* Level-Fortschrittsbalken */
.lpm-level-progress-wrap {
    margin-top: 4px;
    padding: 14px 16px;
    background: var(--lpm-orange-ul);
    border-radius: 12px;
    border: 1px dashed #f8c89e;
}

.lpm-level-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--lpm-orange);
    margin-bottom: 8px;
}

.lpm-progress-bar {
    height: 6px;
    background: #f8d5b8;
    border-radius: 6px;
    overflow: hidden;
}

.lpm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lpm-orange), var(--lpm-orange-lt));
    border-radius: 6px;
    transition: width .5s ease;
}

/* ── Icons ─────────────────────────────────────────────────────── */
.lpm-icon-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 1.5px solid var(--lpm-border);
    background: var(--lpm-bg);
    color: var(--lpm-muted);
    vertical-align: middle;
    flex: 0 0 22px;
    transition: all .2s;
}

.lpm-icon-circle.is-completed {
    border-color: var(--lpm-green);
    background: var(--lpm-green);
    color: var(--lpm-white);
    box-shadow: 0 2px 8px rgba(22,163,74,.25);
}

.lpm-icon-circle.is-pending {
    border-color: var(--lpm-border);
    background: var(--lpm-bg);
    color: var(--lpm-muted);
}

/* ── Status-Chip ───────────────────────────────────────────────── */
.lpm-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 100px;
    background: var(--lpm-bg);
    border: 1px solid var(--lpm-border);
    color: var(--lpm-navy);
    font-size: 13px;
    font-weight: 600;
}

/* ── Complete-Button ───────────────────────────────────────────── */
.lpm-complete-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lpm-complete-btn {
    appearance: none;
    border: none;
    cursor: pointer;
    padding: 11px 22px;
    border-radius: 100px;
    font-weight: 700;
    font-family: var(--lpm-font);
    font-size: 14px;
    background: var(--lpm-orange);
    color: var(--lpm-white);
    transition: all .2s ease;
    box-shadow: 0 4px 16px rgba(244,123,32,.25);
}

.lpm-complete-btn:hover {
    background: var(--lpm-orange-lt);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(244,123,32,.35);
}

.lpm-complete-btn.is-completed {
    background: var(--lpm-green);
    box-shadow: 0 4px 16px rgba(22,163,74,.25);
}

.lpm-complete-btn.is-completed:hover {
    background: #15803d;
}

.lpm-complete-btn.is-loading {
    opacity: .7;
    pointer-events: none;
}

/* ── Zusammenfassungs-Karten ───────────────────────────────────── */
.lpm-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.lpm-summary-card {
    padding: 18px 20px;
    border-radius: var(--lpm-radius);
    background: var(--lpm-white);
    border: 2px solid var(--lpm-border);
    box-shadow: var(--lpm-shadow);
    transition: border-color .2s, box-shadow .2s;
}

.lpm-summary-card:hover {
    border-color: var(--lpm-orange);
    box-shadow: var(--lpm-shadow-hov);
}

.lpm-summary-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--lpm-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 6px;
}

.lpm-summary-value {
    font-size: 28px;
    font-weight: 900;
    color: var(--lpm-navy);
}

/* ── Abgeschlossen-Liste ───────────────────────────────────────── */
.lpm-completed-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lpm-completed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--lpm-border);
    font-size: 14px;
}

.lpm-completed-item:last-child { border-bottom: none; }

.lpm-completed-item a {
    color: var(--lpm-navy);
    text-decoration: none;
    font-weight: 500;
}

.lpm-completed-item a:hover { color: var(--lpm-orange); }

.lpm-completed-points {
    color: var(--lpm-muted);
    font-size: 12px;
}

.lpm-completed-empty {
    color: var(--lpm-muted);
    font-style: italic;
    font-size: 13px;
}

/* ── Menü-Icons ────────────────────────────────────────────────── */
.lpm-menu-status {
    margin-left: 8px;
    display: inline-flex;
    vertical-align: middle;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .lpm-dash-header { flex-direction: column; }
    .lpm-level-header { padding: 16px; }
    .lpm-level-body { padding: 14px; }
}
