/* === Basis Nulstil og Standard === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
}

html, body {
  height: 100%;
  background-color: #f7f7f7; /* Lys baggrund */
  color: #333;
}

/* === Container & Layout === */
.container {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* === Sidebar (Light Mode) === */
.sidebar {
  background-color: #fafafa; /* Lys grå */
  color: #333;
  width: 200px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  justify-content: space-between; /* Logo i bunden */
}

.sidebar h2 {
  margin-bottom: 20px;
}

/* Websøgning-label i sidebar */
.sidebar-toggle {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
}
.sidebar-toggle input {
  margin-right: 8px;
}

/* Fælles sidebar-knapper i Light Mode */
.sidebar-btn {
  background-color: #e2e2e2;
  color: #333;
  border: none;
  padding: 8px 10px;
  margin-bottom: 10px;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.2s;
}
.sidebar-btn:hover {
  background-color: #d4d4d4; 
}

/* Dark/Light Mode-knap (ikon) */
.toggle-darkmode {
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-darkmode img {
  width: 24px;
  height: 24px;
}

/* Logo i bunden */
.sidebar-bottom {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
.sidebar-logo {
  width: 160px;
  height: auto;
}

/* === Main Chat-område (Light Mode) === */
.main {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  background-color: #fff;
}

/* === Beskeder (Light Mode) === */
.messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}
.response {
  margin: 10px 0;
  width: fit-content;
  max-width: 95%; /* Giv lidt luft i bredden */
  line-height: 1.4;
  white-space: pre-wrap;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 0.95rem;
}

.user.response {
  align-self: flex-end;
  background-color: #e2e2e2; /* Lys grå boble til bruger */
  color: #333;
}

.bot.response {
  align-self: flex-start;
  background-color: #f4f4f4; /* Svagt lysere end main */
  color: #333;
}

/* Links i bot-svar (Light Mode) */
.bot.response a {
  color: #0066cc;
  text-decoration: underline;
  background-color: transparent;
  padding: 2px 4px;
  border-radius: 3px;
  margin: 0 2px;
}

/* === Input-felt + Send-knap (Light Mode) === */
.input-container {
  display: flex;
  border-top: 1px solid #ddd;
  padding: 10px;
  background-color: #fff;
}
textarea {
  flex: 1;
  resize: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 8px;
  font-size: 0.95rem;
  outline: none;
  margin-right: 10px;
}
textarea:focus {
  border-color: #999;
}
.send-button {
  background-color: #d4d4d4;
  color: #333;
  border: none;
  padding: 0 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.send-button:hover {
  background-color: #ccc;
}
.send-button:disabled {
  background-color: #999;
  cursor: not-allowed;
}

/* === Debug-panel i bunden (Light Mode) === */
#debugLogContainer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background-color: #fafafa;
  border-top: 1px solid #ccc;
  overflow-y: auto;
  z-index: 999;
  padding: 10px;
}
#debugLog {
  font-size: 0.85rem;
  white-space: pre-wrap;
}
.hidden {
  display: none;
}

/* === Dark Mode (body.dark-mode) === */
body.dark-mode {
  background-color: #2e2e2e; 
  color: #fff;
}

/* Sidebar i mørk tilstand */
body.dark-mode .sidebar {
  background-color: #3a3a3a; 
  color: #fff;
}
body.dark-mode .sidebar-btn {
  background-color: #555; 
  color: #fff;
}
body.dark-mode .sidebar-btn:hover {
  background-color: #666;
}

/* Chat-område i mørk tilstand */
body.dark-mode .main {
  background-color: #2e2e2e;
}
body.dark-mode .messages {
  background-color: #1f1f1f;
}

/* Bobler i mørk tilstand */
body.dark-mode .bot.response {
  background-color: #444;
  color: #fff;
}
body.dark-mode .user.response {
  background-color: #666;
  color: #fff;
}

/* Links i mørk tilstand */
body.dark-mode .bot.response a {
  color: #66b2ff;
  background-color: transparent;
  text-decoration: underline;
}

/* Input-område i mørk tilstand */
body.dark-mode .input-container {
  background-color: #3a3a3a;
  border-top: 1px solid #555;
}
body.dark-mode textarea {
  background-color: #555;
  color: #fff;
  border: 1px solid #444;
}
body.dark-mode .send-button {
  background-color: #555;
  color: #fff;
}
body.dark-mode .send-button:hover {
  background-color: #666;
}

/* Debug-panel i mørk tilstand */
body.dark-mode #debugLogContainer {
  background-color: #333;
  color: #fff;
  border-top: 1px solid #555;
}

/* === Kilde-container (til websøgning) === */
.kilde-container {
  font-size: 0.85rem;
  line-height: 1.2;
  background-color: #fafafa;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 8px 0;
}
.kilde-container ul {
  list-style-type: none;
  margin: 4px 0;
  padding-left: 0;
}
.kilde-container li {
  margin-bottom: 4px;
}
.kilde-container a {
  text-decoration: underline;
  color: #0066cc;
}
.kilde-container a:hover {
  color: #004d99;
}

/* Kilde-container i Dark Mode */
body.dark-mode .kilde-container {
  background-color: #333;
  border-color: #555;
  color: #fff;
}
body.dark-mode .kilde-container a {
  color: #66b2ff;
}
body.dark-mode .kilde-container a:hover {
  color: #4091d1;
}
