/* ============================================================
   style.css — 국내 기업 탐색 대시보드 (Professional Clean Ver.)
   Design: 네이버 스타일의 정갈하고 신뢰감 있는 레이아웃
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* 네이버 스타일 팔레트 (신뢰감 있는 블루 포인트) */
  --bg:          #f5f6f7;
  --bg-white:    #ffffff;
  --bg-sub:      #f9fafb;
  
  --surface:     #ffffff;
  --border:      #ebecef;
  --border-dark: #d1d5db;
  
  --text:        #101010;
  --text-sub:    #404040;
  --text-mute:   #888888;
  
  --primary:     #205295; /* 전문적인 다크 블루 */
  --primary-light: #eef2ff;
  --secondary:   #2c74b3;
  
  --accent:      #0078ff;
  --warn:        #f59e0b;
  --danger:      #ef4444;
  --success:     #10b981;

  --font-body:   'Pretendard', -apple-system, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  --radius-sm:   4px;
  --radius:      8px;
  --radius-lg:   12px;

  --shadow-sm:   0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow:      0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg:   0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── 레이아웃 ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-logo {
  padding: 30px 24px;
  border-bottom: 1px solid var(--border);
}

/* ── 로고 ── */
.logo-mark {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.logo-name {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.05em;
  line-height: 1.1;
}

/* ── KPI 카드 레이아웃 ── */
.kpi-card {
  padding: 16px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.kpi-label { font-size: 12px; font-weight: 700; color: var(--text-sub); margin-bottom: 4px; }
.kpi-value { font-size: 20px; font-weight: 800; color: var(--text); font-family: var(--font-mono); }
.kpi-unit { font-size: 13px; font-weight: 400; color: var(--text-mute); margin-left: 2px; }
.kpi-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; }

/* ── 지역별 탐색 버튼 ── */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.region-btn {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.region-btn:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
}

.region-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.region-count {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.8;
}

.region-summary {
  background: #f0f7ff;
  border: 1px solid #dbeafe;
  border-radius: 4px;
  padding: 18px 20px;
  margin-top: 15px;
  display: none;
}

.region-summary.show { display: block; }

/* ── 랭킹 보드 탭 ── */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.tab-btn {
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.1s;
}

.tab-btn:hover {
  background: #f8f9fa;
  border-color: var(--border-dark);
}

.tab-btn.active {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(32, 82, 149, 0.1);
}

/* ── 바로가기 카드 ── */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.quick-link {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  transition: all 0.1s;
}

.quick-link:hover {
  border-color: var(--primary);
  background: #f8faff;
  transform: translateY(-2px);
}

.quick-link-icon {
  font-size: 24px;
  background: #f1f5f9;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

#main-nav {
  padding: 20px 0;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: var(--text-sub);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--bg-sub);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
}

.bm-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 6px;
  min-width: 20px;
  text-align: center;
  line-height: 1;
  margin-left: auto;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-sub);
}

.sidebar-footer p {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.6;
}

.main-content {
  margin-left: 240px;
  padding-right: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── 광고 영역 최적화 ── */
.ad-top {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder {
  background: #fcfcfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-mute);
  font-size: 12px;
  text-align: center;
  padding: 20px;
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-inline {
  margin: 30px 0;
  background: #fdfdfd;
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
  border-radius: var(--radius);
}

/* ── 히어로 섹션 (메인 배너) ── */
.hero {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  padding: 60px 40px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  max-width: 1200px;
}

.hero-tagline {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-title {
  font-size: 42px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-title span { color: var(--primary); }

.hero-desc {
  font-size: 17px;
  color: var(--text-sub);
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 30px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: linear-gradient(90deg, #f0f7ff, #eef2ff, #f0f7ff);
  background-size: 200% 100%;
  border: 1px solid #dbeafe;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(32, 82, 149, 0.08);
  animation: bg-shine 3s infinite linear;
}

.live-dot::before {
  content: '';
  width: 8px; height: 8px;
  background: #10b981;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: sonar 2s infinite;
}

@keyframes sonar {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes bg-shine {
  0% { background-position: 200% 0; }
  100% { background-position: 0 0; }
}

/* ── 레이아웃 보정 ── */
.main-flex-row {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.main-flex-col {
  flex: 1;
  min-width: 0;
}

.ad-sidebar {
  width: 300px;
  flex-shrink: 0;
}

.ad-sticky-wrap {
  position: sticky;
  top: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-box-vertical, .ad-box-square {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
}

.ad-box-vertical { min-height: 600px; }
.ad-box-square { min-height: 250px; }

.ad-label {
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  padding: 8px;
  font-size: 10px;
  font-weight: 800;
  color: #adb5bd;
  letter-spacing: 0.1em;
}

.ad-content {
  padding: 40px 20px;
  color: #dee2e6;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

@media (max-width: 1200px) {
  .main-flex-row { flex-direction: column; }
  .ad-sidebar { width: 100%; }
  .ad-sticky-wrap { position: static; }
}

/* ── 페이지 헤더 ── */
.page-header {
  padding: 40px 40px 35px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: var(--header-icon);
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 100px;
  opacity: 0.08;
  pointer-events: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.page-eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.page-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
}

.page-desc {
  font-size: 15px;
  color: var(--text-sub);
  margin-top: 8px;
}

/* ── 컨텐츠 메인 ── */
.content-area {
  padding: 30px 40px 60px;
  background: var(--bg);
}

/* ── 카드 (네이버 스타일) ── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
  padding: 24px;
  height: 100%;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── KPI 로우 ── */
.kpi-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mute);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
  font-family: var(--font-mono);
}

.kpi-unit { font-size: 14px; font-weight: 500; color: var(--text-mute); margin-left: 2px; }

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: #1a447c;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--border-dark);
  color: var(--text-sub);
}

.btn-ghost:hover {
  background: var(--bg-sub);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── 테이블 (네이버 스타일) ── */
.table-wrap {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: #f8f9fa;
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fdfdfd; }

.td-name { font-weight: 700; color: var(--text); }
.td-num { font-family: var(--font-mono); text-align: right; }

.td-industry {
  display: inline-block;
  padding: 2px 8px;
  background: #f1f3f5;
  color: #495057;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* ── 네 필터 바 ── */
.filter-bar {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.input {
  background: #fff;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  outline: none;
}

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* ── 모달 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-actions-top {
  position: absolute;
  top: 15px;
  right: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
}

.modal-close, .modal-scrap {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-mute);
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 50%;
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text);
}

.modal-scrap:hover {
  background: #fff8e1;
  color: #ffb300;
  transform: scale(1.1);
}

.modal-scrap.active {
  color: #ffb300;
}

.modal-header {
  padding: 30px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 24px; font-weight: 800; color: #000; }
.modal-sub { color: var(--text-mute); font-size: 13px; margin-top: 4px; }

.modal-body { padding: 30px; }

/* ── 연봉 하이라이트 (네이버 인포그래픽 느낌) ── */
.salary-highlight {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 30px;
}

.salary-label { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.salary-value { font-size: 36px; font-weight: 900; color: var(--primary); }

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #f8f9fa;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.stat-label { font-size: 12px; font-weight: 700; color: var(--text-mute); margin-bottom: 6px; }
.stat-val { font-size: 20px; font-weight: 800; color: var(--text); }

/* ── 유틸리티 ── */
.green { color: var(--success) !important; }
.red { color: var(--danger) !important; }
.accent { color: var(--accent) !important; }

/* ── 모바일 최적화 ── */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); width: 240px; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 40px rgba(0,0,0,0.1); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 16px; left: 16px;
    z-index: 1001;
    background: var(--primary);
    color: #fff;
    border: none;
    width: 40px; height: 40px;
    border-radius: 8px;
    padding: 0;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(32, 82, 149, 0.3);
    line-height: 1;
  }
  .content-area {
    padding: 20px 15px 60px;
  }
  .hero {
    padding: 40px 20px;
  }
  .hero-title {
    font-size: 28px;
  }
  .page-header {
    padding: 30px 20px;
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
  }
  .main-flex-row {
    flex-direction: column;
  }
  .ad-sidebar {
    width: 100%;
    margin-top: 20px;
  }
  .kpi-card {
    padding: 15px;
  }
  .kpi-value {
    font-size: 20px;
  }
  .chart-wrap {
    height: 240px;
  }
}

/* ── 기타 UI 유틸리티 ── */
.spinner {
  width: 32px;
  height: 32px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-mute);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-sub);
}

.empty-desc {
  font-size: 14px;
  margin-top: 8px;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 60px 0;
  color: var(--text-sub);
  font-weight: 600;
}

/* ── 네이버 특유의 검색 결과 랭킹 리스트 ── */
.ranking-item {
  display: flex; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--border); transition: background 0.2s;
  cursor: pointer;
}
.ranking-item:hover { background: var(--bg-sub); }
.rank-num { width: 30px; font-weight: 900; font-size: 16px; color: var(--text-mute); }
.rank-num.top1 { color: #ff4b4b; }
.ranking-info { flex: 1; }
.ranking-name { font-weight: 700; font-size: 15px; }
.ranking-value { font-weight: 800; color: var(--primary); font-family: var(--font-mono); }

/* ── 그리드 시스템 보정 ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}

/* ── 인포그래픽 팝오버 ── */
.disclaimer-popover {
  background: #333; color: #fff; padding: 12px; border-radius: 4px;
  font-size: 12px; width: 260px; box-shadow: var(--shadow-lg);
}

/* ── 페이징 (네이버 스타일) ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 30px;
  padding: 20px 0;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #e1e2e5;
  color: #666;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  border-radius: 2px;
}

.page-btn:hover:not(:disabled) {
  background: #f8f9fa;
  border-color: #c1c2c5;
}

.page-btn.active {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  z-index: 1;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
  background: #fdfdfd;
}

.page-dots {
  color: #ccc;
  padding: 0 5px;
  font-weight: 800;
}

/* ── 공통 스크랩 별 버튼 ── */
.star-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #d1d5db;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 50%;
  width: 32px;
  height: 32px;
}

.star-btn:hover {
  background: #fff8e1;
  color: #fbbf24;
  transform: scale(1.15);
}

.star-btn.starred {
  color: #f59e0b;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.star-btn:active {
  transform: scale(0.9);
}

/* ── 모바일 반응형 유틸리티 ── */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
  .show-mobile-block {
    display: block !important;
  }
}
@media (min-width: 769px) {
  .show-mobile-block {
    display: none !important;
  }
}

