/* ── Course layout ──────────────────────────────────────────── */
.lg-layout {
  display: flex;
  align-items: flex-start;
  background: var(--night, #1E2235);
  min-height: calc(100vh - 56px);
}

/* ── Sidebar ────────────────────────────────────────────────── */
.lg-sidebar {
  width: 310px;
  flex-shrink: 0;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  z-index: 15;
}
.lg-sidebar-head {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky; top: 0;
  background: var(--navy); z-index: 2;
}
.lg-sidebar-title {
  font-size: 13px; font-weight: 700; color: #fff;
  margin-bottom: 10px; letter-spacing: -0.2px;
}
.lg-sidebar-prog-wrap {}
.lg-sidebar-prog-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: rgba(255,255,255,0.45);
  margin-bottom: 5px; font-weight: 600;
}
.lg-sidebar-prog-val { color: var(--teal-light); }
.lg-sidebar-prog-track {
  height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden;
}
.lg-sidebar-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.lg-sidebar-mod { border-bottom: 1px solid rgba(255,255,255,0.06); }
.lg-sidebar-mod-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px 8px;
}
.lg-sidebar-mod-icon { font-size: 15px; flex-shrink: 0; }
.lg-sidebar-mod-name {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.5);
  text-transform: uppercase; letter-spacing: 0.5px;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lg-sidebar-mod-count {
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.08);
  padding: 2px 7px; border-radius: 10px;
  flex-shrink: 0;
}

.lg-sidebar-lec-list { padding: 0 8px 10px; }
.lg-sidebar-lec {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 10px;
  background: none; border: none; border-radius: 8px;
  cursor: pointer; text-align: left;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.lg-sidebar-lec:hover { background: rgba(255,255,255,0.08); }
.lg-sidebar-lec-active {
  background: var(--teal) !important;
}
.lg-sidebar-lec-active .lg-sidebar-lec-name { color: #fff; font-weight: 700; }
.lg-sidebar-lec-done .lg-sidebar-lec-name { color: rgba(255,255,255,0.45); }
.lg-sidebar-lec-locked { opacity: 0.4; cursor: not-allowed !important; }
.lg-sidebar-lec-locked:hover { background: none !important; }

.lg-sidebar-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.5);
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.lg-sidebar-lec-active .lg-sidebar-num {
  background: rgba(255,255,255,0.25); color: #fff;
}
.lg-sidebar-lec-name {
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.65);
  line-height: 1.35; flex: 1; min-width: 0;
}

.lg-sidebar-reset {
  padding: 12px 14px; margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.lg-sidebar-reset button {
  background: none; border: none; color: rgba(255,255,255,0.25);
  font-size: 11px; cursor: pointer; padding: 4px;
  transition: color 0.2s;
}
.lg-sidebar-reset button:hover { color: rgba(255,255,255,0.5); }

/* ── Main content ───────────────────────────────────────────── */
.lg-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--night, #1E2235);
  font-size: 12px;
}
.lg-main h2 { font-size: 12px; font-weight: 700; margin: 0; }

/* Mobile bar (hidden on desktop) */
.lg-mobile-bar {
  display: none;
  align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--navy);
  position: -webkit-sticky;
  position: sticky;
  top: 56px; z-index: 10;
}
.lg-menu-btn {
  flex-shrink: 0;
  padding: 7px 12px;
  background: rgba(255,255,255,0.12);
  border: none; border-radius: 6px;
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.lg-mobile-lec-name {
  font-size: 12px; color: rgba(255,255,255,0.6);
  font-weight: 600; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Constrain all main content to same width */
.lg-main > .lg-video-wrap,
.lg-main > .lg-lec-info-bar,
.lg-main > .lg-nav-bar,
.lg-main > .lg-section {
  max-width: 1100px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Video */
.lg-video-wrap {
  background: #000;
  width: 100%;
}
.lg-video-ratio {
  position: relative;
  width: 100%;
  /* 16:9 dar niciodată mai înalt decât viewport minus nav+infobar+navbar */
  padding-bottom: min(56.25%, calc(100vh - 190px));
  height: 0;
  overflow: hidden;
}
.lg-video-ratio iframe,
.lg-video-ratio video {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: none;
}

/* Lecture info bar */
.lg-lec-info-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px;
  background: var(--night-card, #2A3050);
  border-bottom: 1px solid rgba(245, 240, 232, 0.10);
  flex-wrap: wrap;
}
.lg-lec-info-left { flex: 1; min-width: 0; }
.lg-lec-mod-badge {
  display: inline-block;
  font-size: 11px; font-weight: 700; color: var(--emerald, #34D399);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.lg-lec-title {
  font-size: 12px; font-weight: 700; color: var(--cream, #FAFAF6);
  line-height: 1.25; margin: 0;
}
.lg-mark-done-btn {
  flex-shrink: 0;
  padding: 9px 16px;
  background: var(--teal); color: #fff;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.lg-mark-done-btn:hover { background: var(--teal-light); transform: translateY(-1px); }
.lg-mark-done-btn:active { transform: translateY(0); }
.lg-done-area {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.lg-done-badge {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 12px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--emerald, #34D399); font-size: 13px; font-weight: 700;
  border-radius: 8px; white-space: nowrap;
}
.lg-reset-lec-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 8px; border: 1.5px solid rgba(245, 240, 232, 0.10);
  background: transparent; color: var(--cream-dim, #D0C9BC); font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: all .15s;
}
.lg-reset-lec-btn:hover { border-color: #e74c3c; color: #e74c3c; background: rgba(231,76,60,.06); }

/* Prev/Next nav */
.lg-nav-bar {
  display: flex; gap: 8px;
  padding: 7px 16px;
  background: var(--night-card, #2A3050);
  border-bottom: 1px solid rgba(245, 240, 232, 0.10);
}
.lg-nav-btn {
  flex: 1; padding: 7px 12px;
  background: none; border: 1.5px solid rgba(245, 240, 232, 0.15);
  border-radius: 8px; color: var(--cream, #FAFAF6); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s;
}
.lg-nav-btn:hover:not(:disabled) { border-color: var(--emerald, #34D399); color: var(--emerald, #34D399); background: rgba(52, 211, 153, 0.12); }
.lg-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.lg-nav-next { background: var(--emerald, #34D399); color: var(--night, #1E2235); border-color: var(--emerald, #34D399); font-weight: 700; }
.lg-nav-next:hover:not(:disabled) { background: var(--emerald-light, #6EE7B7); border-color: var(--emerald-light, #6EE7B7); color: var(--night, #1E2235); }

/* Sections (notes, comments) */
.lg-section {
  background: var(--night-card, #2A3050);
  border-bottom: 1px solid rgba(245, 240, 232, 0.10);
  padding: 16px 24px;
}
.lg-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--cream, #FAFAF6);
  margin-bottom: 12px; letter-spacing: -0.1px;
}
.lg-section-title i { color: var(--emerald, #34D399); font-size: 13px; }
.lg-note-status {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: var(--emerald, #34D399); letter-spacing: 0.3px;
}

/* Notes textarea */
.lg-note-area {
  width: 100%; box-sizing: border-box;
  min-height: 140px;
  padding: 12px 14px;
  background: var(--night-elevated, #353D60); border: 1.5px solid rgba(245, 240, 232, 0.10);
  border-radius: 10px; font-size: inherit; color: var(--cream, #FAFAF6);
  font-family: inherit; line-height: 1.55; resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow-y: visible;
}
.lg-note-area:focus {
  outline: none; border-color: var(--gold, #C6A44E);
  box-shadow: 0 0 0 3px rgba(198, 164, 78, 0.15);
  background: var(--night-surface, #404870);
}
.lg-note-area::placeholder { color: var(--cream-muted, #A09888); }

/* Chat inside lg-section */
.lg-chat-messages {
  max-height: none;
  overflow-y: visible;
}

/* ── Mobile overrides ───────────────────────────────────────── */
@media (max-width: 680px) {
  .lg-layout { flex-direction: column; position: relative; }

  .lg-sidebar {
    position: fixed; top: 0; left: -280px; bottom: 0;
    width: 280px; z-index: 100;
    transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
    box-shadow: none;
    height: 100vh;
  }
  .lg-sidebar.lg-sidebar-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .lg-sidebar-backdrop {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
  }
  .lg-sidebar-backdrop-visible {
    display: block;
  }
  .lg-mobile-bar {
    display: flex;
    position: fixed; top: 56px; left: 0; right: 0;
    z-index: 10;
  }
  .lg-main { padding-top: 44px; }
  .lg-main { width: 100%; }

  .lg-lec-info-bar { flex-direction: column; gap: 8px; }
  .lg-mark-done-btn, .lg-done-badge { width: 100%; justify-content: center; }

  .lg-lec-title { font-size: 12px; }
}
