@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;

html, body { height: 100%; }

body {
  @apply bg-ink-50 text-ink-800 font-sans antialiased;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Soft scrollbars */
* { scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #CBD5E1; border-radius: 99px;
  border: 2px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #94A3B8; background-clip: content-box; }

@layer components {
  .card {
    @apply bg-white rounded-xl border border-ink-200 shadow-card;
  }
  .btn {
    @apply inline-flex items-center justify-center gap-2 rounded-lg px-4 py-2.5
           text-sm font-semibold transition-all duration-150
           disabled:opacity-50 disabled:cursor-not-allowed select-none;
  }
  .btn-primary {
    @apply btn text-white bg-brand-600
           hover:bg-brand-700 active:scale-[.98]
           shadow-sm hover:shadow;
  }
  .btn-ghost {
    @apply btn text-ink-700 border border-ink-200 bg-white
           hover:bg-ink-50 hover:border-ink-300 active:scale-[.98];
  }
  .input {
    @apply w-full rounded-lg bg-white border border-ink-200
           px-4 py-3 text-base text-ink-900 placeholder:text-ink-400
           outline-none transition
           focus:border-brand-500 focus:ring-4 focus:ring-brand-500/10;
  }
  .chip {
    @apply inline-flex items-center gap-1 rounded-md px-2 py-0.5
           text-[11px] font-semibold tracking-wide;
  }
}
/* Alert modal animations */
@keyframes fade-in {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes alert-in {
  0%   { opacity: 0; transform: scale(.94) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-fade-in {
  animation: fade-in .2s ease-out both;
}

.animate-alert-in {
  animation: alert-in .35s cubic-bezier(.22,1,.36,1) both;
}

/* ────────── Rich content rendering ────────── */
.rich-content {
  font-size: 14px;
  line-height: 1.7;
  color: #334155;
  word-wrap: break-word;
}
.rich-content:empty::before {
  content: attr(data-placeholder);
  color: #94A3B8;
  pointer-events: none;
}
.rich-content h1 { font-size: 22px; font-weight: 700; margin: 12px 0 6px; color: #0F172A; }
.rich-content h2 { font-size: 18px; font-weight: 700; margin: 10px 0 5px; color: #0F172A; }
.rich-content h3 { font-size: 16px; font-weight: 600; margin: 8px 0 4px; color: #0F172A; }
.rich-content p { margin: 6px 0; }
.rich-content ul, .rich-content ol { margin: 8px 0; padding-left: 22px; }
.rich-content ul { list-style: disc; }
.rich-content ol { list-style: decimal; }
.rich-content li { margin: 3px 0; }
.rich-content blockquote {
  border-left: 3px solid #93C5FD;
  padding: 6px 14px;
  margin: 10px 0;
  background: #EFF6FF;
  color: #1E40AF;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.rich-content pre, .rich-content code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 1px 6px;
}
.rich-content pre {
  padding: 10px 14px;
  margin: 8px 0;
  white-space: pre-wrap;
  display: block;
}
.rich-content a {
  color: #2563EB;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rich-content strong, .rich-content b { font-weight: 700; color: #0F172A; }
.rich-content em, .rich-content i { font-style: italic; }
.rich-content hr {
  border: none;
  border-top: 1px solid #E2E8F0;
  margin: 14px 0;
}

/* ────────── Rich content rendering ────────── */
.rich-content {
  font-size: 14px;
  line-height: 1.7;
  color: #334155;
  word-wrap: break-word;
}
.rich-content:empty::before {
  content: attr(data-placeholder);
  color: #94A3B8;
  pointer-events: none;
}
.rich-content h1 { font-size: 24px; font-weight: 700; margin: 14px 0 8px; color: #0F172A; }
.rich-content h2 { font-size: 20px; font-weight: 700; margin: 12px 0 6px; color: #0F172A; }
.rich-content h3 { font-size: 17px; font-weight: 600; margin: 10px 0 5px; color: #0F172A; }
.rich-content p { margin: 6px 0; }
.rich-content ul, .rich-content ol { margin: 8px 0; padding-left: 24px; }
.rich-content ul { list-style: disc; }
.rich-content ol { list-style: decimal; }
.rich-content li { margin: 3px 0; }
.rich-content blockquote {
  border-left: 3px solid #93C5FD;
  padding: 8px 14px;
  margin: 12px 0;
  background: #EFF6FF;
  color: #1E40AF;
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.rich-content pre, .rich-content code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 1px 6px;
}
.rich-content pre {
  padding: 12px 16px;
  margin: 10px 0;
  white-space: pre-wrap;
  display: block;
}
.rich-content a {
  color: #2563EB;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.rich-content strong, .rich-content b { font-weight: 700; color: #0F172A; }
.rich-content em, .rich-content i { font-style: italic; }
.rich-content hr {
  border: none;
  border-top: 1px solid #E2E8F0;
  margin: 16px 0;
}