/* LUDA AI 어시스턴트 — 커스텀 스타일 */

/* 기본 폰트 크기 (시니어 친화) */
body {
  font-size: 16px;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* 카드 컴포넌트 */
.card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

/* 섹션 타이틀 */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.75rem;
}

/* 단계 배지 */
.step-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: #f3f4f6;
  color: #9ca3af;
  border-radius: 9999px;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.step-badge.active {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 700;
}

.step-badge.done {
  background: #f0fdf4;
  color: #16a34a;
}

.step-num {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 9999px;
  background: currentColor;
  color: white;
  display: flex;
  align-items: center;
  justify-center: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.25rem;
}

.step-badge .step-num {
  background: currentColor;
  color: white;
}

.step-arrow {
  color: #d1d5db;
  font-size: 0.875rem;
}

/* 빠른 질문 버튼 */
.quick-btn {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  border-radius: 0.75rem;
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 52px;
  line-height: 1.3;
}

.quick-btn:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.quick-btn:active {
  background: #c7d2fe;
  transform: scale(0.98);
}

/* 보조 버튼 */
.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 48px;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-secondary:active {
  background: #d1d5db;
  transform: scale(0.98);
}

/* 아이콘 버튼 */
.btn-icon {
  background: #f3f4f6;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 1.125rem;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
  min-width: 44px;
}

.btn-icon:hover {
  background: #e5e7eb;
}

/* 로딩 스피너 */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e0e7ff;
  border-top-color: #4f46e5;
  border-radius: 9999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Markdown 프로즈 스타일 */
.prose-luda {
  color: #374151;
  font-size: 1rem;
  line-height: 1.7;
}

.prose-luda h1,
.prose-luda h2,
.prose-luda h3 {
  font-weight: 700;
  color: #111827;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.prose-luda h1 { font-size: 1.25rem; }
.prose-luda h2 { font-size: 1.125rem; }
.prose-luda h3 { font-size: 1rem; }

.prose-luda p {
  margin-bottom: 0.75rem;
}

.prose-luda ul,
.prose-luda ol {
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose-luda li {
  margin-bottom: 0.25rem;
}

.prose-luda strong {
  font-weight: 700;
  color: #111827;
}

/* Markdown 표 스타일 */
.prose-luda table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
}

.prose-luda th {
  background: #4f46e5;
  color: white;
  font-weight: 600;
  padding: 0.625rem 0.75rem;
  text-align: left;
  white-space: nowrap;
}

.prose-luda td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

.prose-luda tr:nth-child(even) td {
  background: #f9fafb;
}

.prose-luda tr:hover td {
  background: #eef2ff;
}

/* 코드 블록 */
.prose-luda code {
  background: #f3f4f6;
  border-radius: 0.25rem;
  padding: 0.125rem 0.375rem;
  font-size: 0.875em;
  color: #4338ca;
}

.prose-luda pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 0.75rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.75rem 0;
}

.prose-luda pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* 드래그 오버 효과 */
.drag-over {
  border-color: #4f46e5 !important;
  background: #eef2ff !important;
}

/* 모바일 safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  main {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom));
  }
}

/* 애니메이션 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* 커서 깜빡임 (스트리밍) */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.streaming-cursor::after {
  content: '▌';
  color: #4f46e5;
  animation: blink 0.8s infinite;
  margin-left: 1px;
}
