/* Tidio-inspireret styling til chatbot */
#chatbot-trigger {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  box-shadow: 0 4px 24px rgba(30,41,59,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
}
#chatbot-trigger:hover {
  box-shadow: 0 8px 32px rgba(30,41,59,0.28);
  background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%);
}
#chatbot-window {
  position: fixed;
  bottom: 112px;
  right: 32px;
  width: 350px;
  max-width: 95vw;
  height: 480px;
  max-height: 80vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 40px rgba(30,41,59,0.22);
  z-index: 101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', Arial, sans-serif;
}
#chatbot-window.hidden {
  display: none !important;
}
#chatbot-overlay {
  /* overlay styles håndteres i JS */
}
#chatbot-header {
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
  color: #fff;
  padding: 18px 20px 14px 20px;
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e0e7ef;
}
#chatbot-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}
#chatbot-close:hover {
  color: #f87171;
}
#chatbot-messages {
  flex: 1 1 auto;
  padding: 24px 18px 18px 18px;
  overflow-y: auto;
  background: #f4f7fb;
  scroll-behavior: smooth;
}
.chat-message {
  display: flex;
  align-items: flex-end;
  margin-bottom: 18px;
}
.user-message {
  justify-content: flex-end;
}
.bot-message {
  justify-content: flex-start;
}
.user-message .rounded-lg {
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
  color: #fff;
  border-radius: 18px 18px 6px 18px !important;
  box-shadow: 0 2px 12px rgba(30,41,59,0.10);
  padding: 12px 18px;
  font-size: 1rem;
  max-width: 80%;
}
.bot-message .rounded-lg {
  background: #fff;
  color: #334155;
  border-radius: 18px 18px 18px 6px !important;
  box-shadow: 0 2px 12px rgba(30,41,59,0.08);
  border: 1px solid #e0e7ef;
  padding: 12px 18px;
  font-size: 1rem;
  max-width: 80%;
}
#chatbot-form {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: #f1f5f9;
  border-top: 1px solid #e0e7ef;
}
#chatbot-input {
  flex: 1 1 auto;
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 1rem;
  background: #fff;
  margin-right: 12px;
  box-shadow: 0 1px 2px rgba(30,41,59,0.04);
  outline: none;
  transition: box-shadow 0.2s;
}
#chatbot-input:focus {
  box-shadow: 0 2px 8px rgba(30,41,59,0.10);
}
#chatbot-form button[type="submit"] {
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: background 0.2s;
}
#chatbot-form button[type="submit"]:hover {
  background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%);
}
.message-loading {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 18px;
  padding: 0 8px;
}
.message-loading span {
  display: block;
  width: 6px;
  height: 6px;
  background: #38bdf8;
  border-radius: 50%;
  animation: chatbot-bounce 1.1s infinite both;
}
.message-loading span:nth-child(2) {
  animation-delay: 0.2s;
}
.message-loading span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes chatbot-bounce {
  0%, 80%, 100% { transform: scale(0.8); }
  40% { transform: scale(1.3); }
}
@media (max-width: 500px) {
  #chatbot-window {
    width: 98vw;
    right: 1vw;
    left: 1vw;
    bottom: 0;
    border-radius: 16px 16px 0 0;
    height: 70vh;
    min-height: 320px;
  }
  #chatbot-trigger {
    right: 16px;
    bottom: 16px;
    width: 54px;
    height: 54px;
    font-size: 1.5rem;
  }
  .chatbot-avatar-message {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    margin-right: 10px;
  }
  .bot-message .rounded-lg, .user-message .rounded-lg {
    font-size: 0.97rem;
    padding: 10px 12px;
  }
}
.chatbot-avatar-header {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(30,41,59,0.10);
  object-fit: cover;
}
.chatbot-avatar-message {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  aspect-ratio: 1/1;
  border-radius: 50%;
  margin-right: 14px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(30,41,59,0.10);
  object-fit: cover;
  background: #2563eb;
  display: inline-block;
  overflow: hidden;
}

/* --- Topbar/header --- */
#chatbot-header.chatbot-header-bar {
  background: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
  color: #fff;
  padding: 18px 0 14px 0;
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #e0e7ef;
  border-radius: 18px 18px 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.chatbot-header-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}
.chatbot-header-status {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.chatbot-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 7px;
  box-shadow: 0 0 0 0 #22c55e;
  animation: chatbot-pulse 1.2s infinite;
}
@keyframes chatbot-pulse {
  0% { box-shadow: 0 0 0 0 #22c55e88; }
  70% { box-shadow: 0 0 0 8px #22c55e00; }
  100% { box-shadow: 0 0 0 0 #22c55e00; }
}
.chatbot-status-text {
  font-size: 0.98rem;
  color: #d1fae5;
  font-weight: 500;
  letter-spacing: 0.01em;
} 