/* ── SOCIAL TREND ANALYZER — Exolyt-style Dashboard ── */

/* ── Root Layout ── */
#da-root {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #F4F6F9;
  overflow: hidden;
}

/* ── Hero Stats Bar ── */
#da-hero {
  background: linear-gradient(135deg, #0D1B3E 0%, #1A3A6B 60%, #1D4EAB 100%);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.da-brand-title {
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.4px;
}
.da-brand-sub {
  color: rgba(147,197,253,0.75);
  font-size: 11px;
  margin-top: 3px;
  font-weight: 500;
}
#da-stats {
  display: flex;
  gap: 10px;
  margin-left: auto;
}
.da-stat-card {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 9px 16px;
  text-align: center;
  min-width: 76px;
}
.da-stat-val {
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.da-stat-label {
  color: rgba(147,197,253,0.8);
  font-size: 10px;
  margin-top: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* 플랫폼 마크 — Creators 옆 인스타그램·틱톡 로고 */
.da-plat-marks { display: flex; align-items: center; gap: 7px; }
.da-plat-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 0.18s ease;
}
.da-plat-mark:hover { transform: translateY(-2px); }
.da-plat-mark svg { width: 17px; height: 17px; display: block; }
.da-plat-mark.ig { background: linear-gradient(135deg,#FEDA75,#FA7E1E 28%,#D62976 60%,#962FBF 80%,#4F5BD5); }
.da-plat-mark.tt { background: #000; }

/* ── Influencer Search ── */
#da-search {
  position: relative;
  flex-shrink: 0;
  max-width: 560px;       /* 풀폭으로 홀로 떠 보이지 않게 폭 제한 */
  /* z-index 미지정: 사이드바 오버레이(#sb-ov z25)보다 위로 튀어나오지 않도록 */
}
#da-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #E8ECF0;
  border-radius: 12px;
  padding: 11px 15px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: border-color .15s, box-shadow .15s;
}
#da-search-box:focus-within {
  border-color: #3182F6;
  box-shadow: 0 0 0 3px rgba(49,130,246,0.12);
}
.da-search-icon { color: #8B95A1; flex-shrink: 0; }
#da-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #191F28;
}
#da-search-input::placeholder { color: #B0B8C1; font-weight: 500; }
#da-search-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: #E5E8EB;
  color: #6B7684;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
#da-search-clear:hover { background: #D1D6DB; }

#da-search-results {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 62vh;
  overflow-y: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid #E8ECF0;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(13,27,62,0.16);
  z-index: 20;            /* 콘텐츠 위, 사이드바 오버레이(25)/사이드바(30) 아래 */
}
#da-search-results.open { display: block; }
.da-sr-head {
  padding: 8px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #8B95A1;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.da-sr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.da-sr-row:hover { background: #F4F6F9; }
.da-sr-main { flex: 1; min-width: 0; }
.da-sr-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.da-sr-handle { font-size: 14px; font-weight: 800; color: #191F28; }
.da-sr-name { font-size: 12px; font-weight: 600; color: #6B7684; }
.da-sr-stats { display: flex; gap: 14px; margin-top: 3px; font-size: 11px; color: #8B95A1; }
.da-sr-stats b { color: #4E5968; font-weight: 800; font-variant-numeric: tabular-nums; }
.da-sr-niches { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.da-sr-bio { margin-top: 4px; font-size: 11px; color: #B0B8C1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-sr-arrow { color: #C5CCD3; flex-shrink: 0; }
.da-sr-empty { padding: 22px 12px; text-align: center; color: #8B95A1; font-size: 13px; }
.da-sr-more { padding: 8px 12px 4px; text-align: center; color: #B0B8C1; font-size: 11px; }

/* ── Trending Keywords Bar ── */
#da-trending {
  background: #fff;
  border-bottom: 1px solid #E8ECF0;
  padding: 9px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
#da-trending::-webkit-scrollbar { display: none; }
.da-trending-label {
  font-size: 11px;
  font-weight: 800;
  color: #8B95A1;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
#da-kw-scroll {
  display: flex;
  gap: 5px;
  flex-wrap: nowrap;
}
.da-kw-chip {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #EBF3FE;
  color: #3182F6;
  white-space: nowrap;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  border: none;
}
.da-kw-chip:hover { background: #BFDBFE; }

/* ── Main Scrollable Area ── */
#da-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Section Cards ── */
.da-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #E8ECF0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  overflow: hidden;
}
.da-card-head {
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #F4F6F9;
}
.da-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #191F28;
  flex: 1;
}
.da-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #F4F6F9;
  color: #6B7684;
}
.da-badge-new {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #D97706;
  letter-spacing: 0.3px;
}

/* ── List containers ── */
.da-list { padding: 4px 0; }

/* ── Empty State ── */
.da-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  gap: 8px;
}
.da-empty-icon { font-size: 28px; }
.da-empty-msg { font-size: 13px; font-weight: 700; color: #4E5968; }
.da-empty-sub { font-size: 11px; color: #8B95A1; text-align: center; }

/* ── Hashtag Rows ── */
.ht-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid #F4F6F9;
  transition: background 0.12s;
}
.ht-row:last-child { border-bottom: none; }
.ht-row:hover { background: #FAFBFC; }
.ht-rank { font-size: 12px; font-weight: 800; color: #CBD5E1; width: 20px; text-align: center; flex-shrink: 0; }
.ht-rank.top { color: #F59E0B; }
.ht-name { font-size: 13px; font-weight: 700; color: #191F28; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ht-name span { color: #3182F6; }
.ht-views { font-size: 12px; font-weight: 600; color: #4E5968; white-space: nowrap; }
.ht-hot { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ht-hot.h90 { background: #EBF3FE; color: #1D6FEB; }
.ht-hot.h70 { background: #F0FDF4; color: #16A34A; }
.ht-hot.h50 { background: #FFF7ED; color: #D97706; }
.ht-hot.hlo { background: #F4F6F9; color: #8B95A1; }
.ht-cat { font-size: 10px; color: #8B95A1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }

/* ── Video Rows ── */
.vid-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid #F4F6F9;
  transition: background 0.12s;
}
.vid-row:last-child { border-bottom: none; }
.vid-row:hover { background: #FAFBFC; }
.vid-thumb { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #fff; font-weight: 800; }
.vid-info { flex: 1; min-width: 0; }
.vid-title { font-size: 12px; font-weight: 700; color: #191F28; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.vid-author { font-size: 11px; font-weight: 600; color: #3182F6; }
.vid-views { font-size: 11px; color: #8B95A1; }
.vid-eng { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: #F0FDF4; color: #16A34A; }
.vid-plat-badge { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; flex-shrink: 0; }
.vid-plat-badge.ig { background: #FFF0F6; color: #E1306C; }
.vid-plat-badge.tt { background: #F0F0FF; color: #5B5BDB; }

/* ── Growing Account Rows ── */
.grow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid #F4F6F9;
  transition: background 0.12s;
}
.grow-row:last-child { border-bottom: none; }
.grow-row:hover { background: #FAFBFC; }
.grow-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.grow-avatar-init { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0; text-transform: uppercase; }
.grow-info { flex: 1; min-width: 0; }
.grow-handle { font-size: 13px; font-weight: 700; color: #191F28; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow-handle a { color: inherit; text-decoration: none; }
.grow-handle a:hover { color: #3182F6; }
.grow-sub { font-size: 11px; color: #8B95A1; margin-top: 1px; }
.grow-followers { font-size: 12px; font-weight: 700; color: #4E5968; white-space: nowrap; }
.grow-badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: #F0FDF4; color: #16A34A; white-space: nowrap; }

/* ── Charts Row ── */
.da-chart-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #E8ECF0;
  padding: 14px 16px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.da-chart-title {
  font-size: 10px;
  font-weight: 800;
  color: #8B95A1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.da-chart-wrap { position: relative; height: 160px; }
.da-chart-wrap--bar { height: 140px; }
.da-chart-wrap--niches { height: 200px; }

/* ── Leaderboard ── */
#da-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid #F4F6F9;
  background: #FAFBFC;
}
.da-fgroup {
  display: flex; gap: 2px;
  background: #fff; border-radius: 9px; padding: 3px;
  border: 1px solid #E8ECF0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.da-fgroup--sort { margin-left: auto; }
.da-ftab {
  padding: 5px 11px; border-radius: 6px; font-size: 11px; font-weight: 600;
  color: #6B7684; background: none; border: none; cursor: pointer;
  transition: all 0.14s; white-space: nowrap; font-family: inherit;
}
.da-ftab:hover { background: #F4F6F9; color: #191F28; }
.da-ftab.active { background: #3182F6; color: #fff; }
.da-sort {
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 700;
  color: #8B95A1; background: none; border: none; cursor: pointer;
  transition: all 0.14s; text-transform: uppercase; letter-spacing: 0.3px; font-family: inherit;
}
.da-sort:hover { color: #191F28; }
.da-sort.active { background: #191F28; color: #fff; }

.da-board-wrap { overflow-x: auto; }
#da-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#da-table thead tr { background: #FAFBFC; }
#da-table th { padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 700; color: #8B95A1; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid #E8ECF0; white-space: nowrap; }
#da-table td { padding: 10px 14px; border-bottom: 1px solid #F4F6F9; vertical-align: middle; }
#da-table tbody tr:last-child td { border-bottom: none; }
#da-table tbody tr:hover td { background: #FAFBFC; }

.da-rank { font-size: 13px; font-weight: 800; color: #CBD5E1; text-align: center; }
.da-rank.top3 { color: #F59E0B; }
.da-avatar-wrap { display: flex; align-items: center; gap: 10px; }
.da-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.da-avatar-init { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0; text-transform: uppercase; }
.da-handle { font-weight: 700; color: #191F28; font-size: 13px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-handle a { color: inherit; text-decoration: none; }
.da-handle a:hover { color: #3182F6; }
.da-cat-chip { font-size: 10px; padding: 1px 6px; border-radius: 999px; font-weight: 600; margin-top: 2px; display: inline-block; }
.da-cat-chip.fashion { background: #FFF1F2; color: #E11D48; }
.da-cat-chip.beauty { background: #FDF4FF; color: #A21CAF; }
.plat-badge { font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.plat-badge.ig { background: #FFF0F6; color: #E1306C; }
.plat-badge.tt { background: #F0F0FF; color: #5B5BDB; }
.da-score-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 60px; }
.da-score-num { font-size: 14px; font-weight: 800; line-height: 1; }
.da-score-bar { height: 3px; border-radius: 99px; background: #E8ECF0; overflow: hidden; }
.da-score-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.da-follow { font-weight: 700; color: #191F28; font-size: 13px; white-space: nowrap; }
.da-eng { font-weight: 600; color: #4E5968; font-size: 12px; white-space: nowrap; }
.da-niches { display: flex; flex-wrap: wrap; gap: 3px; max-width: 160px; }
.da-niche-chip { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: #F4F6F9; color: #6B7684; font-weight: 600; white-space: nowrap; }
.da-view-btn { width: 26px; height: 26px; border-radius: 7px; background: #F4F6F9; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #6B7684; transition: all 0.14s; text-decoration: none; }
.da-view-btn:hover { background: #3182F6; color: #fff; }
.da-row-link { cursor: pointer; }
.da-row-link:hover td { background: #F8FAFC; }
.da-ext-btn { width: 26px; height: 26px; border-radius: 7px; background: #F4F6F9; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #6B7684; transition: all 0.14s; text-decoration: none; }
.da-ext-btn:hover { background: #E1306C; color: #fff; }

/* ── Chat FAB ── */
#chat-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 100;
  background: #191F28; color: #fff; border: none; border-radius: 14px;
  padding: 11px 17px; font-size: 13px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.28);
  transition: transform 0.15s, box-shadow 0.15s; font-family: inherit;
}
#chat-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.35); }

/* ── Status Dot ── */
.chat-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: #6B7684; }
.chat-dot.online { background: #22C55E; }
.chat-dot.loading { background: #F59E0B; animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Chat Slide Panel ── */
#chat-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.22); z-index: 200; }
#chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 95vw;
  background: #fff; z-index: 201; display: flex; flex-direction: column;
  box-shadow: -4px 0 40px rgba(0,0,0,0.14);
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
#chat-panel.open { transform: translateX(0); }
#chat-overlay.open { display: block; }
#cp-head { padding: 14px 18px; border-bottom: 1px solid #E8ECF0; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
#cp-head-left { display: flex; align-items: center; gap: 10px; }
.cp-avatar { width: 36px; height: 36px; border-radius: 10px; background: #3182F6; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.cp-title { font-size: 14px; font-weight: 800; color: #191F28; }
.cp-sub { display: flex; align-items: center; gap: 5px; margin-top: 1px; font-size: 11px; color: #8B95A1; }
#cp-close { width: 28px; height: 28px; border-radius: 7px; border: none; background: #F4F6F9; cursor: pointer; font-size: 12px; color: #4E5968; display: flex; align-items: center; justify-content: center; }
#cp-close:hover { background: #E8ECF0; }
#cp-msgs { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg-bubble { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.55; }
.msg.ai .msg-bubble { background: #F4F6F9; color: #191F28; border-bottom-left-radius: 4px; }
.msg.user .msg-bubble { background: #3182F6; color: #fff; border-bottom-right-radius: 4px; }
.msg.ai .msg-bubble h1,.msg.ai .msg-bubble h2,.msg.ai .msg-bubble h3 { font-weight:700; margin:8px 0 4px; }
.msg.ai .msg-bubble ul,.msg.ai .msg-bubble ol { padding-left:16px; margin:4px 0; }
.msg.ai .msg-bubble code { background:#E8ECF0; padding:1px 5px; border-radius:4px; font-size:11px; }
.msg.ai .msg-bubble strong { font-weight:700; }
.msg.ai .msg-bubble table { font-size:12px; border-collapse:collapse; margin:6px 0; width:100%; }
.msg.ai .msg-bubble td,.msg.ai .msg-bubble th { border:1px solid #E8ECF0; padding:4px 8px; }
#cp-examples { padding: 8px 14px; display: flex; flex-wrap: wrap; gap: 5px; border-top: 1px solid #F4F6F9; flex-shrink: 0; }
.cp-ex { font-size: 11px; padding: 5px 10px; border-radius: 8px; border: 1px solid #E8ECF0; background: #fff; color: #4E5968; cursor: pointer; font-weight: 600; transition: all 0.14s; text-align: left; font-family: inherit; }
.cp-ex:hover { background: #EBF3FE; border-color: #BFDBFE; color: #3182F6; }
#cp-input-row { padding: 10px 14px; border-top: 1px solid #E8ECF0; display: flex; gap: 8px; align-items: flex-end; flex-shrink: 0; }
#cp-ta { flex: 1; resize: none; border: 1.5px solid #E8ECF0; border-radius: 12px; padding: 9px 13px; font-size: 13px; font-family: inherit; outline: none; max-height: 110px; overflow-y: auto; line-height: 1.5; color: #191F28; }
#cp-ta:focus { border-color: #3182F6; }
#cp-send { width: 36px; height: 36px; border-radius: 10px; background: #3182F6; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; transition: background 0.14s; }
#cp-send:hover { background: #1D6FD6; }
#cp-send:disabled { background: #CBD5E1; cursor: default; }

/* ── Responsive ── */
@media (max-width: 900px) {
  #da-hero { padding: 14px 18px; flex-wrap: wrap; gap: 14px; }
  #da-stats { flex-wrap: wrap; gap: 7px; }
  .da-stat-card { padding: 8px 12px; min-width: 68px; }
  .da-stat-val { font-size: 16px; }
  #da-scroll { padding: 14px 14px 24px; gap: 14px; }
}
@media (max-width: 600px) {
  #da-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .da-brand-title { font-size: 14px; }
  #da-trending { padding: 8px 14px; }
  #da-filters { gap: 5px; padding: 10px 14px; }
  .da-fgroup--sort { margin-left: 0; }
  #chat-fab { bottom: 14px; right: 14px; padding: 9px 13px; font-size: 12px; }
}
