/* components.css - 집값해독 v2 공통 컴포넌트 (iv-, tk-, sh-, vm-, mp-, analyst overrides) */

/* ============================================================
   Intro Video Slot (iv-)
============================================================ */
.iv-slot {
  max-width: 1200px;
  margin: 24px auto;
  background: var(--bg2);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 24px;
}
.iv-slot:has(video),
.iv-slot:has(iframe) { border-color: transparent; }
body.light-mode .iv-slot { border-color: rgba(0, 0, 0, 0.18); }
body.light-mode .iv-slot:has(video),
body.light-mode .iv-slot:has(iframe) { border-color: transparent; }
.iv-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 14px;
}
.iv-label i { color: var(--accent); font-size: 14px; }
.iv-placeholder {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--bg0);
  border-radius: 12px;
  overflow: hidden;
}
.iv-placeholder-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text3);
}
.iv-placeholder-inner i { font-size: 48px; opacity: .5; }
.iv-placeholder-inner span { font-size: 16px; font-weight: 500; }
.iv-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text3);
  text-align: right;
}
.iv-video { width: 100%; border-radius: 12px; display: block; }
.iv-youtube {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 12px;
  display: block;
}

/* ============================================================
   Issue / News Ticker (marquee)
============================================================ */
.tk-bar {
  display: flex;
  flex-direction: row;
  background: var(--bg1);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 64px;
  z-index: 150;
  cursor: pointer;
}
.tk-bar:focus { outline: none; }

.tk-track {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 28px;
  overflow: hidden;
}
.tk-track + .tk-track {
  border-top: none;
  border-left: 1px solid var(--rule);
}
.tk-track:hover .tk-scroll { animation-play-state: paused; }

.tk-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 100%;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  z-index: 1;
  background: var(--bg1);
}
.tk-badge-issue { color: var(--red); }
.tk-badge-news { color: #3b82f6; }
.tk-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  animation: tk-pulse 1.6s ease-in-out infinite;
}
.tk-dot-red  { background: var(--red); }
.tk-dot-blue { background: #3b82f6; }

.tk-scroll-wrap {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}
.tk-scroll {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
}
.tk-scroll-issue { animation: tk-marquee 35s linear infinite; }
.tk-scroll-news  { animation: tk-marquee 35s linear infinite; }

.tk-item {
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text1);
  white-space: nowrap;
}
.tk-item::before {
  content: '\b7';
  color: var(--text3);
  margin-right: 8px;
  font-size: 16px;
}
.tk-item:first-child::before { display: none; }

@keyframes tk-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@keyframes tk-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

@media (max-width: 600px) {
  .tk-bar { flex-direction: column; }
  .tk-track + .tk-track {
    border-left: none;
    border-top: 1px solid var(--rule);
  }
  .tk-badge { padding: 0 8px; font-size: 10px; }
  .tk-item { font-size: 14px; padding: 0 14px; }
}

/* ============================================================
   Site Header (sh-) — 3-zone: logo / market indicators / login
============================================================ */
.sh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 14px;
  background: var(--bg1);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 200;
}

.sh-logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 9px 0 0 0;
  color: var(--text1);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  cursor: pointer;
  transform-origin: left center;
  transition: all 0.2s ease;
}
.sh-logo:hover {
  transform: scale(1.05);
  opacity: 0.85;
}
.sh-logo-img {
  height: 56px;
  width: auto;
  display: block;
  flex-shrink: 0;
  margin-right: -40px;
  margin-top: -20px;
}
.sh-logo span {
  line-height: 1;
  letter-spacing: -0.3px;
  padding-left: 0;
}

.sh-mid {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 12px;
  overflow: hidden;
}

/* ── Header rotating pill slots (A: market/rates/update, B: visitors) ── */
.sh-slot {
  position: relative;
  height: 52px;
  min-width: 0;
  overflow: hidden;
  color: var(--text2);
}
.sh-slot-a { flex: 3 1 auto; }
.sh-slot-b { flex: 1 0 210px; max-width: 260px; }

.sh-mid-divider {
  width: 1px;
  height: 32px;
  background: var(--rule);
  flex-shrink: 0;
}

.sh-slot-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 4px 8px;
  transform: translateY(100%);
  opacity: 0;
  transition: transform .4s ease, opacity .4s ease;
  will-change: transform, opacity;
}
.sh-slot-card.active  { transform: translateY(0);     opacity: 1; }
.sh-slot-card.leaving { transform: translateY(-100%); opacity: 0; }
.sh-slot-b .sh-slot-card { align-items: flex-end; }

.sh-slot-label {
  font-size: 11px;
  color: var(--text3);
  letter-spacing: 0.05em;
  line-height: 1;
  font-weight: 600;
  text-transform: uppercase;
}
.sh-slot-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  line-height: 1;
}

.sh-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--pill-bg);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text2);
  white-space: nowrap;
  line-height: 1.2;
}
.sh-pill i {
  font-size: 11px;
  opacity: 0.9;
  color: var(--text2);
}
.sh-pill .sh-pill-lbl {
  color: var(--text2);
  font-weight: 500;
}
.sh-pill strong {
  color: var(--text1);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.sh-pill-up   strong { color: #4ADE80; }
.sh-pill-down strong { color: #F87171; }
.sh-pill-up   i      { color: #4ADE80; }
.sh-pill-down i      { color: #F87171; }
.sh-pill-ok   i      { color: #4ADE80; }
.sh-pill-warn i      { color: #FB923C; }
.sh-pill-warn strong { color: #FB923C; }
.sh-pill-blue i      { color: #60A5FA; }
.sh-pill-blue strong { color: #60A5FA; }

.sh-spin {
  animation: sh-spin 2s linear infinite;
  transform-origin: center;
}
@keyframes sh-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.sh-pill-flag {
  background: var(--pill-bg-strong);
  gap: 6px;
}
.sh-pill-code {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  background: var(--pill-bg-strong);
  border-radius: 4px;
  color: var(--text1);
}
.sh-mid-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sh-mid-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 500;
}
.sh-mid-item strong {
  font-weight: 700;
  color: var(--text1);
  font-variant-numeric: tabular-nums;
}
.sh-mid-sep {
  color: var(--text3);
  font-weight: 700;
  opacity: .6;
}
.sh-up   { color: var(--accent) !important; }
.sh-down { color: #ef4444 !important; }
.sh-mid-sub {
  font-size: 14px;
  color: var(--text3);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sh-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sh-theme {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--text3);
  font-size: 16px;
  cursor: pointer;
  transition: all .15s;
}
.sh-theme:hover { color: var(--text1); border-color: var(--accent); }

.sh-kakao {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: #FEE500;
  color: #191919;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.sh-kakao:hover { opacity: .88; }
.sh-kakao i { font-size: 16px; }

@media (max-width: 720px) {
  .sh-slot-b { display: none; }
  .sh-mid-divider { display: none; }
  .sh-pill { font-size: 14px; padding: 4px 10px; }
  .sh-kakao-label { display: none; }
  .sh-kakao { padding: 0 12px; }
}

/* View-Mode Bar (vm-) — admin only */
.vm-bar{display:none;align-items:center;gap:8px;padding:6px 14px;background:var(--bg2);border-bottom:1px solid var(--rule);font-size:11px;color:var(--text3)}
body.zh-admin .vm-bar,body.dev-mode .vm-bar{display:flex}
.vm-label{font-weight:700;margin-right:4px}
.vm-btn{padding:4px 10px;background:var(--bg3);border:1px solid var(--rule);border-radius:6px;color:var(--text3);font-size:11px;font-weight:600;cursor:pointer;transition:all .15s}
.vm-btn:hover{color:var(--text1);border-color:var(--accent)}
.vm-btn.on{color:var(--accent);background:var(--accent-glow);border-color:var(--accent)}

/* Mypage Modal (mp-) */
.mp-overlay{display:none;position:fixed;inset:0;z-index:500;background:rgba(0,0,0,.6);align-items:center;justify-content:center}
.mp-overlay.open{display:flex}
.mp-modal{width:92%;max-width:420px;max-height:85vh;overflow-y:auto;background:var(--bg1);border:1px solid var(--rule);border-radius:14px;padding:24px 20px}
.mp-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}
.mp-title{font-size:18px;font-weight:800;color:var(--text1);display:flex;align-items:center;gap:8px}
.mp-title i{color:var(--accent)}
.mp-close{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:var(--bg2);border:1px solid var(--rule);border-radius:8px;color:var(--text3);cursor:pointer}
.mp-close:hover{color:var(--text1);border-color:var(--accent)}
.mp-section{margin-bottom:14px;padding:14px;background:var(--bg2);border:1px solid var(--rule);border-radius:10px}
.mp-sec-title{font-size:14px;font-weight:700;color:var(--text3);margin:0 0 10px;display:flex;align-items:center;gap:6px}
.mp-sec-title i{color:var(--accent);font-size:11px}
.mp-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 0;font-size:15px;color:var(--text2)}
.mp-row+.mp-row{border-top:1px solid var(--rule)}
.mp-row strong{color:var(--text1);font-weight:600}
.mp-nick-wrap{display:flex;align-items:center;gap:6px}
.mp-nick-edit{background:none;border:none;color:var(--text3);font-size:14px;cursor:pointer;padding:2px}
.mp-nick-edit:hover{color:var(--accent)}
.mp-nick-input{background:var(--bg3);color:var(--text1);border:1px solid var(--accent);border-radius:6px;padding:4px 8px;font-size:15px;width:120px;outline:none}
.mp-nick-save{padding:4px 10px;background:var(--accent);color:#fff;border:none;border-radius:6px;font-size:11px;font-weight:700;cursor:pointer}
.mp-badge{padding:3px 8px;border-radius:6px;font-size:11px;font-weight:700}
.mp-badge-free{color:var(--text3);background:var(--bg3)}
.mp-badge-pro{color:#fff;background:var(--accent)}
.mp-empty{font-size:14px;color:var(--text3);text-align:center;padding:12px 0}
.sh-profile{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px;background:var(--bg2);border:1px solid var(--rule);border-radius:8px;color:var(--text2);font-size:15px;font-weight:600;cursor:pointer;transition:all .15s}
.sh-profile:hover{border-color:var(--accent);color:var(--text1)}
.sh-profile i{color:var(--accent)}

/* Analyst tab readability overrides — bump font sizes for profile modal,
   card grid, and chat. Uses `body` prefix to beat JS-injected rules. */
body .an-prof-name { font-size: 22px; }
body .an-prof-tagline { font-size: 14px; margin-top: 4px; }
body .an-prof-quote { font-size: 15px; margin-top: 6px; line-height: 1.5; }
body .an-prof-desc { font-size: 14px; line-height: 1.7; }
body .an-prof-ft { font-size: 13px; }
body .an-prof-tag { font-size: 13px; padding: 5px 12px; }
body .an-prof-h4 { font-size: 14px; }
body .an-prof-h4 i { font-size: 13px; }
body .an-prof-sample { font-size: 14px; padding: 10px 12px; line-height: 1.5; }
body .an-tag { font-size: 13px; padding: 3px 10px; }
body .an-card-btn { font-size: 14px; }
body .an-route-quota { font-size: 13px; }
body .an-route-quota i { font-size: 12px; }
body .an-bubble { font-size: 15px; line-height: 1.7; }
body .an-quota { font-size: 14px; padding: 4px 10px; }
body .an-quota i { font-size: 13px; }
@media (max-width: 400px) {
  body .an-prof-name { font-size: 20px; }
  body .an-prof-quote { font-size: 14px; }
  body .an-bubble { font-size: 14px; }
}
