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

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:    #0d0f14;
  --bg-surface: #161921;
  --bg-card:    #1e2130;
  --bg-hover:   #252840;
  --border:     #2a2e45;
  --border-light: #363c5a;

  --accent:     #6c8ef5;
  --accent-2:   #a78bfa;
  --accent-3:   #34d399;
  --accent-warn: #f59e0b;
  --accent-danger: #f87171;

  --text-1:     #f0f2ff;
  --text-2:     #9aa3c2;
  --text-3:     #5c6385;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;

  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.3);

  --transition: 0.18s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
  line-height: 1.6;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ── Layout ── */
#sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

#main-content {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
  padding: 32px;
  max-width: calc(100vw - 220px);
}

/* ── Sidebar ── */
.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo h1 {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}
.sidebar-logo p {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
}
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 10px 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-1); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(108,142,245,0.18), rgba(167,139,250,0.12));
  color: var(--accent);
  border: 1px solid rgba(108,142,245,0.2);
}
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-3);
}
.storage-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.page-title span { color: var(--text-3); font-weight: 400; font-size: 14px; margin-left: 8px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 2px 12px rgba(108,142,245,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 18px rgba(108,142,245,0.4); }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }
.btn-danger { background: rgba(248,113,113,0.12); color: var(--accent-danger); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.22); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}
.card:hover { border-color: var(--border-light); box-shadow: var(--shadow-sm); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── Stat Cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-icon { font-size: 24px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -1px; }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
}
.badge-blue   { background: rgba(108,142,245,0.15); color: var(--accent); border: 1px solid rgba(108,142,245,0.25); }
.badge-purple { background: rgba(167,139,250,0.15); color: var(--accent-2); border: 1px solid rgba(167,139,250,0.25); }
.badge-green  { background: rgba(52,211,153,0.15);  color: var(--accent-3); border: 1px solid rgba(52,211,153,0.25); }
.badge-yellow { background: rgba(245,158,11,0.15);  color: var(--accent-warn); border: 1px solid rgba(245,158,11,0.25); }
.badge-red    { background: rgba(248,113,113,0.15);  color: var(--accent-danger); border: 1px solid rgba(248,113,113,0.25); }

/* ── Level Stars ── */
.level-stars { color: var(--accent-warn); letter-spacing: 1px; font-size: 13px; }

/* ── Progress Bar ── */
.progress-wrap { background: var(--border); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 0.6s ease;
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,142,245,0.12);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-select option { background: var(--bg-card); }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  transform: translateY(12px);
  transition: transform var(--transition);
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-3); cursor: pointer; font-size: 20px; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { color: var(--text-1); background: var(--bg-hover); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px; background: var(--bg-surface); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideIn 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 300px;
}
.toast.success { border-left: 3px solid var(--accent-3); }
.toast.error   { border-left: 3px solid var(--accent-danger); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Skill Category Colors ── */
.cat-lang    { --cat-color: #6c8ef5; }
.cat-framework { --cat-color: #a78bfa; }
.cat-devops  { --cat-color: #34d399; }
.cat-soft    { --cat-color: #f59e0b; }
.cat-etc     { --cat-color: #94a3b8; }

.skill-card {
  position: relative;
  overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cat-color, var(--accent));
}

/* ── File Dropzone ── */
.dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-surface);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: rgba(108,142,245,0.06);
}
.dropzone-icon { font-size: 36px; margin-bottom: 10px; }
.dropzone-text { color: var(--text-2); font-size: 14px; }
.dropzone-text strong { color: var(--accent); }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content:''; position:absolute; left:6px; top:0; bottom:0; width:2px; background: var(--border); border-radius:1px; }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-card);
}
.timeline-date { font-size: 11px; color: var(--text-3); margin-bottom: 2px; font-family: 'JetBrains Mono', monospace; }
.timeline-content { font-size: 13px; color: var(--text-2); }

/* ── Resume Editor ── */
.resume-content-editor {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.8;
  min-height: 400px;
}

/* ── Goal Status ── */
.goal-card { cursor: default; }
.goal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.goal-title { font-size: 15px; font-weight: 600; }
.goal-progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-bottom: 5px; }

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--text-3); }
.text-accent { color: var(--accent); }
.text-green { color: var(--accent-3); }
.text-warn { color: var(--accent-warn); }
.hidden { display: none !important; }
.w-full { width: 100%; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ── Responsive ── */
@media (max-width: 900px) {
  #sidebar { width: 60px; }
  .sidebar-logo p, .nav-item span, .nav-section-label, .sidebar-footer .storage-label { display: none; }
  .sidebar-logo h1 { font-size: 20px; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .icon { width: auto; }
  #main-content { margin-left: 60px; padding: 20px 16px; max-width: calc(100vw - 60px); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}
