/* --- HUISSTIJL & VARIABELEN --- */
:root {
  --intro-blue: #1e456e;
  --intro-green: #9cc419;
  --intro-bg: #f3f6f8;
  --intro-text: #333333;
  --chat-width: 380px;
  --chat-radius: 16px;
}

/* =========================================
   1. ZWEVENDE CHATBOT WIDGET
   ========================================= */
#n8n-chat-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9990; 
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-end; 
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#n8n-chat-widget.menu-open-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#chat-tooltip {
  background-color: white;
  color: var(--intro-text);
  padding: 12px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 15px;
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  border: 1px solid #e1e1e1;
  pointer-events: none;
  white-space: nowrap;
}
#chat-tooltip::after {
  content: ''; position: absolute; bottom: -6px; right: 25px; width: 12px; height: 12px;
  background: white; transform: rotate(45deg); border-bottom: 1px solid #e1e1e1; border-right: 1px solid #e1e1e1;
}
#chat-tooltip.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

.tooltip-close {
  position: absolute; top: -8px; right: -8px; background: white;
  border: 1px solid #e1e1e1; border-radius: 50%; width: 20px; height: 20px;
  font-size: 12px; line-height: 18px; text-align: center; cursor: pointer;
  color: #888; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: all 0.2s ease; z-index: 2;
}
.tooltip-close:hover { color: var(--intro-text); background: #f9f9f9; transform: scale(1.1); }

#chat-toggle-btn {
  background-color: white; 
  border: 2px solid white !important;
  border-radius: 30%;
  width: 60px; height: 60px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 86, 123, 0.3);
  padding: 0; overflow: hidden;
  transition: all 0.3s ease; display: block;
}
#chat-toggle-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
#chat-toggle-btn:hover { transform: scale(1.05); box-shadow: 0 8px 25px rgba(0, 86, 123, 0.4); }

#chat-container {
  display: none; 
  position: absolute; bottom: 80px; right: 0;
  width: var(--chat-width); height: 600px; max-height: 80vh;
  background: white; border-radius: var(--chat-radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  flex-direction: column; overflow: hidden;
  border: 1px solid #e1e1e1;
  animation: slideIn 0.3s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.chat-header {
  background: #1e456e; color: white; padding: 15px 20px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1); z-index: 10; 
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-titles { display: flex; flex-direction: column; justify-content: center; padding-left: 10px; }
.company-name { font-size: 16px; font-weight: 700; line-height: 1.5; margin: 0; }
.bot-name { font-size: 14px; font-weight: 400; opacity: 0.9; line-height: 1.5; }
.header-actions { display: flex; align-items: center; gap: 15px; }
.reset-btn { cursor: pointer; font-size: 18px; opacity: 0.8; transition: opacity 0.2s, transform 0.2s; }
.reset-btn:hover { opacity: 1; transform: scale(1.1); }
.close-btn { cursor: pointer; font-size: 24px; line-height: 1; transition: transform 0.2s; }
.close-btn:hover { transform: scale(1.1); }

#chat-messages {
  flex: 1; padding: 20px; overflow-y: auto;
  background-color: var(--intro-bg);
  display: flex; flex-direction: column; gap: 15px;
  scroll-behavior: smooth;
}
.message-row { display: flex; align-items: flex-end; width: 100%; flex-wrap: wrap; }
.message-row.bot { justify-content: flex-start; }
.message-row.user { justify-content: flex-end; }

.bot-avatar {
  width: 30px; height: 30px; border-radius: 50%; margin-right: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); background: white; padding: 2px; flex-shrink: 0;
}

.message {
  max-width: 85%; padding: 12px 16px; border-radius: 12px;
  font-size: 14px; line-height: 1.5; position: relative;
  word-wrap: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.user-message { background-color: #f7f7f7; color: var(--intro-text); border-bottom-right-radius: 2px; }
.bot-message { background-color: white; color: var(--intro-text); border-bottom-left-radius: 2px; border: 1px solid #eef1f5; }
.message a { color: var(--intro-blue); font-weight: bold; text-decoration: none; border-bottom: 1px dotted var(--intro-blue); }
.message a:hover { color: var(--intro-green); border-bottom-style: solid; }
.message ul { margin: 5px 0 5px 20px; padding: 0; }
.message li { margin-bottom: 5px; }

.options-container { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; margin-left: 38px; margin-bottom: 5px; }
.chat-option-chip {
  background-color: transparent; color: var(--intro-blue); border: 1px solid var(--intro-blue);
  padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.chat-option-chip:hover {
  background-color: var(--intro-blue); color: white;
  transform: translateY(-2px); box-shadow: 0 2px 8px rgba(30, 69, 110, 0.2);
}

#chat-suggestions {
  display: flex; gap: 10px; padding: 0 20px 15px 20px;
  background-color: var(--intro-bg); flex-wrap: wrap; justify-content: flex-end;
}
.suggestion-btn {
  background-color: transparent; color: var(--intro-blue); border: 1px solid var(--intro-blue);
  padding: 6px 12px; border-radius: 15px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease; white-space: nowrap;
}
.suggestion-btn:hover { background-color: var(--intro-blue); color: white; }

.options-hint { flex-basis: 100%; font-size: 12px; color: #888; font-style: italic; margin-top: 5px; margin-left: 5px; text-align: right; }

.chat-input-area {
  padding: 10px; background: white; border-top: 1px solid #eee;
  display: flex; gap: 10px; align-items: center; z-index: 10;
}
#chat-input {
  flex: 1; padding: 12px 15px; border: 1px solid #ddd; border-radius: 25px;
  outline: none; font-size: 16px; transition: border-color 0.2s; background: #f9f9f9;
}
#chat-input:focus { border-color: var(--intro-blue); background: white; }

#send-btn {
  background: #ef831e; color: white; border: none; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 16px; transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); flex-shrink: 0; 
}
#send-btn:hover { transform: scale(1.1); box-shadow: 0 4px 10px rgba(239, 131, 30, 0.4); }

.typing-indicator {
  display: none; align-items: center; padding: 10px 15px; margin-left: 10px;
  background-color: transparent; align-self: flex-start; font-size: 12px; color: #888; font-style: italic;
}
.typing-text { margin-right: 4px; }
.typing-dot {
  height: 6px; width: 6px; background-color: #999; border-radius: 50%;
  display: inline-block; margin: 0 2px; animation: typing-bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(2) { animation-delay: -0.32s; }
.typing-dot:nth-child(3) { animation-delay: -0.16s; }
@keyframes typing-bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

@media (max-width: 480px) {
  #n8n-chat-widget { bottom: 20px; right: 20px; }
  #chat-container { 
      position: fixed; z-index: 10000; bottom: 20px; left: 0; right: 0;
      margin: 0 auto; width: 92vw; height: 80vh; max-height: 600px; border-radius: 20px; 
  }
  #chat-tooltip { display: none !important; }
}

/* =========================================
   2. EMBEDDED CHATBOT SHORTCODE
   ========================================= */
.intro-embed-wrapper {
  width: 100%; max-width: 800px; height: 650px; margin: 0 auto;
  background: white; border-radius: var(--chat-radius, 16px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.08); display: flex;
  flex-direction: column; overflow: hidden; border: 1px solid #e1e1e1;
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
}
.embed-header {
  background: #1e456e; color: white; padding: 15px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.embed-messages {
  flex: 1; padding: 20px; overflow-y: auto; background-color: #f3f6f8;
  display: flex; flex-direction: column; gap: 15px; scroll-behavior: smooth;
}
.embed-messages .message-row { display: flex; align-items: flex-end; width: 100%; flex-wrap: wrap; }
.embed-messages .bot { justify-content: flex-start; }
.embed-messages .user { justify-content: flex-end; }
.embed-messages .bot-avatar { width: 30px; height: 30px; border-radius: 50%; margin-right: 8px; background: white; padding: 2px; }
.embed-messages .message { max-width: 85%; padding: 12px 16px; border-radius: 12px; font-size: 15px; line-height: 1.5; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.embed-messages .user-message { background-color: #f7f7f7; color: #333; border-bottom-right-radius: 2px; }
.embed-messages .bot-message { background-color: white; color: #333; border-bottom-left-radius: 2px; border: 1px solid #eef1f5; }
.embed-messages a { color: #1e456e; font-weight: bold; text-decoration: none; border-bottom: 1px dotted #1e456e; }
.embed-messages a:hover { color: #9cc419; border-bottom-style: solid; }
.embed-input-area {
  padding: 15px; background: white; border-top: 1px solid #eee;
  display: flex; gap: 10px; align-items: center;
}
.embed-input-area input {
  flex: 1; padding: 15px 20px; border: 1px solid #ddd; border-radius: 25px;
  outline: none; font-size: 16px; background: #f9f9f9;
}
.embed-input-area input:focus { border-color: #1e456e; background: white; }
.embed-input-area button {
  background: #ef831e; color: white; border: none; width: 48px; height: 48px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 18px; transition: all 0.3s;
}
.embed-input-area button:hover { transform: scale(1.05); }
.embed-options-container { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; margin-left: 38px; }
.embed-option-chip {
  background-color: transparent; color: #1e456e; border: 1px solid #1e456e; padding: 8px 14px;
  border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.embed-option-chip:hover { background-color: #1e456e; color: white; transform: translateY(-2px); }
#embed-suggestions {
  display: flex; padding: 0 20px 15px 20px; background-color: #f3f6f8; justify-content: flex-end;
}
.embed-suggestion-btn {
  background-color: #ef831e; color: white; border: none; padding: 10px 20px;
  border-radius: 25px; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(239, 131, 30, 0.3);
}
.embed-suggestion-btn:hover { background-color: #d17017; transform: translateY(-2px); }


/* =========================================
   3. SCREENING CHATBOT SHORTCODE
   ========================================= */
.screening-wrapper {
  width: 100%; max-width: 700px; height: 650px; margin: 0 auto;
  background: white; border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08); display: flex;
  flex-direction: column; overflow: hidden; border: 1px solid #e1e1e1;
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
}
.screening-header {
  background: #1e456e; color: white; padding: 15px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.screening-header-left { display: flex; align-items: center; gap: 12px; }
.screening-header-titles { display: flex; flex-direction: column; }
.screening-header-titles .name { font-size: 16px; font-weight: 700; }
.screening-header-titles .sub { font-size: 14px; opacity: 0.9; }
.screening-messages {
  flex: 1; padding: 20px; overflow-y: auto; background-color: #f3f6f8;
  display: flex; flex-direction: column; gap: 15px; scroll-behavior: smooth;
}
.screening-messages .message-row { display: flex; align-items: flex-end; width: 100%; flex-wrap: wrap; }
.screening-messages .bot { justify-content: flex-start; }
.screening-messages .user { justify-content: flex-end; }
.screening-messages .bot-avatar { width: 30px; height: 30px; border-radius: 50%; margin-right: 8px; background: white; padding: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.screening-messages .message { max-width: 85%; padding: 12px 16px; border-radius: 12px; font-size: 15px; line-height: 1.6; box-shadow: 0 1px 2px rgba(0,0,0,0.1); word-wrap: break-word; }
.screening-messages .user-message { background-color: #f7f7f7; color: #333; border-bottom-right-radius: 2px; }
.screening-messages .bot-message { background-color: white; color: #333; border-bottom-left-radius: 2px; border: 1px solid #eef1f5; }
.screening-messages a { color: #1e456e; font-weight: bold; text-decoration: none; border-bottom: 1px dotted #1e456e; }
.screening-messages a:hover { color: #9cc419; border-bottom-style: solid; }
.screening-vacancy-banner {
  background: linear-gradient(135deg, #f0f7ff, #e8f4fd); border-left: 4px solid #1e456e; padding: 16px 20px;
  margin: 0 0 10px 0; border-radius: 8px; font-size: 14px; color: #1e456e; line-height: 1.6;
}
.screening-vacancy-banner strong { display: block; font-size: 15px; margin-bottom: 6px; }
.screening-options { width: 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; margin-left: 38px; }
.screening-option-chip {
  background-color: transparent; color: #1e456e; border: 1px solid #1e456e; padding: 8px 14px;
  border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.screening-option-chip:hover { background-color: #1e456e; color: white; transform: translateY(-2px); }
.screening-options .options-hint { flex-basis: 100%; font-size: 12px; color: #888; font-style: italic; margin-top: 5px; text-align: right; }

.screening-typing { display: none; align-items: center; padding: 10px 15px; margin-left: 10px; font-size: 12px; color: #888; font-style: italic; }
.screening-typing .dot { height: 6px; width: 6px; background-color: #999; border-radius: 50%; display: inline-block; margin: 0 2px; animation: sc-bounce 1.4s infinite ease-in-out both; }
.screening-typing .dot:nth-child(2) { animation-delay: -0.32s; }
.screening-typing .dot:nth-child(3) { animation-delay: -0.16s; }
@keyframes sc-bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

.screening-input-area { padding: 12px 15px; background: white; border-top: 1px solid #eee; display: flex; gap: 10px; align-items: center; }
.screening-input-area input[type="text"] { flex: 1; padding: 14px 18px; border: 1px solid #ddd; border-radius: 25px; outline: none; font-size: 16px; background: #f9f9f9; transition: border-color 0.2s; }
.screening-input-area input[type="text"]:focus { border-color: #1e456e; background: white; }
.screening-input-area button {
  background: #ef831e; color: white; border: none; width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 17px; transition: all 0.3s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); flex-shrink: 0;
}
.screening-input-area button:hover { transform: scale(1.08); box-shadow: 0 4px 10px rgba(239,131,30,0.4); }

.sc-upload-btn {
  background: #1e456e; border: none; width: 44px; height: 44px;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 20px; transition: all 0.2s;
  color: white; flex-shrink: 0;
}
.sc-upload-btn:hover { background: #2a5a8a; transform: scale(1.05); }
.sc-file-input { display: none; }

.sc-file-preview { display: none; padding: 8px 15px; background: #f0f7ff; border-top: 1px solid #e1e1e1; align-items: center; gap: 10px; font-size: 13px; color: #1e456e; }
.sc-file-preview .sc-file-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-file-preview .sc-file-remove { cursor: pointer; color: #dc2626; font-weight: bold; font-size: 16px; padding: 2px 6px; border-radius: 4px; transition: background 0.2s; }
.sc-file-preview .sc-file-remove:hover { background: #fee2e2; }

.sc-upload-status {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f0f7ff; border: 1px solid #d0e0f0; border-radius: 8px;
  padding: 8px 12px; font-size: 13px; color: #1e456e;
}
@media (max-width: 480px) { .screening-wrapper { height: 80vh; border-radius: 12px; } }