/* ═══════════════════════════════════════════════════
   edu.css — стили обучающей платформы edu.vetpodobed.pro
   Минимум для Итерации 1 (login + заглушка main + no-access).
   ═══════════════════════════════════════════════════ */

* { box-sizing: border-box; }

:root {
  --c-bg: #f7fafa;
  --c-card: #ffffff;
  --c-text: #1f2937;
  --c-muted: #6b7280;
  --c-primary: #0f766e;
  --c-primary-hover: #115e59;
  --c-primary-light: #ccfbf1;
  --c-border: #e5e7eb;
  --c-error: #b91c1c;
  --c-error-bg: #fee2e2;
  --c-success: #047857;
  --shadow-card: 0 2px 12px rgba(15, 118, 110, 0.08);
  --radius: 12px;
}

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

section.view { min-height: 100vh; }
section.view[hidden] { display: none !important; }

/* ── Boot splash ───────────────────────────────── */
#bootSplash {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--c-bg);
  z-index: 9999;
  transition: opacity 0.4s ease;
}
#bootSplash.hidden { opacity: 0; pointer-events: none; }
.boot-avatar img { width: 72px; height: 72px; border-radius: 18px; }
.boot-title {
  margin-top: 16px;
  font-size: 18px; font-weight: 600; color: var(--c-primary);
  letter-spacing: 0.3px;
}
.boot-spinner {
  margin-top: 20px;
  width: 28px; height: 28px;
  border: 3px solid var(--c-primary-light);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Логин-карточка ────────────────────────────── */
#view-login, #view-no-access {
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 32px 28px;
  width: 100%; max-width: 380px;
  text-align: center;
}
.auth-logo img { width: 64px; height: 64px; border-radius: 16px; }
.auth-title {
  margin: 16px 0 6px;
  font-size: 22px; font-weight: 700;
  color: var(--c-primary);
}
.auth-subtitle {
  margin: 0 0 24px;
  color: var(--c-muted);
  font-size: 14px;
}
.auth-help {
  margin-top: 20px;
  color: var(--c-muted);
  font-size: 13px; line-height: 1.5;
}
.auth-help a { color: var(--c-primary); }

.field { display: block; margin-bottom: 14px; text-align: left; }
.field-label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--c-text);
  margin-bottom: 6px;
}
.field input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--c-primary); }

.btn-primary {
  display: inline-block;
  width: 100%;
  padding: 12px 18px;
  font-size: 16px; font-weight: 600;
  color: #fff; background: var(--c-primary);
  border: none; border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 4px;
}
.btn-primary:hover:not(:disabled) { background: var(--c-primary-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-ghost {
  background: transparent; border: none;
  color: var(--c-text);
  font-size: 18px; cursor: pointer;
  padding: 6px 10px; border-radius: 8px;
}
.btn-ghost:hover { background: rgba(0,0,0,0.06); }

.btn-link {
  background: transparent; border: none;
  color: var(--c-primary);
  font-size: 14px; cursor: pointer;
  padding: 12px 0 4px;
  text-decoration: underline;
  display: block;
  margin: 0 auto;
}
.btn-link:hover { color: var(--c-primary-hover); }

.auth-error {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--c-error-bg);
  color: var(--c-error);
  border-radius: 8px;
  font-size: 14px; text-align: left;
}

/* ── Главная (после логина) ────────────────────── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 10;
}
.top-bar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--c-primary);
}
.top-bar-logo { width: 32px; height: 32px; border-radius: 8px; }
.top-bar-user {
  display: flex; align-items: center; gap: 10px;
  color: var(--c-muted); font-size: 14px;
}

.main-content {
  padding: 32px 20px;
  max-width: 720px; margin: 0 auto;
}
.placeholder-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 40px 28px;
  text-align: center;
}
.placeholder-icon { font-size: 48px; margin-bottom: 16px; }
.placeholder-card h2 { margin: 0 0 12px; font-size: 22px; color: var(--c-text); }
.placeholder-card p { margin: 8px 0; color: var(--c-muted); }
.placeholder-hint {
  margin-top: 16px !important;
  padding: 10px 14px;
  background: var(--c-primary-light);
  color: var(--c-primary-hover);
  border-radius: 8px;
  font-size: 13px;
}

/* ── Toast ─────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: #1f2937; color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  z-index: 9999;
  max-width: 90vw;
  text-align: center;
}
.toast-error { background: var(--c-error); }
.toast-success { background: var(--c-success); }
.toast[hidden] { display: none !important; }

/* ── Список лекций ─────────────────────────────── */
.lectures-list {
  display: flex; flex-direction: column; gap: 12px;
}
.lecture-card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.lecture-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(15,118,110,0.15);
}
.lecture-card-icon {
  width: 48px; height: 48px;
  background: var(--c-primary-light);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.lecture-card-info { flex: 1; min-width: 0; }
.lecture-card-title {
  font-weight: 600; font-size: 16px; color: var(--c-text);
}
.lecture-card-desc {
  color: var(--c-muted); font-size: 13px; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.lecture-card-arrow {
  color: var(--c-muted); font-size: 24px; flex-shrink: 0;
}

/* ── Lecture viewer ────────────────────────────── */
.lecture-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; background: #1f2937; color: #fff;
  position: sticky; top: 0; z-index: 50;
}
.lecture-bar-title {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 12px;
  font-size: 14px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lecture-bar-counter {
  color: rgba(255,255,255,0.7); font-weight: 400; font-size: 12px;
}
.lecture-bar #lectureBackBtn, .lecture-bar .btn-ghost {
  color: #fff; font-size: 18px;
}
.lecture-bar .btn-ghost:hover { background: rgba(255,255,255,0.1); }

.lecture-stage {
  position: relative;
  flex: 1;
  background: #0b1116;
  min-height: calc(100vh - 110px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.lecture-stage-inner {
  position: relative;
  max-width: 100%;
  max-height: calc(100vh - 110px);
  transition: transform 0.05s ease-out;
  cursor: crosshair;
}
.lecture-stage-empty {
  color: rgba(255,255,255,0.6);
  padding: 40px;
  text-align: center;
}
.lecture-image, .lecture-video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 110px);
  width: auto; height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.lecture-video { background: #000; }

.lecture-hotspots {
  position: absolute; inset: 0; pointer-events: none;
}
.hotspot-zone {
  position: absolute;
  border: 2px solid rgba(16,185,129,0.6);
  background: rgba(16,185,129,0.12);
  cursor: pointer;
  pointer-events: auto;
  border-radius: 4px;
  transition: background 0.15s;
}
.hotspot-zone:hover {
  background: rgba(16,185,129,0.28);
  border-color: rgba(16,185,129,0.9);
}

.lecture-pointer {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(239,68,68,0.85);
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(239,68,68,0.6);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left 0.05s linear, top 0.05s linear;
  z-index: 10;
}
/* Указка преподавателя — другой цвет (изумруд), чтобы отличалась
   от локальной указки если бы она была. В session mode локальная
   указка скрыта, остаётся только teacher pointer. */
.lecture-pointer-teacher {
  background: rgba(16,185,129,0.95);
  border-color: #fff;
  box-shadow: 0 0 12px rgba(16,185,129,0.7), 0 0 4px rgba(255,255,255,0.5);
  width: 18px; height: 18px;
}
/* В session-mode локальной указки нет — мы её просто не создаём.
   Но если бы создавали, можно было бы её скрыть так:
   .lecture-stage-inner.session-mode .lecture-pointer:not(.lecture-pointer-teacher) { display: none; }
*/

.lecture-controls {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 60;
}
.lecture-nav-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(31,41,55,0.85);
  color: #fff; border: none;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lecture-nav-btn:hover:not(:disabled) { background: rgba(31,41,55,1); }
.lecture-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Hotspot popup ─────────────────────────────── */
.hotspot-popup {
  position: fixed;
  max-width: 320px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 200;
  overflow: hidden;
}
.hotspot-popup[hidden] { display: none !important; }
.hotspot-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--c-primary);
  color: #fff;
  font-weight: 600; font-size: 14px;
}
.hotspot-popup-header .btn-ghost { color: #fff; font-size: 20px; }
.hotspot-popup-header .btn-ghost:hover { background: rgba(255,255,255,0.15); }
.hotspot-popup-content {
  padding: 12px 14px;
  font-size: 14px; line-height: 1.5;
  max-height: 240px; overflow-y: auto;
}
.hotspot-popup-content p { margin: 0 0 8px; }
.hotspot-popup-content p:last-child { margin-bottom: 0; }

/* ── Mobile ────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; }
  .main-content { padding: 20px 16px; }
  .lecture-card { padding: 12px 14px; gap: 10px; }
  .lecture-card-icon { width: 40px; height: 40px; font-size: 20px; }
  .hotspot-popup { max-width: calc(100vw - 16px); }
}
