/* ==================================================
   행복ICT 스킬진단 - 전역 스타일
   ================================================== */

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  letter-spacing: -0.01em;
}

/* ---------- 스크롤바 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ---------- 페이드인 애니메이션 ---------- */
.fade-in {
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 레벨 라디오 카드 ---------- */
.level-card {
  position: relative;
  display: block;
  padding: 1rem 1.125rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.75rem;
  background: white;
  cursor: pointer;
  transition: all 0.18s ease;
}
.level-card:hover {
  border-color: #a5b4fc;
  background: #fafbff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.08);
}
.level-card.selected {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.level-card .level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: 0.375rem;
  font-weight: 700;
  font-size: 0.8125rem;
  background: #f1f5f9;
  color: #475569;
  transition: all 0.18s ease;
}
.level-card.selected .level-badge {
  background: #4f46e5;
  color: white;
}

/* ---------- L0 미보유 전용 스타일 ---------- */
.level-card-l0 {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.level-card-l0:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  box-shadow: 0 4px 12px -2px rgba(100, 116, 139, 0.12);
}
.level-card-l0.selected {
  border-color: #64748b;
  background: #e2e8f0;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.18);
}
.level-card-l0 .level-badge,
.level-badge-l0 {
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
}
.level-card-l0.selected .level-badge {
  background: #64748b;
  color: white;
  border-color: #64748b;
}

/* L0 알약 버튼 */
.level-pill-l0 {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #64748b;
}
.level-pill-l0:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #475569;
}
.level-pill-l0.selected {
  border-color: #64748b;
  background: #64748b;
  color: white;
  box-shadow: 0 2px 4px rgba(100, 116, 139, 0.3);
}
.level-pill-l0.selected:hover {
  background: #475569;
}

/* ---------- 레벨 알약 버튼 (전체 자가진단용) ---------- */
.level-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.5rem;
  background: white;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
}
.level-pill:hover {
  border-color: #10b981;
  background: #ecfdf5;
  color: #047857;
}
.level-pill.selected {
  border-color: #10b981;
  background: #10b981;
  color: white;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}
.level-pill.selected:hover {
  background: #059669;
}

/* ---------- Gap 색상 ---------- */
.gap-pos { color: #dc2626; font-weight: 600; }   /* 빨강: 육성 필요 */
.gap-zero { color: #64748b; font-weight: 500; }  /* 회색: 적정 */
.gap-neg { color: #2563eb; font-weight: 600; }   /* 파랑: 초과 보유 */

.gap-cell-pos { background: #fef2f2; color: #b91c1c; }
.gap-cell-zero { background: #f8fafc; color: #475569; }
.gap-cell-neg { background: #eff6ff; color: #1d4ed8; }

/* ---------- 진행률 바 ---------- */
.progress-bar {
  position: relative;
  width: 100%;
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4f46e5, #6366f1);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 64rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.3);
}

/* ---------- 테이블 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #475569;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table td {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tr:hover td {
  background: #fafbff;
}

/* ---------- KPI 칩 ---------- */
.kpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
}

/* ---------- 트랙 카드 ---------- */
.track-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.track-card:hover {
  border-color: #818cf8;
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}
.track-card.completed {
  background: #f0fdf4;
  border-color: #86efac;
}
.track-card.current {
  border-color: #4f46e5;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ---------- 반응형 ---------- */
@media (max-width: 640px) {
  .level-card {
    padding: 0.875rem 1rem;
  }
}

/* BARS 텍스트 가독성 */
.bars-text {
  line-height: 1.7;
  word-break: keep-all;
  font-size: 0.875rem;
  color: #475569;
}

/* 클러스터 색상 */
.cluster-A { background: #fef3c7; color: #92400e; }
.cluster-B { background: #fed7aa; color: #9a3412; }
.cluster-C { background: #dbeafe; color: #1e40af; }
.cluster-D { background: #cffafe; color: #155e75; }
.cluster-E { background: #d1fae5; color: #065f46; }
.cluster-F { background: #e9d5ff; color: #6b21a8; }
.cluster-G { background: #fce7f3; color: #9d174d; }
.cluster-H { background: #fee2e2; color: #991b1b; }

.cluster-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
}
