/* =========================================================
   hubwise Design System v1.1
   /.claude/references/design-system.md 기준
   ========================================================= */

/* Pretendard 폰트 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard-dynamic-subset.min.css');

:root {
  /* ── Brand Colors ── */
  --navy:        #1E3A5F;
  --navy-light:  #2A5298;
  --teal:        #2DD4BF;

  /* ── Semantic Colors ── */
  --rise:        #F04452;
  --rise-soft:   #FEE2E5;
  --fall:        #2563EB;
  --fall-soft:   #DBEAFE;
  --success:     #16A34A;
  --warn:        #D97706;

  /* ── Neutral ── */
  --bg:          #F7F8FA;
  --surface:     #FFFFFF;
  --surface-2:   #F2F4F8;
  --border:      #E5E8EE;
  --border-hover:#9CA3AF;

  /* ── Typography ── */
  --text:        #0F1923;
  --muted:       #5A6473;
  --muted-2:     #9CA3AF;
  --font-body:   'Pretendard', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --font-mono:   'SF Mono', 'Fira Code', Consolas, monospace;

  /* ── Border Radius ── */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-pill:100px;

  /* ── Shadow ── */
  --shadow-sm:    0 1px 3px rgba(15,23,42,.06);
  --shadow-md:    0 4px 12px rgba(15,23,42,.08);
  --shadow-lg:    0 12px 30px rgba(15,23,42,.10);
  --shadow-focus: 0 0 0 3px rgba(30,58,95,.15);

  /* ── Backward Compatibility (기존 변수명 유지) ── */
  --accent:      var(--navy);
  --accentHover: var(--navy-light);
  --accentSoft:  rgba(30,58,95,.08);
  --line:        var(--border);
  --borderHover: var(--border-hover);
  --surface2:    var(--surface-2);
  --muted2:      var(--muted-2);
  --danger:      var(--rise);
  --riseSoft:    var(--rise-soft);
  --fallSoft:    var(--fall-soft);
  --successSoft: rgba(22,163,74,.10);
  --radius:      var(--r-lg);
  --radius2:     var(--r-md);
  --shadow:      var(--shadow-sm);
  --shadow2:     0 1px 2px rgba(15,23,42,.05);
}

/* ── 글로벌 기본 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── 버튼 ── */
.btn-primary {
  width: 100%;
  height: 50px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.btn-primary:hover  { background: var(--navy-light); }
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
  height: 42px;
  padding: 0 16px;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-secondary:hover { background: rgba(30,58,95,.06); }

.btn-danger {
  background: transparent;
  color: var(--rise);
  border: 1.5px solid var(--rise);
  border-radius: var(--r-md);
  cursor: pointer;
}
.btn-danger:hover { background: var(--rise-soft); }

/* ── 카드 ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ── 배지 ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-navy    { background: rgba(30,58,95,.1);    color: var(--navy); }
.badge-teal    { background: rgba(45,212,191,.15); color: #0F766E; }
.badge-success { background: rgba(22,163,74,.12);  color: var(--success); }
.badge-warn    { background: rgba(217,119,6,.12);  color: var(--warn); }
.badge-rise    { background: var(--rise-soft);     color: var(--rise); }

/* ── 지표 색상 ── */
.indicator-good   { color: var(--success); }
.indicator-warn   { color: var(--warn); }
.indicator-danger { color: var(--rise); }

/* ── 토스트 ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  opacity: 0;
  transition: all .3s ease;
  z-index: 9999;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── 스켈레톤 ── */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #e9ecf0 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 애니메이션 ── */
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
