/* ============================================================
   Policy AI-Assistant - Custom Styles
   ============================================================ */

/* ── Base ──────────────────────────────────────────────── */
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Grade Badges ─────────────────────────────────────── */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.grade-a {
  background-color: #dcfce7;
  color: #166534;
}

.grade-b {
  background-color: #dbeafe;
  color: #1e40af;
}

.grade-c {
  background-color: #fef3c7;
  color: #92400e;
}

/* ── Step Cards ───────────────────────────────────────── */
.step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  transition: all 0.3s ease;
  text-align: center;
}

.step-card .step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 8px;
  background: #e5e7eb;
  color: #9ca3af;
  transition: all 0.3s ease;
}

.step-card .step-num {
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.step-card .step-title {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 6px;
}

.step-card .step-status {
  font-size: 11px;
  color: #9ca3af;
}

/* Step: Running */
.step-card.step-running {
  border-color: #3b82f6;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.step-card.step-running .step-icon {
  background: #3b82f6;
  color: white;
  animation: pulse-icon 2s ease-in-out infinite;
}

.step-card.step-running .step-title {
  color: #1d4ed8;
}

/* Step: Done */
.step-card.step-done {
  border-color: #22c55e;
  background: #f0fdf4;
}

.step-card.step-done .step-icon {
  background: #22c55e;
  color: white;
}

.step-card.step-done .step-title {
  color: #166534;
}

/* ── Toolbar Button ───────────────────────────────────── */
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toolbar-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #111827;
}

.toolbar-btn:active {
  background: #e5e7eb;
}

/* ── Report Content (Prose) ───────────────────────────── */
.report-content h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e3a8a;
  border-bottom: 3px solid #2563eb;
  padding-bottom: 12px;
  margin-bottom: 24px;
  margin-top: 0;
}

.report-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e40af;
  border-bottom: 1px solid #dbeafe;
  padding-bottom: 8px;
  margin-top: 32px;
  margin-bottom: 16px;
}

.report-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1d4ed8;
  margin-top: 24px;
  margin-bottom: 12px;
}

.report-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  margin-top: 20px;
  margin-bottom: 8px;
}

.report-content p {
  margin: 8px 0;
  line-height: 1.85;
  color: #374151;
  font-size: 0.9rem;
}

.report-content ul,
.report-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.report-content li {
  margin: 4px 0;
  line-height: 1.75;
  color: #374151;
  font-size: 0.9rem;
}

.report-content strong {
  color: #111827;
  font-weight: 600;
}

.report-content blockquote {
  border-left: 4px solid #2563eb;
  padding: 12px 16px;
  margin: 16px 0;
  background: #eff6ff;
  border-radius: 0 8px 8px 0;
  color: #374151;
  font-size: 0.9rem;
}

.report-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  font-size: 0.85rem;
}

.report-content th,
.report-content td {
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  text-align: left;
}

.report-content th {
  background: #eff6ff;
  font-weight: 600;
  color: #1e40af;
}

.report-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #dc2626;
}

.report-content a {
  color: #2563eb;
  text-decoration: underline;
}

.report-content a:hover {
  color: #1d4ed8;
}

.report-content hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 24px 0;
}

/* ── Animations ───────────────────────────────────────── */
@keyframes pulse-icon {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
}

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ── Print Styles ─────────────────────────────────────── */
@media print {
  header,
  .sidebar-area,
  #progressSection,
  .toolbar-btn,
  #sourcesSection,
  #emptyState,
  #toast {
    display: none !important;
  }

  body {
    background: white !important;
  }

  .main-area {
    padding: 0 !important;
  }

  #reportSection {
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .report-content {
    padding: 0 !important;
  }

  .report-content h1 {
    font-size: 1.4rem;
  }

  .report-content h2 {
    font-size: 1.1rem;
  }

  .report-content p,
  .report-content li {
    font-size: 0.85rem;
  }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    display: none;
  }

  .step-card .step-title {
    font-size: 11px;
  }

  .step-card .step-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
}
