/* Lesson Inline Editor — minimal, self-contained styles independent of Tailwind JIT */

.lie-card { margin: 0.75rem 0; border-radius: 26px; border: 1px solid #e2e8f0; background: #f8fafc; padding: 1rem; box-shadow: 0 1px 2px rgba(15,23,42,0.04); }

.lie-toolbar-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; border-bottom: 1px solid #e2e8f0; padding-bottom: 0.75rem; font-size: 0.75rem; font-weight: 500; color: #475569; }
.lie-tool { border: 1px solid #e2e8f0; background: #ffffff; color: #334155; border-radius: 0.5rem; padding: 0.375rem 0.625rem; font-size: 0.75rem; cursor: pointer; transition: background-color .15s; }
.lie-tool:hover { background: #f1f5f9; }
.lie-tool.is-active { background: #0f172a; color: #ffffff; border-color: #0f172a; }
.lie-divider { width: 1px; height: 20px; background: #e2e8f0; margin: 0 0.25rem; }

.lie-editor-host { position: relative; margin-top: 1rem; }
.lie-editable {
  min-height: 180px;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 1rem 1.25rem;
  font-size: 15px;
  line-height: 1.7;
  color: #1f2937;
  box-shadow: inset 0 1px 2px rgba(15,23,42,0.04);
  outline: none;
}
.lie-editable:focus { border-color: #94a3b8; }

.lie-float-toolbar {
  position: absolute;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transform: translateX(-50%);
  border-radius: 1rem;
  border: 1px solid #334155;
  background: #0f172a;
  color: #ffffff;
  padding: 0.4rem 0.5rem;
  box-shadow: 0 12px 30px rgba(15,23,42,0.35);
}
.lie-float-toolbar button {
  background: transparent;
  color: #ffffff;
  border: none;
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.lie-float-toolbar button:hover { background: rgba(255,255,255,0.12); }
.lie-float-toolbar .lie-italic { font-style: italic; }
.lie-float-toolbar .lie-underline { text-decoration: underline; }
.lie-float-toolbar .lie-strike { text-decoration: line-through; }

.lie-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }
.lie-btn { border-radius: 0.75rem; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.lie-btn-primary { background: #0f172a; color: #ffffff; border: 1px solid #0f172a; }
.lie-btn-primary:hover { background: #334155; }
.lie-btn-ghost { background: #ffffff; color: #334155; border: 1px solid #cbd5e1; }
.lie-btn-ghost:hover { background: #f1f5f9; }
.lie-btn-danger { background: #ffffff; color: #be123c; border: 1px solid #fecdd3; }
.lie-btn-danger:hover { background: #fff1f2; }
.lie-hint { margin-left: auto; font-size: 0.75rem; color: #94a3b8; }

/* Between-blocks insert row */
.lie-insert-row { position: relative; padding: 0.25rem 0; }
.lie-insert-line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #e2e8f0; opacity: 0; transition: opacity .15s; pointer-events: none; }
.lie-insert-row:hover .lie-insert-line,
.lie-insert-row:focus-within .lie-insert-line { opacity: 1; }
.lie-insert-toolbox {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.375rem;
  opacity: 0;
  transition: opacity .15s;
}
.lie-insert-row:hover .lie-insert-toolbox,
.lie-insert-row:focus-within .lie-insert-toolbox { opacity: 1; }
.lie-insert-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05);
}
.lie-insert-btn:hover { background: #f1f5f9; border-color: #94a3b8; }

/* Read-mode hover tag */
.lie-read {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 0.75rem;
  border-radius: 22px;
  cursor: pointer;
  transition: background-color .15s;
}
.lie-read:hover { background: #f8fafc; }
.lie-read-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #94a3b8; margin-bottom: 0.5rem; }
.lie-read-hint { opacity: 0; transition: opacity .15s; }
.lie-read:hover .lie-read-hint { opacity: 1; }

[x-cloak] { display: none !important; }

/* ============================================================
   Lesson file card (download/open material)
   used in both editor preview AND student lesson viewer.
   ============================================================ */
.lesson-file-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  margin: 0.75rem 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px -8px rgba(15, 23, 42, 0.08);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.lesson-file-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.05), 0 12px 28px -12px rgba(15, 23, 42, 0.18);
}

.lesson-file-card__icon {
  position: relative;
  flex: 0 0 56px;
  width: 56px; height: 64px;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 6px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #475569;
}
.lesson-file-card__icon svg { width: 28px; height: 28px; }
.lesson-file-card__ext {
  position: absolute;
  left: 50%; bottom: 6px;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 6px;
  background: #0f172a;
  color: #ffffff;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Per-extension accents */
.lesson-file-card--ext-pdf .lesson-file-card__icon { background: #fee2e2; color: #b91c1c; }
.lesson-file-card--ext-pdf .lesson-file-card__ext { background: #b91c1c; }
.lesson-file-card--ext-doc .lesson-file-card__icon,
.lesson-file-card--ext-docx .lesson-file-card__icon { background: #dbeafe; color: #1d4ed8; }
.lesson-file-card--ext-doc .lesson-file-card__ext,
.lesson-file-card--ext-docx .lesson-file-card__ext { background: #1d4ed8; }
.lesson-file-card--ext-xls .lesson-file-card__icon,
.lesson-file-card--ext-xlsx .lesson-file-card__icon,
.lesson-file-card--ext-csv .lesson-file-card__icon { background: #dcfce7; color: #15803d; }
.lesson-file-card--ext-xls .lesson-file-card__ext,
.lesson-file-card--ext-xlsx .lesson-file-card__ext,
.lesson-file-card--ext-csv .lesson-file-card__ext { background: #15803d; }
.lesson-file-card--ext-ppt .lesson-file-card__icon,
.lesson-file-card--ext-pptx .lesson-file-card__icon { background: #ffedd5; color: #c2410c; }
.lesson-file-card--ext-ppt .lesson-file-card__ext,
.lesson-file-card--ext-pptx .lesson-file-card__ext { background: #c2410c; }
.lesson-file-card--ext-zip .lesson-file-card__icon,
.lesson-file-card--ext-rar .lesson-file-card__icon,
.lesson-file-card--ext-7z .lesson-file-card__icon { background: #f3e8ff; color: #6b21a8; }
.lesson-file-card--ext-zip .lesson-file-card__ext,
.lesson-file-card--ext-rar .lesson-file-card__ext,
.lesson-file-card--ext-7z .lesson-file-card__ext { background: #6b21a8; }
.lesson-file-card--ext-mp3 .lesson-file-card__icon,
.lesson-file-card--ext-wav .lesson-file-card__icon,
.lesson-file-card--ext-m4a .lesson-file-card__icon,
.lesson-file-card--ext-mp4 .lesson-file-card__icon,
.lesson-file-card--ext-mov .lesson-file-card__icon { background: #e0e7ff; color: #4338ca; }
.lesson-file-card--ext-mp3 .lesson-file-card__ext,
.lesson-file-card--ext-wav .lesson-file-card__ext,
.lesson-file-card--ext-m4a .lesson-file-card__ext,
.lesson-file-card--ext-mp4 .lesson-file-card__ext,
.lesson-file-card--ext-mov .lesson-file-card__ext { background: #4338ca; }

.lesson-file-card__body {
  flex: 1 1 auto;
  min-width: 0;
}
.lesson-file-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}
.lesson-file-card__meta {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #64748b;
}
.lesson-file-card__meta span {
  display: inline-flex; align-items: center;
  padding: 1px 8px;
  background: #f1f5f9;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.lesson-file-card__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.lesson-file-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, transform .1s;
}
.lesson-file-card__btn svg { width: 16px; height: 16px; }
.lesson-file-card__btn:active { transform: translateY(1px); }
.lesson-file-card__btn--primary {
  background: #0f172a;
  color: #ffffff !important;
  border-color: #0f172a;
}
.lesson-file-card__btn--primary:hover { background: #1e293b; border-color: #1e293b; }
.lesson-file-card__btn--ghost {
  background: #ffffff;
  color: #334155 !important;
  border-color: #e2e8f0;
}
.lesson-file-card__btn--ghost:hover { background: #f8fafc; border-color: #cbd5e1; }
.lesson-file-card__btn--danger {
  background: #ffffff;
  color: #b91c1c !important;
  border-color: #fecaca;
}
.lesson-file-card__btn--danger:hover { background: #fee2e2; }

@media (max-width: 600px) {
  .lesson-file-card { flex-wrap: wrap; }
  .lesson-file-card__actions { width: 100%; justify-content: flex-start; }
  .lesson-file-card__btn span { display: inline; }
}
