/* ─── 당당수학 메인 스타일 ─────────────────────── */
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}
.sidebar .nav-link {
  color: #495057;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  transition: all .15s;
}
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background-color: #e8f0fe;
  color: #1565c0;
  font-weight: 500;
}
.sidebar .nav-link i {
  width: 20px;
}

/* Card enhancements */
.card {
  border-radius: 12px;
}
.card-header {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Problem display */
.problem-text {
  line-height: 1.9;
  font-size: 15px;
}
.problem-text svg {
  max-width: 100%;
  height: auto;
}

/* Badge soft colors */
.bg-purple { background-color: #7c3aed; }
.bg-teal   { background-color: #0d9488; }

/* Print-friendly */
@media print {
  .sidebar,
  .navbar,
  .btn,
  .alert { display: none !important; }
  main { padding: 0 !important; }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeIn .3s ease; }

/* 수식 분수 표기 (.math-frac) */
.math-frac {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  vertical-align: middle !important;
  font-size: 0.9em;
  line-height: 1.2;
  margin: 0 3px;
  gap: 1px;
}
.math-frac .num {
  display: block !important;
  border-bottom: 1.5px solid #000;
  padding: 0 4px;
  text-align: center;
  min-width: 1.2em;
  line-height: 1.4;
}
.math-frac .den {
  display: block !important;
  padding: 0 4px;
  text-align: center;
  min-width: 1.2em;
  line-height: 1.4;
}

/* SVG wrapper */
.svg-wrapper {
  display: flex;
  justify-content: center;
  margin: 12px 0;
  padding: 12px;
  background: #fafafa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}
.svg-wrapper svg {
  max-width: 100%;
  height: auto;
}

/* AI card select */
.ai-card { cursor: pointer; transition: all .15s; }
.ai-card:hover { border-color: #1565c0 !important; }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 16px;
}
