/* ============================================================
   LearnOS Preview Player — Frontend CSS v1.2
   Design: 1:1 LearnOS Hauptplayer, vollständig mobiloptimiert
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── CSS Variablen ─────────────────────────────────────────── */
:root {
  --lpp-bg:          #f5f4f0;
  --lpp-surface:     #ffffff;
  --lpp-border:      #e8e6e1;
  --lpp-border-soft: #f0eee9;
  --lpp-text:        #1a1917;
  --lpp-text-muted:  #6b6760;
  --lpp-accent:      #0e7a6e;
  --lpp-accent-dark: #0a5f55;
  --lpp-accent-soft: #e8f5f3;
  --lpp-sidebar-w:   320px;
  --lpp-radius:      10px;
  --lpp-radius-sm:   6px;
  --lpp-shadow:      0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --lpp-font:        'DM Sans', system-ui, sans-serif;
  --lpp-transition:  150ms ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
.lpp-app * { box-sizing: border-box; margin: 0; padding: 0; }

.lpp-app {
  font-family: var(--lpp-font);
  font-size: 15px;
  color: var(--lpp-text);
  line-height: 1.6;
  background: var(--lpp-bg);
  overflow-x: hidden;
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}

/* ══════════════════════════════════════════════════════════════
   DESKTOP LAYOUT (≥ 768px): Player links, Sidebar rechts
   ══════════════════════════════════════════════════════════════ */

.lpp-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 24px;
  background: var(--lpp-bg);
}

/* ── Player-Spalte ─────────────────────────────────────────── */
.lpp-player-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── Content Frame ─────────────────────────────────────────── */
.lpp-frame-wrap {
  background: #000;
  border-radius: var(--lpp-radius) var(--lpp-radius) 0 0;
  overflow: hidden;
  width: 100%;
  position: relative;
}

/* Video: 16:9 padding-trick */
.lpp-frame-wrap.lpp-type-video {
  padding-top: 56.25%;
}
.lpp-frame-wrap.lpp-type-video > * {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}
.lpp-video { object-fit: contain; background: #000; border: none; display: block; }

/* SCORM / HTML / H5P: feste Höhe — Paket läuft im eigenen Landscape-Format */
.lpp-frame-wrap.lpp-type-scorm,
.lpp-frame-wrap.lpp-type-html,
.lpp-frame-wrap.lpp-type-h5p_local,
.lpp-frame-wrap.lpp-type-h5p {
  height: 560px;
}
.lpp-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* PDF braucht eigene Behandlung */
.lpp-pdf-wrap {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #525659;
  display: flex;
  flex-direction: column;
}
.lpp-pdf-wrap embed {
  flex: 1;
  width: 100%;
  display: block;
}
.lpp-pdf-fallback {
  color: #fff;
  text-align: center;
  font-size: 13px;
  padding: 8px;
}
.lpp-pdf-fallback a { color: #7dd3ca; }

/* Kein Inhalt */
.lpp-no-content {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1c1b19;
  gap: 12px;
}
.lpp-no-content-icon { font-size: 48px; }
.lpp-no-content-text { font-size: 14px; color: rgba(255,255,255,.45); }

/* ── Info-Card unter dem Player ────────────────────────────── */
.lpp-player-meta {
  background: var(--lpp-surface);
  border: 1px solid var(--lpp-border);
  border-top: none;
  border-radius: 0 0 var(--lpp-radius) var(--lpp-radius);
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--lpp-shadow);
}

.lpp-course-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--lpp-text-muted);
  text-decoration: none;
}
.lpp-course-back:hover { color: var(--lpp-accent); text-decoration: none; }

.lpp-lesson-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--lpp-text);
  line-height: 1.3;
}

/* ── Navigation ────────────────────────────────────────────── */
.lpp-nav-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.lpp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--lpp-radius-sm);
  font-family: var(--lpp-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--lpp-transition), color var(--lpp-transition),
              border-color var(--lpp-transition);
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}
.lpp-btn:hover { text-decoration: none; }

.lpp-btn-primary {
  background: var(--lpp-accent);
  color: #fff;
  border-color: var(--lpp-accent);
}
.lpp-btn-primary:hover { background: var(--lpp-accent-dark); border-color: var(--lpp-accent-dark); color: #fff; }

.lpp-btn-outline {
  background: transparent;
  color: var(--lpp-accent);
  border-color: var(--lpp-accent);
}
.lpp-btn-outline:hover { background: var(--lpp-accent-soft); color: var(--lpp-accent-dark); }

.lpp-btn-cta {
  background: var(--lpp-accent);
  color: #fff;
  border-color: var(--lpp-accent);
}
.lpp-btn-cta:hover { background: var(--lpp-accent-dark); color: #fff; }

.lpp-btn-full { width: 100%; }

.lpp-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--lpp-accent-soft);
  color: var(--lpp-accent);
  border-radius: var(--lpp-radius-sm);
  font-size: 14px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR (hell, wie Hauptplayer)
   ══════════════════════════════════════════════════════════════ */

.lpp-sidebar {
  width: var(--lpp-sidebar-w);
  flex-shrink: 0;
  background: var(--lpp-surface);
  border: 1px solid var(--lpp-border);
  border-radius: var(--lpp-radius);
  display: flex;
  flex-direction: column;
  box-shadow: var(--lpp-shadow);
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
}

.lpp-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--lpp-border);
  flex-shrink: 0;
}

.lpp-sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--lpp-text);
}

.lpp-sidebar-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--lpp-text-muted);
}

.lpp-lesson-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

/* ── Lesson Items ──────────────────────────────────────────── */
.lpp-lesson-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  text-decoration: none;
  border-bottom: 1px solid var(--lpp-border-soft);
  transition: background var(--lpp-transition);
}
.lpp-lesson-item:last-child { border-bottom: none; }
.lpp-lesson-item:hover { background: var(--lpp-bg); text-decoration: none; }
.lpp-lesson-item.active { background: var(--lpp-accent-soft); }

/* Kreise — groß, grün wie Hauptplayer */
.lpp-lesson-num {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.lpp-lesson-num.default { background: var(--lpp-border); color: var(--lpp-text-muted); }
.lpp-lesson-num.current { background: var(--lpp-accent); color: #fff; }
.lpp-lesson-num.done    { background: var(--lpp-accent); color: #fff; font-size: 16px; }

.lpp-lesson-info  { flex: 1; min-width: 0; }

.lpp-lesson-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--lpp-text);
  line-height: 1.35;
  margin-bottom: 3px;
}
.lpp-lesson-item.active .lpp-lesson-name { color: var(--lpp-accent-dark); }

.lpp-lesson-type {
  font-size: 12px;
  color: var(--lpp-text-muted);
  font-weight: 500;
}

/* ── Sidebar CTA ───────────────────────────────────────────── */
.lpp-sidebar-cta {
  padding: 16px 20px;
  border-top: 1px solid var(--lpp-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.lpp-sidebar-cta-text {
  font-size: 12px;
  color: var(--lpp-text-muted);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE (< 768px): Alles gestapelt, randlos
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {

  /* Kein Außenabstand auf Mobile */
  .lpp-layout {
    flex-direction: column;
    padding: 0;
    gap: 0;
  }

  .lpp-player-col {
    width: 100%;
  }

  /* Frame: Radius weg auf Mobile */
  .lpp-frame-wrap {
    border-radius: 0;
  }

  /* SCORM/HTML/H5P auf Mobile: 9:16 Hochformat — volle Breite × 16/9 */
  .lpp-frame-wrap.lpp-type-scorm,
  .lpp-frame-wrap.lpp-type-html,
  .lpp-frame-wrap.lpp-type-h5p_local,
  .lpp-frame-wrap.lpp-type-h5p {
    height: 0;
    padding-top: 177.78%; /* 9:16 = 100 / 9 * 16 */
    position: relative;
  }
  .lpp-frame-wrap.lpp-type-scorm > *,
  .lpp-frame-wrap.lpp-type-html > *,
  .lpp-frame-wrap.lpp-type-h5p_local > *,
  .lpp-frame-wrap.lpp-type-h5p > * {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none; display: block;
  }

  /* Info-Card: kein Radius, kompakter */
  .lpp-player-meta {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 16px;
    gap: 12px;
    box-shadow: none;
  }

  .lpp-lesson-title {
    font-size: 18px;
  }

  .lpp-course-back {
    font-size: 12px;
  }

  /* Nächste-Button: volle Breite */
  .lpp-nav-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .lpp-nav-buttons .lpp-btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
  }

  /* Sidebar: volle Breite, kein Radius, kein sticky */
  .lpp-sidebar {
    width: 100%;
    position: static;
    max-height: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    border-top: 2px solid var(--lpp-border);
  }

  .lpp-sidebar-header {
    padding: 16px;
  }

  /* Lesson Items etwas kompakter */
  .lpp-lesson-item {
    padding: 12px 16px;
  }

  .lpp-lesson-num {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }

  .lpp-lesson-name {
    font-size: 14px;
  }

  .lpp-sidebar-cta {
    padding: 14px 16px;
  }

  .lpp-done-badge {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 15px;
  }
}

/* Sehr kleine Screens (< 380px) */
@media (max-width: 380px) {
  .lpp-lesson-title { font-size: 16px; }
  .lpp-lesson-num { width: 30px; height: 30px; min-width: 30px; font-size: 12px; }
  .lpp-lesson-name { font-size: 13px; }
}
