/* timeweb-mini.css — Timeweb Mini (read.jsp 임베드 전용 LOD1 스타일 그래프) */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0f1420;
  color: #fff;
  font-family: 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.tw-mini-wrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at center,
      #2a2f3a 0%,
      #1b1f27 60%,
      #12151c 100%);
}

#twMiniSvg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#twMiniSvg:active { cursor: grabbing; }

/* 노드 / 엣지: timeweb-mini.js 가 inline 속성으로 색을 칠하므로 여기는 기본 hover 만 */
.tm-edge { pointer-events: none; }
/* ── Timeweb Mini: LOD1-like style ───────────────────────── */

.tm-node .tm-node-bg {
  fill: rgba(180, 200, 255, 0.9);
  stroke: rgba(180, 200, 255, 0.20);
  stroke-width: 1.4;
}

.tm-node:hover .tm-node-bg {
  stroke: rgba(8, 10, 15, 0.40);
  stroke-width: 4;
}

.tm-node.tm-base .tm-node-bg {
  fill: rgba(60, 200, 100, 0.90);
  stroke: rgba(120, 255, 160, 0.20);
  stroke-width: 2;
}

.tm-node.tm-path .tm-node-bg {
  fill: rgba(255, 140, 0, 0.90);
  stroke: rgba(255, 140, 0, 0.20);
  stroke-width: 2;
}

.tm-node.tm-selected .tm-node-bg {
  fill: rgba(80, 140, 255, 0.90);
  stroke: rgba(120, 180, 255, 0.20);
  stroke-width: 2;
}

.tm-node .tm-node-title {
  fill: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  pointer-events: all;
}

.tm-node.tm-base .tm-node-title {
  fill: rgba(120, 255, 160, 0.95);
  font-weight: 700;
}

.tm-node.tm-selected .tm-node-title {
  fill: rgba(140, 200, 255, 0.95);
}

.tm-edge {
  stroke-width: 2px;
}

.tm-edge.tm-path,
.tm-edge.tm-selected,
.tm-edge.tm-adj {
  stroke-width: 4px;
}

/* ── Timeweb Mini: idle 엣지 반짝임 ───────────────────────── */
.tm-edge.tm-spark {
  stroke: rgba(180, 210, 255, 0.85);
  stroke-width: 2px;
  filter:
    drop-shadow(0 0 6px rgba(160, 200, 255, 0.6))
    drop-shadow(0 0 14px rgba(120, 170, 255, 0.35))
    drop-shadow(0 0 26px rgba(90, 140, 255, 0.2));
}

.tm-edge-spark-dust {
  pointer-events: none;
  filter:
    drop-shadow(0 0 4px rgba(190, 215, 255, 0.75))
    drop-shadow(0 0 10px rgba(130, 180, 255, 0.35));
}

.tm-edge-spark-dot {
  fill: rgba(215, 230, 255, 0.9);
}

.tm-edge-spark-line {
  pointer-events: none;
}

@keyframes twEdgeSpark {
  0%   { r: 2;  opacity: 1; }
  50%  { r: 6;  opacity: 1; }
  100% { r: 10; opacity: 0; }
}

.tm-node-title {
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 2.6px;
  stroke-linejoin: round;
  letter-spacing: -0.01em;
}

/* Timeweb Mini: stronger star glow */
.tm-node .tm-node-bg {
  filter:
    drop-shadow(0 0 5px rgba(210, 225, 255, 0.95))
    drop-shadow(0 0 13px rgba(180, 205, 255, 0.72))
    drop-shadow(0 0 28px rgba(150, 185, 255, 0.42));
}

.tm-node.tm-base .tm-node-bg {
  filter:
    drop-shadow(0 0 5px rgba(170, 255, 190, 1.00))
    drop-shadow(0 0 14px rgba(120, 255, 160, 0.78))
    drop-shadow(0 0 30px rgba(80, 230, 130, 0.48));
}

.tm-node.tm-path .tm-node-bg {
  filter:
    drop-shadow(0 0 5px rgba(255, 220, 140, 1.00))
    drop-shadow(0 0 14px rgba(255, 170, 60, 0.82))
    drop-shadow(0 0 31px rgba(255, 140, 0, 0.50));
}

.tm-node.tm-selected .tm-node-bg {
  filter:
    drop-shadow(0 0 5px rgba(190, 225, 255, 1.00))
    drop-shadow(0 0 14px rgba(140, 200, 255, 0.86))
    drop-shadow(0 0 32px rgba(80, 150, 255, 0.54));
}

#twMiniMessage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  display: none;
}

/* ── Timeweb Mini: drag tutorial overlay ──────────────────── */
.tw-mini-drag-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(10, 14, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  animation: twMiniHintInOut 3s ease forwards;
}

.tw-mini-drag-hint .hand {
  display: inline-block;
  font-size: 20px;
  transform-origin: center;
  animation: twMiniHandShake 0.75s ease-in-out infinite;
}

@keyframes twMiniHandShake {
  0%, 100% { transform: translateX(-5px) rotate(-8deg); }
  50%      { transform: translateX(5px)  rotate(8deg); }
}

@keyframes twMiniHintInOut {
  0%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  80%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

/* ── Timeweb Mini: click-once-more tooltip ────────────────── */
.tw-mini-click-tip {
  position: absolute;
  z-index: 25;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -130%);
  left: 0;
  top: 0;
}

.tw-mini-click-tip.is-visible {
  animation: twMiniClickTip 1.8s ease forwards;
}

@keyframes twMiniClickTip {
  0%   { opacity: 0; transform: translate(-50%, -110%); }
  15%  { opacity: 1; transform: translate(-50%, -130%); }
  75%  { opacity: 1; transform: translate(-50%, -130%); }
  100% { opacity: 0; transform: translate(-50%, -145%); }
}

/* ── Timeweb Mini: open full / fullscreen button ──────────── */
.tw-mini-open-full {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 16, 26, 0.78);
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tw-mini-open-full:hover {
  background: rgba(24, 34, 54, 0.92);
  color: #fff;
  border-color: rgba(140, 190, 255, 0.45);
}

/* ── Timeweb Mini: 호버 노드 툴팁 (메인 Timeweb 과 동일한 구조/클래스) ── */
#twMiniTip.tip {
  position: fixed;
  z-index: 35;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(30, 40, 60, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  display: none;
  pointer-events: none;
  max-width: 260px;
  white-space: normal;
  line-height: 1.5;
  text-align: center;
  overflow: hidden;
}
#twMiniTip.tip.tip--btn {
  font-size: 12px;
  padding: 10px 13px;
  max-width: 260px;
}
#twMiniTip .tip-years {
  display: block;
  background: #000;
  color: rgba(180, 180, 200, 0.85);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 0;
  margin: -8px -10px 8px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#twMiniTip .tip-groups {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}
#twMiniTip .tip-gitem {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#twMiniTip .tip-gyears {
  font-weight: 400;
  color: rgba(200, 200, 220, 0.7);
  font-size: 11px;
}
#twMiniTip .tip-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
#twMiniTip .tip-pill {
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(220, 220, 240, 0.85);
  font-size: 10px;
  white-space: nowrap;
}

/* ── Timeweb Mini: 좌상단 도움말 (?)  ──────────────────────── */
.tw-mini-help {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 40;
}

.tw-mini-help-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 16, 26, 0.72);
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tw-mini-help-panel {
  display: none;
  position: absolute;
  left: 0;
  top: 40px;
  width: 220px;
  padding: 14px 15px;
  border-radius: 14px;
  background: rgba(16, 21, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.55;
  pointer-events: auto;
}

.tw-mini-help:hover .tw-mini-help-panel,
.tw-mini-help:focus-within .tw-mini-help-panel {
  display: block;
}

.tw-mini-help-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 9px;
  color: #fff;
}

.tw-mini-help-section {
  margin-top: 9px;
}

.tw-mini-help-section strong {
  display: block;
  margin-bottom: 2px;
  color: rgba(140, 190, 255, 0.95);
}

.tw-mini-help-section p {
  margin: 0;
  color: rgba(235, 240, 255, 0.78);
}
