/* liquid-learn.css — Liquid v2.0 Learn Page split layout */

.ll-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: #06090D;
  font-family: 'Outfit', sans-serif;
  color: #FAF7F0;
}

.ll-topbar {
  height: 44px;
  background: rgba(0,0,0,0.7);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  z-index: 10;
}

.ll-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8a8580;
  font-family: 'Inter', sans-serif;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s;
  white-space: nowrap;
}
.ll-back:hover { border-color: rgba(255,255,255,0.14); color: #d4cfc8; }

.ll-title-wrap { flex: 1; text-align: center; min-width: 0; }
.ll-section-kicker {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #4a4540;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 1px;
}
.ll-lesson-title {
  font-size: 12px;
  font-weight: 600;
  color: #d4cfc8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ll-progress-wrap { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ll-progress-bar  { width: 80px; height: 2px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.ll-progress-fill { height: 100%; background: #E87C2A; border-radius: 2px; transition: width 0.4s; }
.ll-progress-pct  { font-size: 10px; color: #E87C2A; font-family: 'JetBrains Mono', monospace; }

.ll-main { flex: 1; display: flex; min-height: 0; }

.ll-video-col {
  width: 59%;
  position: relative;
  background: #000;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
}

.ll-webgl-strip {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, rgba(232,124,42,0.25), transparent);
  opacity: 0.6;
  pointer-events: none;
  z-index: 2;
}

.ll-webgl-glow {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: radial-gradient(ellipse 70% 100% at 50% 100%, rgba(232,124,42,0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 2;
}

.ll-player-wrap { flex: 1; position: relative; }
.ll-player-wrap > * { width: 100% !important; height: 100% !important; }

.ll-sidebar {
  flex: 1;
  background: #11161D;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.ll-lesson-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.ll-lesson-header-title { font-size: 14px; font-weight: 600; color: #e0dbd4; margin-bottom: 4px; }
.ll-lesson-header-meta {
  display: flex; gap: 12px;
  font-size: 10px; color: #4a4540;
  font-family: 'JetBrains Mono', monospace;
}
.ll-lesson-header-meta span { color: #E87C2A; }

.ll-scroll { flex: 1; overflow-y: auto; }
.ll-scroll::-webkit-scrollbar { width: 3px; }
.ll-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.ll-section { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ll-section-label {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: #4a4540; font-family: 'Inter', sans-serif;
  margin-bottom: 8px;
}

.ll-curr-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 7px; margin-bottom: 1px;
  cursor: pointer; transition: background 0.15s;
}
.ll-curr-item:hover { background: rgba(255,255,255,0.03); }
.ll-curr-item.ll-active { background: rgba(232,124,42,0.08); }

.ll-curr-num {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 7px; font-family: 'JetBrains Mono', monospace; flex-shrink: 0;
}
.ll-curr-num.done { background: rgba(232,124,42,0.15); color: #E87C2A; }
.ll-curr-num.curr { background: #E87C2A; color: #0a0a0a; font-weight: 700; }
.ll-curr-num.todo { background: rgba(255,255,255,0.05); color: #3a3530; }

.ll-curr-title { font-size: 11px; color: #6a6560; font-family: 'Inter', sans-serif; flex: 1; }
.ll-curr-title.active { color: #d0cbc4; }
.ll-curr-dur { font-size: 9px; color: #3a3530; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }
.ll-curr-ring { flex-shrink: 0; }

.ll-note-ts { font-size: 10px; color: #E87C2A; font-family: 'JetBrains Mono', monospace; margin-bottom: 6px; }
.ll-note-area {
  width: 100%; padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; font-size: 11px; color: #8a8580;
  font-family: 'Inter', sans-serif; resize: none; line-height: 1.6;
  outline: none; transition: border-color 0.2s;
}
.ll-note-area:focus { border-color: rgba(232,124,42,0.3); }

.ll-ai-bubble {
  background: rgba(232,124,42,0.05);
  border: 1px solid rgba(232,124,42,0.12);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.ll-ai-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ll-ai-avatar {
  width: 18px; height: 18px; border-radius: 50%;
  background: #E87C2A; display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; color: #0a0a0a; flex-shrink: 0;
}
.ll-ai-name { font-size: 10px; font-weight: 600; color: #E87C2A; }
.ll-ai-text { font-size: 11px; color: #a09890; font-family: 'Inter', sans-serif; line-height: 1.6; }

/* ── AI Tutor — riquadro conversazione scrollabile ── */
.ll-ai-conv {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.ll-ai-conv::-webkit-scrollbar { width: 4px; }
.ll-ai-conv::-webkit-scrollbar-track { background: transparent; }
.ll-ai-conv::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }
.ll-ai-conv::-webkit-scrollbar-thumb:hover { background: rgba(232,124,42,0.32); }
.ll-ai-conv { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }

.ll-ai-empty {
  font-size: 11px;
  color: #a09890;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}

.ll-ai-msg {
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  line-height: 1.55;
  padding: 7px 10px;
  border-radius: 9px;
  max-width: 92%;
  white-space: pre-wrap;
  word-break: break-word;
}
.ll-ai-msg-user {
  align-self: flex-end;
  background: rgba(232,124,42,0.15);
  color: #FAF7F0;
  border: 1px solid rgba(232,124,42,0.22);
}
.ll-ai-msg-bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.04);
  color: #FAF7F0;
  border: 1px solid rgba(255,255,255,0.06);
}

.ll-ai-send-disabled { opacity: 0.4; pointer-events: none; }

.ll-ai-typing { display: flex; gap: 3px; align-items: center; padding: 4px 0; }
.ll-ai-typing span {
  width: 4px; height: 4px; border-radius: 50%;
  background: #E87C2A; opacity: 0.6;
  animation: ll-dot 1.2s infinite;
}
.ll-ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ll-ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ll-dot { 0%,80%,100%{opacity:0.2} 40%{opacity:0.9} }

.ll-ai-input-row { display: flex; gap: 6px; }
.ll-ai-input {
  flex: 1; height: 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; font-size: 11px; color: #8a8580;
  font-family: 'Inter', sans-serif; padding: 0 10px;
  outline: none; transition: border-color 0.2s;
}
.ll-ai-input:focus { border-color: rgba(232,124,42,0.3); }
.ll-ai-send {
  min-width: 40px; min-height: 40px; padding: 0;
  background: rgba(232,124,42,0.15);
  border: 1px solid rgba(232,124,42,0.25);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: background 0.2s;
}
.ll-ai-send:hover { background: rgba(232,124,42,0.25); }

/* ── Transcript panel — inline sotto il video (Opzione C) ── */
.ll-transcript-panel {
  flex-shrink: 0;
  background: #0A0E13;
  border-top: 1px solid rgba(255,255,255,0.06);
  max-height: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 3;
  position: relative;
}

.ll-transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}

.ll-transcript-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 600;
  color: #8a8580;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-family: 'Inter', sans-serif;
}

.ll-transcript-cc {
  font-size: 8px;
  padding: 1px 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  color: #6a6560;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.ll-transcript-meta {
  font-size: 9px;
  color: #4a4540;
  font-family: 'JetBrains Mono', monospace;
}

.ll-transcript-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 2px;
}
.ll-transcript-body::-webkit-scrollbar { width: 3px; }
.ll-transcript-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

/* Override stili del VideoTranscriptViewer dentro il pannello */
.ll-transcript-body .transcript-content {
  padding: 4px 0;
}
.ll-transcript-body .transcript-segment {
  padding: 5px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.ll-transcript-body .transcript-segment:hover {
  background: rgba(255,255,255,0.03);
}
.ll-transcript-body .transcript-segment.highlighted,
.ll-transcript-body .transcript-segment.active {
  background: rgba(232,124,42,0.06);
}
.ll-transcript-body .transcript-timestamp {
  font-size: 10px;
  color: #E87C2A;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  padding-top: 1px;
  min-width: 38px;
}
.ll-transcript-body .transcript-text {
  font-size: 12px;
  color: #6a6560;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}
.ll-transcript-body .transcript-segment.highlighted .transcript-text,
.ll-transcript-body .transcript-segment.active .transcript-text {
  color: #d4cfc8;
}
/* Nasconde elementi non necessari nel contesto compatto */
.ll-transcript-body .transcript-search,
.ll-transcript-body .transcript-loading .spinner-border {
  display: none;
}
.ll-transcript-body .transcript-loading p {
  font-size: 11px;
  color: #4a4540;
  font-family: 'Inter', sans-serif;
  padding: 8px 14px;
}
.ll-transcript-body .transcript-error {
  font-size: 11px;
  color: #4a4540;
  font-family: 'Inter', sans-serif;
  padding: 8px 14px;
  background: none;
  border: none;
}

@media (max-width: 768px) {
  .ll-main { flex-direction: column; }
  .ll-video-col { width: 100%; height: 56vw; flex-shrink: 0; }
  .ll-sidebar { flex: 1; }
}
