﻿/* ═══════════════════════════════════════════════════
   multi-persona-roleplay — Design System CSS
   역할 4색 팔레트 + 3테마 CSS 변수 통합
   ═══════════════════════════════════════════════════ */

/* ───── 역할 4색 코딩 — Notion-like 절제 ───── */
:root {
  /* 역할별 텍스트 태그용 (배경 없는 절제 스타일) */
  --role-executive:     #1D4ED8;
  --role-executive-bg:  #EFF6FF;
  --role-executive-mid: #93C5FD;

  --role-manager:       #047857;
  --role-manager-bg:    #ECFDF5;
  --role-manager-mid:   #6EE7B7;

  --role-lead:          #7C3AED;
  --role-lead-bg:       #F5F3FF;
  --role-lead-mid:      #C4B5FD;

  --role-member:        #B45309;
  --role-member-bg:     #FFFBEB;
  --role-member-mid:    #FCD34D;

  /* 앰버 (추천 배지·accent 한정) */
  --amber:     #B45309;
  --amber-mid: #D97706;
  --amber-lt:  #FEF3C7;

  /* B안 강조 (블랙) */
  --accent: #09090B;

  /* 반경 — Notion-like 절제 */
  --radius-card:     10px;
  --radius-sm:       7px;
  --radius-badge:    5px;
  --radius-lg:       14px;
  --radius-modal:    14px;
  --radius-full:     9999px;

  /* 전환 — 더 빠르게 */
  --transition:      all 0.15s ease;
  --transition-fast: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  /* 스페이싱 */
  --sp-xs:   4px;
  --sp-sm:   8px;
  --sp-md:   16px;
  --sp-lg:   24px;
  --sp-xl:   32px;
  --sp-2xl:  48px;

  /* 타이포 스케일 */
  --text-xs:   10px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;

  /* 폰트 무게 */
  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    900;

  /* z-index */
  --z-header: 50;
  --z-modal:  100;
  --z-toast:  200;



  /* 폰트 — Pretendard 단독 (세리프 폐기) */
  --font:      'Pretendard', -apple-system, 'Apple SD Gothic Neo', sans-serif;
  --font-mono: 'Pretendard', ui-monospace, monospace;
}

/* ───── 라이트 테마 — B안 순백 정밀 ───── */
[data-theme="light"] {
  --bg:              #FFFFFF;
  --bg-card:         #FFFFFF;
  --bg-quote:        #F4F4F5;
  --bg-input:        #FAFAFA;
  --border:          #E4E4E7;
  --border-hover:    #18181B;
  --border-focus:    #09090B;
  --text-primary:    #09090B;
  --text-sub:        #3F3F46;
  --text-muted:      #71717A;
  --text-placeholder:#A1A1AA;
  --shadow-sm:       0 1px 2px rgba(0,0,0,0.05);
  --shadow:          0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:       0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover:    0 4px 16px rgba(0,0,0,0.10);
  --shadow-card:     0 1px 2px rgba(0,0,0,0.05);
  --shadow-lg:       0 8px 24px rgba(0,0,0,0.09);
  --shadow-xl:       0 16px 48px rgba(0,0,0,0.12);
  --divider:         #E4E4E7;
  --overlay:         rgba(0,0,0,0.40);
  --success:         #059669;
  --warning:         #D97706;
  --danger:          #DC2626;
}

/* ═══════════════════════════════════════════════════
   BASE RESET & TYPOGRAPHY
   ═══════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: var(--font); }

/* ═══════════════════════════════════════════════════
   SHARED COMPONENTS
   ═══════════════════════════════════════════════════ */

/* ── 역할 뱃지 — Notion-like 절제 태그 ── */
.role-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-badge);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid;
}
.role-badge.executive { color: var(--role-executive); background: var(--role-executive-bg); border-color: var(--role-executive-mid); }
.role-badge.manager   { color: var(--role-manager);   background: var(--role-manager-bg);   border-color: var(--role-manager-mid); }
.role-badge.lead      { color: var(--role-lead);       background: var(--role-lead-bg);       border-color: var(--role-lead-mid); }
.role-badge.member    { color: var(--role-member);     background: var(--role-member-bg);     border-color: var(--role-member-mid); }

/* ── 등급 뱃지 (평가 결과) ── */
.grade-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
}
.grade-badge.pass    { background: #d1fae5; color: #065f46; }
.grade-badge.partial { background: #fef3c7; color: #92400e; }
.grade-badge.fail    { background: #fee2e2; color: #991b1b; }

/* ── 공통 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: #09090B;
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); }

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

/* ── 공통 입력 ── */
.input-field {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}
.input-field::placeholder { color: var(--text-placeholder); }
.input-field:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

/* ── 테마 전환 버튼 ── */
.theme-switcher {
  display: flex;
  gap: 6px;
}
.theme-btn {
  height: 30px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.theme-btn:hover    { border-color: var(--border-hover); }
.theme-btn.active   { border-color: var(--border-focus); background: var(--bg-quote); color: var(--text-primary); font-weight: 700; }

/* ── 공통 카드 ── */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
}

/* ── 공통 구분선 ── */
.divider {
  height: 1px;
  background: var(--divider);
  margin: 16px 0;
}

/* ── 공통 빈 상태 ── */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text-sub); }
.empty-state-desc  { font-size: 14px; }

/* ── 공통 로딩 스피너 ── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--role-lead);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════════ */
.hidden { display: none !important; }
.avatar-lead { background: var(--role-lead); }
/* ── 역할별 색상 바 (innerHTML 동적 생성용) ── */
.role-bar { height: 3px; }
.role-bar.executive { background: var(--role-executive); }
.role-bar.manager   { background: var(--role-manager); }
.role-bar.lead      { background: var(--role-lead); }
.role-bar.member    { background: var(--role-member); }
/* ── 역할별 아바타 ── */
.avatar-bg.executive { background: var(--role-executive); }
.avatar-bg.manager   { background: var(--role-manager); }
.avatar-bg.lead      { background: var(--role-lead); }
.avatar-bg.member    { background: var(--role-member); }
/* ── 레이아웃 유틸리티 ── */
.grid-span-full  { grid-column: 1 / -1; }
.text-right-mb12 { text-align: right; margin-bottom: 12px; }
.mb16            { margin-bottom: 16px; }
.flex-row-sm     { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
/* ── 타이포그래피 유틸리티 ── */
.section-heading { font-size: 16px; font-weight: 800; color: var(--text-primary); margin-left: 12px; }
.text-muted-sm   { font-size: 10px; color: var(--text-muted); }
.text-muted-body { color: var(--text-muted); font-size: 14px; }
.score-small     { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.flex-row-center { display: flex; align-items: center; gap: 10px; }
.btn-sm  { height: 32px !important; padding: 0 12px !important; font-size: 12px !important; }
.btn-sm-md { height: 36px !important; padding: 0 12px !important; font-size: 13px !important; }
.divider-v { width: 1px; height: 20px; background: var(--border); display: inline-block; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════
   HEADER (공통)
   ═══════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-logo {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
@media (max-width: 767px) {
  .page-header { padding: 12px 16px; }
}

