/* ══════════════════════════════════════════════════════════════════
   Shared Block Element Styles
   Used by: Admin Editor (block-editor.html) + Training Web (React)
   Theme-agnostic via --el-* custom properties (dark defaults)
   ══════════════════════════════════════════════════════════════════ */

:root {
  --el-bg: var(--surface-page, #09090b);
  --el-card: var(--surface-card, #18181b);
  --el-border: var(--border, #27272a);
  --el-text: var(--text-primary, #fafafa);
  --el-text-secondary: var(--text-secondary, #a1a1aa);
  --el-text-muted: var(--text-muted, #71717a);
  --el-accent: var(--brand, #ff6b00);
  --el-blue: var(--info, #3b82f6);
  --el-green: var(--success, #06d6a0);
  --el-red: var(--error, #ef4444);
  --el-warn: var(--warning, #f59e0b);
  --el-success: var(--success, #06d6a0);
  --el-danger: var(--error, #ef4444);
  --el-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --el-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --el-radius: 8px;
  --el-radius-sm: 6px;
}

/* ── Prose ── */
.el-prose { font-size: 15px; line-height: 1.7; color: var(--el-text-secondary); }
.el-prose p { margin-bottom: 12px; }
.el-prose strong { color: var(--el-text); }
.el-prose a { color: var(--el-accent); }
.el-prose ul, .el-prose ol { margin: 8px 0 12px 20px; }

/* ── Heading ── */
.el-heading { margin: 24px 0 12px; color: var(--el-text); }
.el-heading h2 { font-size: 22px; font-weight: 700; }
.el-heading h3 { font-size: 18px; font-weight: 600; }
.el-heading h4 { font-size: 16px; font-weight: 600; }

/* ── Tip (border-left variant) ── */
.el-tip {
  padding: 16px 20px;
  border-radius: var(--el-radius);
  margin: 16px 0;
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--el-text-secondary);
  border-left: 4px solid;
}
.el-tip--info    { background: rgba(255,107,0,0.06); border-color: var(--el-accent); }
.el-tip--success { background: rgba(6,214,160,0.06); border-color: var(--el-green); }
.el-tip--warning { background: rgba(245,158,11,0.06); border-color: var(--el-warn); }
.el-tip--danger  { background: rgba(239,68,68,0.06); border-color: var(--el-danger); }
.el-tip-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Callout (left accent + colored bg) ── */
.el-callout {
  border-radius: var(--el-radius-sm);
  padding: 16px 18px;
  margin: 16px 0;
  border-left: 3px solid var(--el-accent);
}
.el-callout--concept    { background: rgba(59,130,246,0.08);  border-left-color: var(--el-blue); }
.el-callout--important  { background: rgba(255,107,0,0.08);   border-left-color: var(--el-accent); }
.el-callout--regulation { background: rgba(239,68,68,0.08);   border-left-color: var(--el-red); }
.el-callout-title { font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--el-text); display: flex; align-items: center; gap: 8px; }
.el-callout-body { font-size: 13px; color: var(--el-text-secondary); line-height: 1.5; }
.el-callout-body p { margin-bottom: 8px; }
.el-callout-body p:last-child { margin-bottom: 0; }

/* ── Divider ── */
.el-divider { height: 1px; background: var(--el-border); margin: 20px 0; opacity: .6; }

/* ── Image (card-wrapped, optional lightbox) ── */
.el-image {
  position: relative;
  background: var(--el-card);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  overflow: hidden;
  margin: 16px 0;
}
.el-image--small { max-width: 300px; }
.el-image--medium { max-width: 500px; }
.el-image--full { max-width: 100%; }
.el-image img { width: 100%; display: block; }
.el-image figcaption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--el-text-muted);
  border-top: 1px solid var(--el-border);
}
.el-image-placeholder {
  width: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--el-text-muted);
  font-size: 32px;
  opacity: .3;
}

/* Lightbox-fähiges Bild */
.el-image-lightbox .el-image-wrap {
  position: relative;
  cursor: zoom-in;
}
.el-image-expand {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  z-index: 1;
}
.el-image-expand svg { width: 18px; height: 18px; }

/* Touch/Mobile: Icon immer leicht sichtbar */
@media (hover: none) {
  .el-image-expand { opacity: 0.4; }
}
@media (max-width: 480px) {
  .el-image-expand { width: 28px; height: 28px; bottom: 6px; right: 6px; }
  .el-image-expand svg { width: 15px; height: 15px; }
}

/* ── Annotated Image ── */
.el-annotated { margin: 16px 0; }
.el-annotated-img {
  position: relative;
  display: inline-block;
  width: 100%;
  background: var(--el-card);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  overflow: hidden;
}
.el-annotated-img img { width: 100%; display: block; }
.el-anno-marker {
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--el-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transform: translate(-50%, -50%);
  cursor: default;
}
.el-anno-legend { margin-top: 12px; font-size: 14px; line-height: 1.6; }
.el-anno-legend-item { display: flex; gap: 8px; margin-bottom: 4px; }
.el-anno-num { color: var(--el-accent); font-weight: 700; min-width: 24px; }

/* ── Spec List — mobile-first: 1-column, 2-column on wider screens ── */
.el-spec-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 16px 0; }
.el-spec-card {
  background: var(--el-card);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius-sm);
  padding: 12px 14px;
}
.el-spec-label {
  font-family: var(--el-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--el-text-muted);
  margin-bottom: 4px;
}
.el-spec-value {
  font-family: var(--el-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--el-text);
}

/* ── Table (key_value_table + color_legend table mode) ── */
.el-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.el-table th,
.el-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--el-border); }
.el-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--el-text-secondary);
  font-weight: 600;
}
.el-table td { color: var(--el-text-secondary); }
.el-table-key { font-weight: 600; color: var(--el-accent) !important; }
/* .el-table tr:hover → moved to @media (hover: hover) */

/* ── Color Legend — mobile-first: column, row on wider screens ── */
.el-cl-badges { display: flex; flex-direction: column; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.el-cl-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--el-card);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius-sm);
  font-size: 12px;
  color: var(--el-text-secondary);
}
.el-cl-swatch { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; }
.el-cl-swatch-cell {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.1);
}

/* ── Hotspot Image (interactive — base styles for shared CSS) ── */
.el-hotspot { margin: 16px 0; }
.el-hotspot-container {
  position: relative;
  display: inline-block;
  width: 100%;
  background: var(--el-card);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  overflow: hidden;
}
.el-hotspot-container img { width: 100%; display: block; }
.el-hs-zone {
  position: absolute;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all .2s;
  background: transparent;
}
.el-hs-zone.active {
  border-color: var(--el-accent, #ff6b00);
  background: transparent;
  box-shadow: 0 0 12px rgba(255,107,0,0.3);
}
/* .el-hs-zone:hover → moved to @media (hover: hover) */
.el-hs-label {
  position: absolute;
  width: 28px;
  height: 28px;
  background: var(--el-accent);
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 2;
  transition: transform .15s, box-shadow .15s;
}
.el-hs-label::before {
  content: '';
  position: absolute;
  top: -8px; left: -8px; right: -8px; bottom: -8px;
}
.el-hs-label.active {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
/* .el-hs-label:hover → moved to @media (hover: hover) */
.el-hs-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--el-card);
  color: var(--el-text);
  border: 1px solid var(--el-border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10;
  pointer-events: none;
}
/* .el-hs-label:hover .el-hs-tooltip → moved to @media (hover: hover) */
.el-hs-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.el-hs-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid var(--el-border);
  cursor: pointer;
  transition: all .15s;
  font-size: 13px;
  color: var(--el-text-secondary);
}
.el-hs-legend-item.active {
  border-color: var(--el-accent);
  background: rgba(99,102,241,0.1);
}
/* .el-hs-legend-item:hover → moved to @media (hover: hover) */
.el-hs-legend-num {
  background: var(--el-accent);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Quiz (interactive — base styles) ── */
.el-quiz {
  border: 2px solid rgba(59,130,246,0.3);
  border-radius: var(--el-radius);
  padding: 20px;
  margin: 16px 0;
  background: rgba(59,130,246,0.03);
}
.el-quiz-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--el-accent);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.el-quiz-question { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--el-text); }
.el-quiz-option {
  padding: 12px 16px;
  min-height: 44px;
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
  font-size: 14px;
  color: var(--el-text-secondary);
  display: flex;
  align-items: center;
}
/* .el-quiz-option:hover → moved to @media (hover: hover) */
.el-quiz-option.selected { border-color: var(--el-accent); background: rgba(255,107,0,0.08); }
.el-quiz-option.correct { border-color: var(--el-green); background: rgba(6,214,160,0.08); color: var(--el-green); }
.el-quiz-option.wrong { border-color: var(--el-danger); background: rgba(239,68,68,0.08); color: var(--el-danger); }

/* ── Sim Embed (interactive — base styles) ── */
.el-sim {
  background: var(--el-card);
  border: 1px solid var(--el-border);
  border-radius: var(--el-radius);
  text-align: center;
  padding: 32px;
  margin: 16px 0;
}
.el-sim-icon { font-size: 32px; margin-bottom: 12px; }
.el-sim-type { color: var(--el-text-secondary); }
.el-sim-note { margin-top: 12px; font-size: 12px; color: var(--el-text-muted); }

/* ── Bunny Video Placeholder ── */
.el-bunny-video-placeholder {
  position: relative;
  aspect-ratio: 16/9;
  border: 2px dashed var(--el-border);
  border-radius: var(--el-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  background: var(--el-card);
  gap: 8px;
}
.el-bunny-video-placeholder[data-width="wide"] { max-width: 800px; }
.el-bunny-video-placeholder[data-width="medium"] { max-width: 560px; }
.el-bvp-icon { font-size: 36px; opacity: .4; }
.el-bvp-title { font-size: 14px; font-weight: 600; color: var(--el-text); }
.el-bvp-hint { font-size: 12px; color: var(--el-text-muted); }

/* ── Instructor Approval ── */
.el-instructor-approval {
  border: 2px solid rgba(59,130,246,0.3);
  border-radius: var(--el-radius);
  padding: 20px;
  margin: 16px 0;
  background: rgba(59,130,246,0.03);
}
.el-ia-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--el-blue);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.el-ia-prompt {
  font-size: 14px;
  color: var(--el-text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.el-ia-status {
  font-size: 13px;
  color: var(--el-text-muted);
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--el-radius-sm);
  border: 1px solid var(--el-border);
}

/* ── Glossary Inline-Link — Style E ── */
.gl-term {
  color: var(--el-text);
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1.5px dashed rgba(34, 211, 238, 0.2);
  transition: all 0.15s;
}
/* .gl-term:hover → moved to @media (hover: hover) */
.gl-term-icon {
  font-size: 9px;
  color: var(--el-accent, #22d3ee);
  opacity: 0.35;
  margin-right: 3px;
}
/* .gl-term:hover .gl-term-icon → moved to @media (hover: hover) */

/* ── Desktop: wider layouts ── */
@media (min-width: 480px) {
  .el-spec-grid { grid-template-columns: repeat(2, 1fr); }
  .el-cl-badges { flex-direction: row; }
}

/* ── Touch feedback ── */
.el-quiz-option:active { border-color: var(--el-accent); background: rgba(255,107,0,0.04); }
.el-hs-legend-item:active { border-color: var(--el-accent); }

/* ── Hover: only on mouse/trackpad devices ── */
@media (hover: hover) {
  .el-table tr:hover td { background: rgba(255,255,255,0.02); }
  .el-hs-zone:hover { border-color: var(--el-accent, #ff6b00); background: transparent; box-shadow: 0 0 12px rgba(255,107,0,0.3); }
  .el-hs-label:hover { transform: translate(-50%, -50%) scale(1.2); box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
  .el-hs-label:hover .el-hs-tooltip { display: block; }
  .el-hs-legend-item:hover { border-color: var(--el-accent); background: rgba(99,102,241,0.1); }
  .el-quiz-option:hover { border-color: var(--el-accent); }
  .gl-term:hover { border-color: var(--el-accent, #22d3ee); color: var(--el-accent, #22d3ee); }
  .gl-term:hover .gl-term-icon { opacity: 0.7; }
  .el-image-lightbox .el-image-wrap:hover .el-image-expand { opacity: 1; }
  .el-image-lightbox .el-image-wrap:hover img { filter: brightness(1.03); transition: filter 0.15s ease; }
}
