/* Extra polish utöver Tailwind */

.msg-content {
  line-height: 1.65;
}
.msg-content p { margin: 0.5em 0; }
.msg-content p:first-child { margin-top: 0; }
.msg-content p:last-child { margin-bottom: 0; }

.msg-content code:not(pre code) {
  background: rgba(167, 139, 250, 0.12);
  color: #c4b5fd;
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.msg-content pre {
  background: #0a0b14 !important;
  border: 1px solid #1f2440;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-size: 0.85em;
  margin: 0.75em 0;
}

.msg-content pre code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  background: transparent;
  padding: 0;
}

.msg-content ul, .msg-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}
.msg-content li { margin: 0.25em 0; }

.msg-content blockquote {
  border-left: 3px solid #2a3057;
  padding-left: 1em;
  color: #94a3b8;
  margin: 0.75em 0;
}

.msg-content h1, .msg-content h2, .msg-content h3 {
  font-weight: 600;
  margin: 1em 0 0.4em;
  line-height: 1.3;
}
.msg-content h1 { font-size: 1.4em; }
.msg-content h2 { font-size: 1.2em; }
.msg-content h3 { font-size: 1.1em; }

.msg-content table {
  border-collapse: collapse;
  margin: 0.75em 0;
  font-size: 0.9em;
}
.msg-content th, .msg-content td {
  border: 1px solid #2a3057;
  padding: 0.4em 0.75em;
  text-align: left;
}
.msg-content th { background: #161a2e; }

/* Resonemangsblock (<think>...) — kollapsat med en stilren ram */
.msg-content details.think-block {
  background: #161a2e;
  border: 1px solid #1f2440;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin: 0.5em 0;
}
.msg-content details.think-block summary {
  cursor: pointer;
  font-size: 0.8em;
  color: #94a3b8;
  user-select: none;
}
.msg-content details.think-block[open] summary {
  margin-bottom: 0.5rem;
}
.msg-content details.think-block > .think-body {
  color: #cbd5e1;
  font-size: 0.92em;
  font-style: italic;
}

/* Blinkande markör vid streaming */
.streaming::after {
  content: '▊';
  display: inline-block;
  animation: blink 1s steps(1) infinite;
  color: #a78bfa;
  margin-left: 2px;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Snyggare scrollbar */
.overflow-y-auto::-webkit-scrollbar { width: 10px; }
.overflow-y-auto::-webkit-scrollbar-track { background: transparent; }
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: #1f2440;
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.overflow-y-auto::-webkit-scrollbar-thumb:hover { background: #2a3057; background-clip: padding-box; }
