@import url("https://fonts.googleapis.com/css2?family=Lato:wght@300;400;600;700&display=swap");

/*KEYFRAMES*/

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  background: #e4e6eb;
  border-radius: 16px;
  align-self: flex-start;
  width: fit-content;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: #9ca3af;
  border-radius: 50%;
  display: inline-block;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

@keyframes waveyEntrance {
  0% {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }

  60% {
    opacity: 1;
    filter: blur(0px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0px);
  }
}

.logo {
  animation: waveyEntrance 9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

:root {
  --brand: #00859b;
  --brand-dark: #006f82;
  --ink: #111827;
  --ink-3: #6b7280;
  --rule: #e5e7eb;
  --surface: #ffffff;
  --bg: #f9fafb;
  --font: "Lato", sans-serif;
}

html,
body {
  height: 100%;
  margin: 0%;
  overflow: hidden;
}

/* BODY */
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  width: 100%;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

/* Spørrebank Section */
.spørrebank {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  padding-right: 8px;
  margin-right: -8px;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.spørrebank::-webkit-scrollbar {
  width: 4px;
}

.spørrebank::-webkit-scrollbar-track {
  background: transparent;
}

.spørrebank::-webkit-scrollbar-thumb {
  background: #d1d5db;
}

.spørrebank::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/*kan fjernes om ikke applied*/
.sidebar-section {
  flex: 0 0 auto;
}

.sidebar-logo {
  margin-top: auto;
  /* THIS pushes it to the bottom */
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo img {
  width: 100px;
}

.spørrebank > h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem 0;
  padding: 0 0.5rem;
}

.spørrebank > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kategori {
  background: white;
  border-radius: 14px;
  border: 1px solid #e8ecf0;
  overflow: hidden;
  transition: box-shadow 0.2 ease;
}

.kategori:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.kategori h2 {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  margin: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 400;
}

.kategori h2 svg:first-child {
  border: none;
  border-radius: 8px;
  padding: 8px;
  box-sizing: content-box;
  background: rgba(0, 133, 155, 0.08);
  flex-shrink: 0;
}

.kategori-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.kategori-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.kategori-count {
  font-size: 12px;
  color: #6b7280;
  margin-top: 1px;
}

.kategori h2 svg {
  color: var(--brand);
}

.kategori h2 svg:last-child {
  color: #00959b;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.kategori ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.25s ease,
    padding 0.25s ease;
}

.kategori.open ul {
  max-height: 1000px;
  padding-bottom: 10px;
}

.kategori ul li {
  font-size: 12px;
  color: #374151;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.4;
  border-bottom: 2px solid #f3f4f6;
}

.kategori ul li:hover {
  background: #f3f4f6;
}

.kategori ul li:last-child {
  border-bottom: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  width: 16rem;
  padding: 16px 12px;
  box-sizing: border-box;
  background: #fcfdff;
  border-right: 1px solid var(--rule);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar.collapsed {
  width: 0;
  padding: 0;
  border-right: none;
  overflow: hidden;
}

.sidebar-open-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 100;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--brand);
  transition: 0.15s;
}

.sidebar-open-btn:hover {
  background: var(--bg);
}

.sidebar.collapsed ~ .sidebar-open-btn {
  display: flex;
}

.sidebar h1 svg {
  color: var(--brand);
  cursor: pointer;
}

.sidebar h1 {
  margin: 0;
  font-size: 1.5rem;
  padding: 8px 6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  font-weight: 700;
  color: #00859b;
  margin-bottom: 2rem;
  font-size: 30px;
}

.nw-chat {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 15px;
  border-radius: 10px;
  margin-bottom: 3rem;
  background-color: var(--brand);
  color: white;
  border: none;
  width: 150px;
  cursor: pointer;
}

.nw-chat svg {
  stroke: white;
  min-width: 20px;
  width: 20px;
  height: 20px;
}

.kategori.open h2 svg:last-child {
  transform: rotate(90deg);
}

/* CONTAINER */
.chat-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  max-width: 100%;
}

/* FEED */
#chatMessages::-webkit-scrollbar {
  display: none;
}

#chatMessages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 700px;
  align-items: center;
  max-width: 100%;
  margin: 0 auto;
  align-self: center;
  width: 100%;
  box-sizing: border-box;
}

/* MESSAGE STYLES */

#chatMessages > .message {
  max-width: 500px;
  width: fit-content;
}

.message {
  max-width: 70%;
  width: fit-content;
  padding: 12px 16px;
  border-radius: 16px;
  line-height: 1.4;
  box-shadow: 0 10px 24px rgba(0, 133, 155, 0.12);
}

.user {
  align-self: flex-end;
  background: var(--brand);
  color: white;
  border-radius: 16px 4px 16px 16px;
}

.bot {
  align-self: flex-start;
  background: #e4e6eb;
  color: #111;
}

/* WELCOME UI */
.welcome {
  text-align: center;
  padding: 20px 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 100%;
}

.robot-icon {
  margin-bottom: 0;
}

.logo {
  font-size: 64px;
  color: var(--brand);
  margin-top: 0;
  margin-bottom: 10px;
}

.title {
  font-size: 28px;
  margin-bottom: 10px;
}

.subtitle {
  max-width: 520px;
  margin: 0 auto 20px;
  color: var(--ink-3);
}

/* INPUT */
.chat-input {
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
  width: min(900px, 72%);
  max-width: 100%;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  align-self: center;
  margin-bottom: 40px;
}

.chat-input textarea {
  flex: 1;
  resize: none;
  overflow: hidden;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  min-height: 32px;
  height: auto;
  max-height: 220px;
  line-height: 1.5;
  background: #f8fafc;
  font-size: 14.5px;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

.chat-input-label-row {
  margin-bottom: 8px;
}

.agent-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.chat-input textarea::placeholder {
  color: rgba(100, 116, 139, 0.7);
}

#submitBtn,
#stopBtn {
  background: linear-gradient(135deg, #0f9aa7, #007d99);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

#stopBtn {
  background: #ef4444;
}

#submitBtn:hover,
#stopBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

#submitBtn:active,
#stopBtn:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

input,
textarea {
  flex: 1;
  height: 20px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--r8);
  padding: 0 14px;
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}

/* WRAPPER */

.topics {
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 700px;
}

.topic-card {
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: center;

  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px;
}

.topic-card svg {
  display: block;
  color: #00859b;
}

.topic-item {
  position: relative;
  overflow: visible;
  width: 100%;
  margin-bottom: 20px;
  z-index: 999;
}

/* hover effect */
.topic-card:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 12px rgba(0, 133, 155, 0.1);
}

.topic-dropdown {
  min-width: 260px;
  position: absolute;
  top: 100%;
  left: 0;
  right: auto;
  width: max-content;
  max-width: 280px;

  margin-top: 8px;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 12px;

  display: flex;
  flex-direction: column;
  gap: 6px;

  padding: 8px;

  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: 0.15s ease;

  z-index: 1000;
}

/* SHOW ON HOVER */
.topic-item:hover .topic-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* OPTIONS */
.topic-option {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
  text-align: left;

  white-space: normal;
  overflow-wrap: anywhere;

  border-bottom: 1px solid #f3f4f6;
}

.topic-option:hover {
  background: var(--bg);
}/* BOT BUBBLE */
.bot {
  align-self: flex-start;
  background: #ffffff;
  color: #111;
  border: 1px solid #e5e7eb;
  border-radius: 4px 16px 16px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* HEADINGS */
.message.bot h1,
.message.bot h2,
.message.bot h3 {
  font-weight: 700;
  color: #00859b;
  margin: 1.2rem 0 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}
.message.bot h1 { font-size: 1.1rem; }
.message.bot h2 { font-size: 1rem; }
.message.bot h3 { font-size: 0.9rem; color: #1a1b1b; border-bottom: none; }

/* PARAGRAPHS */
.message.bot p {
  margin: 0.6rem 0;
  color: #374151;
  line-height: 1.7;
}

/* LISTS */
.message.bot ul,
.message.bot ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
  gap: 0.4rem;
}
.message.bot li {
  color: #374151;
  line-height: 1.65;
  padding-left: 0.1rem;
}
.message.bot li::marker {
  color: #00859b;
}

/* BOLD / ITALIC */
.message.bot strong {
  font-weight: 700;
  color: #111827;
}

/* INLINE CODE */
.message.bot code {
  background: #f0fdf4;
  color: #065f46;
  border: 1px solid #d1fae5;
  padding: 0.15em 0.45em;
  border-radius: 5px;
  font-size: 0.84em;
}

/* CODE BLOCK */
.message.bot pre {
  background: #1e293b;
  border: none;
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 0.75rem 0;
  overflow-x: auto;
}
.message.bot pre code {
  background: none;
  border: none;
  color: #7ee787;
  font-size: 0.84rem;
}

/* BLOCKQUOTE */
.message.bot blockquote {
  border-left: 3px solid #00859b;
  background: #f0f9fb;
  padding: 0.6rem 1rem;
  border-radius: 0 8px 8px 0;
  color: #374151;
  margin: 0.6rem 0;
}

/* LINKS */
.message.bot a {
  color: #00859b;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,133,155,0.3);
}
.message.bot a:hover {
  border-bottom-color: #00859b;
}

/* HR */
.message.bot hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 1rem 0;
}

/* H2 — main section heading, bold with a bottom border */
.message.bot h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  text-transform: none;
  letter-spacing: 0;
  margin: 1.4rem 0 0.3rem;
  padding-bottom: 5px;
  border-bottom: 1.5px solid #e5e7eb;
}

/* H3 — sub-heading, softer */
.message.bot h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: none;
  letter-spacing: 0;
  margin: 1rem 0 0.25rem;
}

/* H1 — rarely used in chat, treat like a title */
.message.bot h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #00859b;
  text-transform: none;
  letter-spacing: 0;
  margin: 0 0 0.5rem;
  padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb;
}
