/* Branike LMS — Lesson Full-Screen Layout */

/* ── Materiály na stiahnutie ──────────────────────────────────────────────── */
.blms-lesson-resources { margin: 24px 0 8px; }
.blms-lesson-resources__title { font-size: 1rem; margin: 0 0 10px; }
.blms-lesson-resources__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.blms-lesson-resources__link {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 14px; border: 1px solid #e2e2ea; border-radius: 8px;
    text-decoration: none; color: #1a1a1a; background: #fafafb; transition: border-color .15s, background .15s;
}
.blms-lesson-resources__link:hover {
    border-color: var(--blms-accent, #7c3aed);
    background: color-mix(in srgb, var(--blms-accent, #7c3aed) 6%, #fff);
}
.blms-lesson-resources__name { font-weight: 500; }
.blms-lesson-resources__dl { font-size: .82rem; font-weight: 600; color: var(--blms-accent, #7c3aed); white-space: nowrap; }

/* Accent default — keď kurz nemá vlastný accent (téma), padni na brand farbu
   palety, NIE na zelenú. Inline `:root{--blms-accent:...}` z PHP (keď je accent
   nastavený) toto prepíše, lebo sa pridáva za týmto súborom. Bez tohto by
   lesson page padala na zelený fallback `#1d6038` (frontend.css to má tiež). */
:root {
    --blms-accent: var(--paletteColor1, #1d6038);
}

/* Reset témy pre lesson stránku */
.blms-lesson-body {
    margin: 0;
    padding: 0;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    overflow: hidden;
}

/* Skryť admin bar posun */
.blms-lesson-body.admin-bar .blms-app {
    top: 32px;
    height: calc(100vh - 32px);
}
@media screen and (max-width: 782px) {
    .blms-lesson-body.admin-bar .blms-app {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

/* ── App kontajner ──────────────────────────────────────────────────────────── */
.blms-app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    z-index: 9999;
}

/* ── Top bar ────────────────────────────────────────────────────────────────── */
.blms-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    flex-shrink: 0;
    gap: 12px;
    z-index: 10;
}

.blms-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.blms-topbar__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.blms-topbar__back:hover { background: #f0f0f0; color: #111; }
.blms-topbar__back svg  { width: 20px; height: 20px; }

.blms-topbar__course {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.blms-topbar__right { flex-shrink: 0; }

.blms-topbar__sidebar-toggle {
    display: none; /* zobrazí sa na mobile */
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    transition: background .15s;
}
.blms-topbar__sidebar-toggle svg { width: 18px; height: 18px; }
.blms-topbar__sidebar-toggle:hover { background: #f5f5f5; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.blms-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.blms-sidebar {
    width: 300px;
    min-width: 300px;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.blms-sidebar__inner {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.blms-sidebar__inner::-webkit-scrollbar { width: 4px; }
.blms-sidebar__inner::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.blms-sidebar__course-title {
    padding: 16px 20px 8px;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    line-height: 1.4;
    border-bottom: 1px solid #f0f0f0;
}

/* Progress */
.blms-sidebar__progress { padding: 12px 20px; border-bottom: 1px solid #f0f0f0; }
.blms-sidebar__progress-bar {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.blms-sidebar__progress-fill {
    height: 100%;
    background: var(--blms-accent, #1d6038);
    border-radius: 3px;
    transition: width .4s ease;
}
.blms-sidebar__progress-label { font-size: 12px; color: #777; }

/* Nav */
.blms-sidebar__nav { padding: 8px 0; }

/* Section item */
.blms-section-item { border-bottom: 1px solid #f3f3f3; }

.blms-section-item__header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #222;
    transition: background .15s;
}
.blms-section-item__header:hover { background: #f8f8f8; }

.blms-section-item__title { flex: 1; }
.blms-section-item__count { font-size: 11px; color: #999; font-weight: 400; flex-shrink: 0; }
.blms-section-item__arrow {
    width: 16px; height: 16px;
    color: #aaa;
    transition: transform .2s;
    flex-shrink: 0;
}
.blms-section-item.is-open .blms-section-item__arrow { transform: rotate(180deg); }

/* Lesson list hidden by default */
.blms-section-item__lessons {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.blms-section-item.is-open .blms-section-item__lessons {
    max-height: 2000px;
}

/* Lesson nav item */
.blms-lesson-nav-item { border: none; }

.blms-lesson-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 32px;
    text-decoration: none;
    color: #444;
    font-size: 13px;
    line-height: 1.4;
    transition: background .15s;
}
.blms-lesson-nav-link:hover { background: #f5f5f5; color: #111; }

.blms-lesson-nav-item.is-active .blms-lesson-nav-link {
    background: #f0f8f4;
    color: var(--blms-accent, #1d6038);
    font-weight: 600;
}
.blms-lesson-nav-item.is-done .blms-lesson-nav-link { color: #888; }

.blms-lesson-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.blms-lesson-nav-icon svg { width: 14px; height: 14px; }
.blms-lesson-nav-item.is-done .blms-lesson-nav-icon svg { color: var(--blms-accent, #1d6038); }
.blms-lesson-nav-item.is-active .blms-lesson-nav-icon svg { color: var(--blms-accent, #1d6038); }

.blms-lesson-nav-title { flex: 1; }
.blms-lesson-nav-dur   { font-size: 11px; color: #bbb; flex-shrink: 0; }

.blms-lesson-nav-link--locked { cursor: default; }
.blms-lesson-nav-link--locked .blms-lesson-nav-title { color: #bbb; }

/* Event-naviazaná lekcia (hybridný kurz) */
.blms-event-note {
    margin: 0 0 16px;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--blms-accent, #7c3aed) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--blms-accent, #7c3aed) 30%, #fff);
    border-radius: 10px;
    font-size: 14px;
    color: #333;
}
.blms-event-note a { color: var(--blms-accent, #7c3aed); font-weight: 600; }

/* ── Main content ───────────────────────────────────────────────────────────── */
.blms-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: #fff;
}

.blms-content__inner {
    flex: 1;
    overflow-y: auto;
    padding: 0 48px 32px;  /* top=0: player začína hneď od vrchu */
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.blms-content__inner::-webkit-scrollbar { width: 4px; }
.blms-content__inner::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.blms-content__type {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--blms-accent, #1d6038);
    margin: 20px 0 6px; /* top margin: player je hore, typ label je pod ním */
}

.blms-content__title {
    font-size: 22px;
    font-weight: 700;
    color: #111;
    margin: 0 0 16px;
    line-height: 1.3;
}

/* Player v content — plná šírka, bez zaoblených rohov (dotýka sa topbaru) */
.blms-content__player {
    margin-left: -48px;   /* preruší side padding → plná šírka */
    margin-right: -48px;
    margin-bottom: 0;
}

/* Zaoblené rohy a margin-bottom z frontend.css zrušiť */
.blms-content__player .blms-player {
    border-radius: 0;
    margin-bottom: 0;
}

/* Audio nie je čierny full-bleed box — zruš negatívne okraje, daj odsadenie. */
.blms-content__player:has(.blms-player--audio) {
    margin-left: 0;
    margin-right: 0;
    padding-top: 20px;
    padding-bottom: 28px;   /* medzera pred názvom lekcie */
}
.blms-content__player .blms-player--audio {
    border-radius: 12px;
    margin-bottom: 0;
}

/* Diskusia — vnútri inner, oddelená čiarou */
.blms-content__discussion {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f0f0f0;
}

.blms-content__body {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}
.blms-content__body p  { margin: 0 0 1em; }
.blms-content__body h2 { font-size: 20px; margin: 1.5em 0 .5em; }
.blms-content__body h3 { font-size: 17px; margin: 1.2em 0 .5em; }
.blms-content__body ul, .blms-content__body ol { padding-left: 1.5em; margin-bottom: 1em; }
.blms-content__body code { background: #f4f4f4; padding: 2px 6px; border-radius: 3px; font-size: 13px; }

/* ── Bottom nav ─────────────────────────────────────────────────────────────── */
.blms-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 84px 14px 48px; /* right 84px = clearance pre FAB (52px + 24px margin + 8px rezerva) */
    background: #fff;
    border-top: 1px solid #e8e8e8;
    flex-shrink: 0;
}

.blms-bottom-nav__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.blms-bottom-nav__btn:hover { background: #eee; color: #111; }
.blms-bottom-nav__btn svg { width: 18px; height: 18px; }

.blms-bottom-nav__complete {
    background: var(--blms-accent, #1d6038);
    color: #fff;
    border-color: var(--blms-accent, #1d6038);
}
.blms-bottom-nav__complete:hover { background: color-mix(in srgb, var(--blms-accent, #1d6038) 82%, #000); color: #fff; }

.blms-done-badge {
    font-size: 14px;
    font-weight: 600;
    color: var(--blms-accent, #1d6038);
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .blms-topbar__sidebar-toggle { display: flex; }

    .blms-sidebar {
        position: fixed;
        top: 56px;
        left: -300px;
        bottom: 0;
        z-index: 20;
        transition: left .25s ease;
        box-shadow: 2px 0 12px rgba(0,0,0,.1);
    }
    .blms-sidebar.is-open { left: 0; }

    .blms-content__inner { padding: 20px 20px 80px; }
    .blms-bottom-nav     { padding: 12px 80px 12px 20px; } /* right clearance pre FAB */

    .blms-content__title { font-size: 20px; }
}
