:root {
  /* Kleuren */
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --background-color: #f9fafb;
  --chat-background: #ffffff;
  --user-bubble-bg: rgba(37, 99, 235, 0.5); /* Nu een RGBA waarde */
  --user-bubble-text: #1e40af;
  --bot-bubble-bg: #f2f4f7;
  --bot-bubble-text: #111827;
  --header-bg-color: var(--primary-color);
  --header-text-color: #ffffff;
  --text-color: #111827;
  --send-button-color: var(--primary-color);
  --toggle-button-icon-color: var(--primary-color); /* Gekoppeld aan primaire kleur */

  /* Layout & Stijl */
  --border-radius: 16px;
  --bubble-border-radius: 16px;
  --card-border-radius: 12px;
  --message-vertical-gap: 12px;
  --chatbot-width: 420px; /* Standaardwaarde is 420px */
  --chatbot-height: 700px; /* Standaardwaarde is 700px */
  --transform-origin: bottom right; 
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -5px rgba(0, 0, 0, 0.06);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --main-font: "Inter", -apple-system, sans-serif;
}

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


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--main-font);
  margin: 0;
  padding: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#chatbot-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--main-font);
}
#chatbot-container {
  width: var(--chatbot-width);
  height: var(--chatbot-height);
  max-height: calc(100vh - 120px);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  background-color: var(--chat-background);
  transition: var(--transition);
  transform-origin: var(--transform-origin);
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
}
#chatbot-container.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
  animation: slideIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}
@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
#chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--toggle-button-icon-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
  margin-top: 16px;
  transition: var(--transition);
  position: relative;
  z-index: 10000;
}
#chat-toggle:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15),
    0 10px 10px rgba(0, 0, 0, 0.12);
}
#chat-toggle:active {
  transform: translateY(0);
}
#chat-toggle svg {
  width: 28px;
  height: 28px;
  fill: #ffffff;
  stroke: #ffffff;
  transition: var(--transition);
}
#chat-header {
  background-color: var(--header-bg-color);
  color: var(--header-text-color);
  padding: 20px;
  text-align: left;
  font-weight: 600;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
#chat-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.5),
    rgba(255, 255, 255, 0.1)
  );
}

#close-topright {
    stroke: var(--header-text-color);
}
#close-topright:hover {
  cursor: pointer;
  opacity: 0.5;
}

#chat-options-container {
  position: relative;
  margin-left: auto;
  margin-right: 6px;
}
#chat-options-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background-color 0.2s ease;
}
#chat-options-button:hover {
  opacity: 0.5;
}
.dot-menu {
  width: 3px;
  height: 3px;
  background-color: var(--header-text-color);
  border-radius: 50%;
}
#chat-options-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  background-color: var(--chat-background);
  color: var(--text-color);
  border-radius: 8px;
  box-shadow: var(--shadow);
  width: 200px;
  padding: 8px;
  z-index: 10001;
  border: 1px solid #e5e7eb;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#chat-options-menu.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.chat-option-item {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}
.chat-option-item:hover {
  background-color: var(--bot-bubble-bg);
}
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: var(--message-vertical-gap);
  scroll-behavior: smooth;
  background-color: var(--chat-background);
}
#chat-messages::-webkit-scrollbar {
  width: 8px;
}
#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
#chat-messages::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 20px;
}
.message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 5px;
  border-radius: var(--bubble-border-radius);
  word-wrap: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1.5;
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(20px);
  animation: messageIn 0.5s ease forwards;
}
@keyframes messageIn {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
.user-message {
  align-self: flex-end;
  background-color: var(--user-bubble-bg);
  color: var(--user-bubble-text);
  border-bottom-right-radius: 4px;
  max-width: 85%;
}
.bot-message {
  background-color: var(--bot-bubble-bg);
  color: var(--bot-bubble-text);
  border-bottom-left-radius: 4px;
  max-width: 100%;
  align-self: flex-start;
}
.bot-message:has(.form-container),
.bot-message:has(.product-card) {
  width: 100%;
  border-radius: var(--card-border-radius);
}
.form-container {
  padding-top: 10px;
  width: 100%;
}
.form-container h3 {
  margin-bottom: 15px;
  font-size: 16px;
  color: var(--bot-bubble-text);
}
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--bot-bubble-text);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.submit-form-button, .handoff-button { /* TOEGEVOEGD */
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 10px;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  display: block;
}
.submit-form-button:hover, .handoff-button:hover { /* TOEGEVOEGD */
  background-color: var(--primary-hover);
}
.submit-form-button:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}
#loading-indicator {
  align-self: flex-start;
  display: none;
  margin-top: 10px;
  background-color: var(--bot-bubble-bg);
  padding: 12px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  opacity: 0;
  animation: loadingFade 0.5s forwards;
}
@keyframes loadingFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.typing-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.dot {
  width: 6px;
  height: 6px;
  background-color: var(--primary-color);
  border-radius: 50%;
  opacity: 0.6;
  animation: pulse 1s infinite;
}
.dot:nth-child(2) {
  animation-delay: 0.2s;
}
.dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes pulse {
  0% {
    opacity: 1;
    transform: translateY(0px);
  }
  25% {
    opacity: 0.5;
    transform: translateY(-5px);
  }
  50% {
    opacity: 1;
    transform: translateY(0px);
  }
}

#file-upload-status {
  display: none;
  padding: 8px 20px;
  background-color: var(--user-bubble-bg);
  font-size: 13px;
  color: var(--primary-color);
  align-items: center;
  justify-content: space-between;
}

#file-upload-status.visible {
  display: flex;
}

#remove-file-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  font-size: 20px;
  line-height: 1;
  color: var(--primary-color);
}

#chat-input-container {
  border-top: 1px solid #e5e7eb;
}

#chat-input-area {
  display: flex;
  padding: 16px 20px;
  background-color: white;
  align-items: center;
  position: relative;
}

#bytechat-watermark {
  text-align: center;
  padding: 8px 0;
  background-color: #f9fafb; /* Een heel lichtgrijze achtergrond */
  font-size: 12px;
  color: #9ca3af; /* Subtiele tekstkleur */
  border-top: 1px solid #e5e7eb; /* Scheidingslijn met het invoerveld */
}

#bytechat-watermark a {
  color: #6b7280; /* Iets donkerdere kleur voor de link */
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

#bytechat-watermark a:hover {
  color: var(--primary-color); /* Kleur op hover voor interactiviteit */
  text-decoration: underline;
}

#upload-menu-container {
  position: relative;
  margin-right: 10px;
}

#upload-menu-container {
  position: relative;
  margin-right: 10px;
}

#add-file-button {
  background-color: transparent; /* Maakt er een strak icoon van */
  color: #4b5563;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.2s ease;
}

#add-file-button:hover {
  background-color: #f2f4f7; /* Geeft feedback bij hover */
}

#file-input {
  display: none;
}

#message-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 14px;
  max-height: 100px;
  overflow-y: auto;
  transition: var(--transition);
}
#message-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
#send-button {
  background-color: var(--send-button-color);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-left: 10px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
  flex-shrink: 0;
}
#send-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
#send-button:active {
  transform: translateY(0);
}

.send-icon {
  width: 20px;
  height: 20px;
  fill: white;
}
#chat-toggle::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--primary-color);
}
/* Stijlen voor productinformatievenster */
.product-card {
  background-color: var(--bot-bubble-bg);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  width: 100%;
  align-self: flex-start;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  animation: messageIn 0.5s ease forwards;
  margin-bottom: 5px;
  flex-shrink: 0;
}
.product-card img { 
  width: 100%;
  height: auto;
  object-fit: cover;
  border-bottom: 1px solid #e5e7eb;
}
.product-info {
  padding: 16px;
}
.product-info h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--bot-bubble-text);
}
.product-info .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 12px;
}
.product-info p {
  font-size: 14px;
  color: var(--bot-bubble-text);
  margin: 0 0 16px 0;
  line-height: 1.6;
}
.product-info a {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  width: 100%;
  text-align: center;
}
.product-info a:hover {
  background-color: var(--primary-hover);
}

/* Stijlen voor links in berichten */
.message a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 500;
}
.message a:hover {
  color: var(--primary-hover);
}

.message ul {
  list-style-position: inside;
  padding-left: 20px; /* Geeft wat inspringing */
  margin-top: 8px;
  margin-bottom: 8px;
}

.message li {
  margin-bottom: 6px; /* Ruimte tussen de lijst-items */
}

/* Stijlen voor suggestie-knoppen */
.suggestion-container {
  align-self: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  margin-bottom: 8px;
  max-width: 95%;
  animation: messageIn 0.5s 0.2s ease forwards; /* Lichte vertraging */
  opacity: 0;
  transform: translateY(15px);
}

.suggestion-button {
  background-color: var(--chat-background);
  color: var(--primary-color);
  border: 1.5px solid var(--primary-color);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.suggestion-button:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* Utility class om features te verbergen */
.hidden {
    display: none !important;
}


/* === MOBILE RESPONSIVENESS === */
@media (max-width: 768px) {
    #chatbot-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100% !important;
        height: 100dvh !important;
        pointer-events: none !important;
        z-index: 99999;
    }

    #chatbot-wrapper.active {
        pointer-events: auto !important;
    }

    #chatbot-container {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    #chat-toggle {
        position: fixed !important;
        bottom: 20px !important;
        right: 20px !important;
        left: auto !important;
        top: auto !important;
        z-index: 10000;
    }

    #chatbot-container.active+#chat-toggle {
        display: none !important;
    }

    #close-topright {
        display: block !important;
    }
}


/* Styling for AI Insights Link */
.button-ai-insights {
    display: inline-block;
    text-decoration: none;
    margin-top: 0.75rem;
    transition: opacity 0.2s ease;
}

.button-ai-insights.disabled {
    opacity: 0.4;
    filter: blur(2px);
    pointer-events: none;
    cursor: not-allowed;
}

.button-ai-insights:not(.disabled):hover .button-primary {
    color: #2563eb;
}

/* --- Agent Mode Styles (Fase 5) --- */

/* Agent Header Layout */
.agent-header-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.agent-avatar.initials {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.agent-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.agent-name {
  font-weight: 600;
  font-size: 15px;
}

.agent-status {
  font-size: 12px;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: #4ade80; /* Bright green */
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

/* Agent Message Bubble (Distinct from AI) */
.message.agent-message {
  background-color: var(--agent-bubble-bg, #10b981); /* Fallback green */
  color: #ffffff; /* White text usually works best on colors */
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  position: relative;
}
