/* ============================================================
   Cloud Explorer — word-cloud.css v4.0.0
   ============================================================ */

/* ── 페이지 레이어 ─────────────────────────────────────────── */
#wordCloudPage {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  flex-direction: column;
  background: var(--bg-primary, #0f172a);
  font-family: "Noto Sans KR", sans-serif;
}

/* ── 헤더 바 ────────────────────────────────────────────────── */
.wc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  background: rgba(15,23,42,0.96);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.wc-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.wc-back-btn:hover { color: #e2e8f0; border-color: rgba(255,255,255,0.35); }

.wc-title {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
}

.wc-stats {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

/* 검색창 */
.wc-search-wrap {
  flex: 1;
  min-width: 120px;
  max-width: 260px;
  position: relative;
}
.wc-search-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 12px;
  pointer-events: none;
}
#wc-search {
  width: 100%;
  padding: 6px 10px 6px 30px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s;
}
#wc-search::placeholder { color: #475569; }
#wc-search:focus { border-color: rgba(99,102,241,0.5); }

/* 필터 버튼 */
.wc-filters {
  display: flex;
  gap: 4px;
}
.wc-filter-btn {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.wc-filter-btn:hover { border-color: rgba(255,255,255,0.3); color: #e2e8f0; }
.wc-filter-btn.active {
  background: rgba(99,102,241,0.22);
  border-color: rgba(99,102,241,0.55);
  color: #a5b4fc;
}

/* 줌 버튼 */
.wc-zoom-btns {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.wc-zoom-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.wc-zoom-btn:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }

/* ── Canvas 컨테이너 ─────────────────────────────────────────── */
#word-cloud-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#wc-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}
#wc-canvas:active { cursor: grabbing; }

/* ── 로딩/에러 오버레이 ─────────────────────────────────────── */
#wc-loading {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  color: #64748b;
  font-size: 14px;
  pointer-events: none;
  background: rgba(15,23,42,0.7);
}
#wc-loading i { font-size: 28px; color: #5e72e4; }

#wc-error {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #f87171;
  font-size: 13px;
  text-align: center;
  padding: 20px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
}

/* ── 탐험 힌트 (하단 중앙) ─────────────────────────────────── */
.wc-hint {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 16px;
  background: rgba(15,23,42,0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  color: #94a3b8;
  font-size: 11px;
  pointer-events: auto;
  white-space: nowrap;
  /* 8초 유지 후 4초에 걸쳐 서서히 페이드 */
  animation: wc-hint-fade 4s ease 8s forwards;
  transition: opacity .3s;
}
.wc-hint.wc-hint-hidden {
  opacity: 0 !important;
  pointer-events: none;
  animation: none;
}
@keyframes wc-hint-fade {
  0%   { opacity: 1; }
  100% { opacity: 0; pointer-events: none; }
}
.wc-hint-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #64748b;
  font-size: 9px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 2px;
  transition: background .2s, color .2s;
}
.wc-hint-close:hover {
  background: rgba(255,255,255,0.14);
  color: #cbd5e1;
}

/* ── 레벨 범례 ──────────────────────────────────────────────── */
.wc-legend {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(15,23,42,0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 7px 12px;
  pointer-events: none;
}
.wc-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
}
.wc-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
}

/* ── 미리보기 카드 ───────────────────────────────────────────── */
.wc-preview-card {
  position: fixed;
  width: 240px;
  background: rgba(15,23,42,0.97);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
  pointer-events: auto;
  animation: wc-card-in .15s ease;
}
@keyframes wc-card-in {
  from { opacity: 0; transform: scale(0.93) translateY(5px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}

.wc-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.wc-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.wc-badge.brand   { background: rgba(99,102,241,0.3); color: #a5b4fc; }
.wc-badge.private { background: rgba(100,116,139,0.3); color: #94a3b8; }

.wc-card-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.wc-card-stats span {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wc-card-stats i { width: 12px; color: #64748b; }

.wc-enter-btn {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, #5e72e4, #825ee4);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.wc-enter-btn:hover  { opacity: 0.9; }
.wc-enter-btn:active { transform: scale(0.98); }

/* ── 유니버스 서치 진입 버튼 ─────────────────────────────────── */
.explore-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  margin-bottom: 12px;
  background: linear-gradient(135deg,
    rgba(15,23,42,0.85) 0%,
    rgba(30,27,75,0.70) 100%);
  border: 1px solid rgba(74,222,128,0.30);
  border-radius: 50px;
  color: #a5b4fc;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
  letter-spacing: -0.2px;
  position: relative;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25),
              inset 0 1px 0 rgba(255,255,255,0.04);
}
.explore-btn:hover {
  border-color: rgba(74,222,128,0.65);
  background: linear-gradient(135deg,
    rgba(20,30,55,0.90) 0%,
    rgba(40,35,90,0.80) 100%);
  box-shadow: 0 4px 20px rgba(74,222,128,0.18),
              inset 0 1px 0 rgba(255,255,255,0.06);
  transform: translateY(-1px);
}
.explore-btn:active { transform: translateY(0); }

/* 배경 shimmer 스윕 (호버 시 왼→오) */
.explore-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 35%,
    rgba(74,222,128,0.07) 50%,
    transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.55s ease;
  pointer-events: none;
}
.explore-btn:hover::before { transform: translateX(100%); }

/* ── 별 아이콘 박스 ──────────────────────────────────────────── */
.explore-btn-star-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(74,222,128,0.12);
  border: 1px solid rgba(74,222,128,0.25);
  flex-shrink: 0;
  transition: background .22s, border-color .22s;
}
.explore-btn:hover .explore-btn-star-wrap {
  background: rgba(74,222,128,0.20);
  border-color: rgba(74,222,128,0.50);
}
.explore-btn-star-wrap::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.55);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74,222,128,0.80) 0%, rgba(74,222,128,0) 70%);
  pointer-events: none;
  animation: starCorona 2.4s ease-in-out infinite;
}
.explore-btn-star-wrap::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.55);
  width: 46px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74,222,128,0.40) 0%, rgba(74,222,128,0) 70%);
  pointer-events: none;
  animation: starCorona 2.4s ease-in-out infinite 0.55s;
}
.explore-star-icon {
  font-size: 16px;
  color: #4ade80;
  position: relative;
  z-index: 1;
  animation: starPulse 2.4s ease-in-out infinite;
}
@keyframes starPulse {
  0%,100% { transform: scale(1);    text-shadow: 0 0 4px  rgba(74,222,128,0.4); }
  38%      { transform: scale(1.30); text-shadow: 0 0 14px rgba(74,222,128,1.0), 0 0 26px rgba(74,222,128,0.55); }
  55%      { transform: scale(1.12); text-shadow: 0 0 8px  rgba(74,222,128,0.7); }
}
@keyframes starCorona {
  0%,100% { opacity: 0;    transform: translate(-50%,-50%) scale(0.55); }
  38%      { opacity: 0.70; transform: translate(-50%,-50%) scale(1.05); }
  65%      { opacity: 0;    transform: translate(-50%,-50%) scale(1.40); }
}

/* ── 텍스트 영역 ──────────────────────────────────────────────── */
.explore-btn-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.explore-btn-title {
  font-size: 14px;
  font-weight: 700;
  color: #c7d2fe;
  line-height: 1.2;
}
.explore-btn-sub {
  font-size: 11px;
  font-weight: 400;
  color: rgba(148,163,184,0.75);
  line-height: 1.2;
}

/* ── 우측: 채팅방 수 + chevron ────────────────────────────────── */
.explore-btn-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.explore-count {
  font-size: 11px;
  font-weight: 500;
  color: rgba(148,163,184,0.65);
  white-space: nowrap;
}
.explore-enter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(74,222,128,0.15);
  border: 1px solid rgba(74,222,128,0.35);
  color: #4ade80;
  font-size: 13px;
  flex-shrink: 0;
  transition: background .22s, border-color .22s, transform .22s;
}
.explore-btn:hover .explore-enter-icon {
  background: rgba(74,222,128,0.28);
  border-color: rgba(74,222,128,0.65);
  transform: translateX(2px);
}

/* ── 반응형 ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wc-header { height: auto; padding: 8px 10px; gap: 6px; }
  .wc-title  { font-size: 13px; }
  .wc-stats  { display: none; }
  .wc-search-wrap { max-width: none; }
  .wc-legend { bottom: 8px; left: 8px; padding: 5px 9px; }
  .wc-legend-item { font-size: 10px; }
  .wc-preview-card { width: 210px; }
}
