/* Core */
#ol-chatbot {
  position: fixed !important;
  bottom: 20px;
  right: 20px;
  width: 360px;
  height: 540px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  z-index: 999999 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Minimise behaviour (chat box should not "disappear" permanently) */
#ol-chatbot.ol-minimised {
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
}

/* Header */
#ol-chatbot-header {
  background: #074EBB;
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

#ol-chatbot-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

#ol-chatbot-minimise {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  margin: 0;
  border-radius: 10px;
}

#ol-chatbot-minimise:hover {
  background: rgba(255,255,255,0.22);
}

/* Messages */
#ol-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8f9fa;
  display: flex;
  flex-direction: column;
}

.ol-message .ol-name {
  font-size: 11px;
  letter-spacing: 0.2px;
  color: #0a2540;
  margin-bottom: 2px;
  font-weight: 600;
}

.ol-message .ol-message-content {
  color: #1e1e1e !important;
}

.ol-message .ol-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-size: cover;
  margin-right: 10px;
}

.ol-message {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 86%;
  line-height: 1.45;
  word-wrap: break-word;
  font-size: 14.5px;
}

.ol-bot-message {
  background: #e6f0ff;
  color: #0a2540;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.ol-user-message {
  background: #dfe9ff;
  color: #1e1e1e;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  margin-left: auto;
  align-items: center;
}

.ol-user-message .ol-message-content {
  color: #1e1e1e !important;
}

/* Input */
#ol-chatbot-input {
  display: flex;
  padding: 12px 16px;
  border-top: 1px solid #e0e0e0;
  background: white;
}

#ol-chatbot-input input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  outline: none;
  font-size: 14.5px;
  transition: border-color 0.2s;
  color: #1e1e1e !important;
}

#ol-chatbot-input input:focus {
  border-color: #074EBB;
}

#ol-chatbot-input button {
  margin-left: 12px;
  background: #074EBB;
  color: white;
  border: none;
  border-radius: 24px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s;
}

#ol-chatbot-input button:hover {
  background: #063e96;
}

/* Launcher bubble */
#ol-chatbot-launcher {
  position: fixed !important;
  bottom: 22px;
  right: 22px;
  z-index: 999999 !important;
  background: linear-gradient(135deg, #0f62ff, #074EBB) !important;
  color: #fff !important;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}

#ol-chatbot-launcher svg {
  width: 16px;
  height: 16px;
  fill: #ffffff !important;
}

#ol-chatbot-launcher .ol-launcher-text {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.05px;
}

.ol-launcher-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1CA3AF;
  box-shadow: 0 0 0 4px rgba(28,163,175,0.18);
}

.ol-launcher-text {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.1px;
}

/* Nudge popup */
.ol-nudge {
  position: fixed !important;
  bottom: 76px;
  right: 22px;
  z-index: 999999 !important;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  width: 260px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.16);
  cursor: pointer;
}

.ol-nudge-title {
  font-weight: 800;
  font-size: 14px;
  color: #0a2540;
  margin-bottom: 2px;
}

.ol-nudge-sub {
  font-size: 12.5px;
  color: #41566e;
}

/* Typing dots (centered) */
.ol-typing {
  padding: 0 16px 14px 16px;
  display: flex;
  justify-content: center;
}

.ol-typing-bubble {
  background: #e6f0ff;
  border-radius: 999px;
  padding: 10px 14px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(7,78,187,0.10);
}

.dot {
  width: 7px;
  height: 7px;
  background: #074EBB;
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Intro overlay (form inside chat) */
.ol-chatbot-intro-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 78, 187, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 5;
}

.ol-intro-card {
  background: #ffffff;
  width: 100%;
  max-width: 340px;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  max-height: 80vh;
  overflow-y: auto;
}

.ol-intro-title {
  font-weight: 900;
  font-size: 16px;
  color: #0a2540;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.ol-intro-sub {
  font-size: 13px;
  color: #425a70;
  margin-bottom: 12px;
  line-height: 1.35;
}

.ol-intro-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ol-intro-grid label span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #0a2540;
  margin-bottom: 6px;
}

.ol-intro-grid input,
.ol-intro-grid select {
  width: 100%;
  border: 1px solid #d7deea;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
  color: #1e1e1e;
}

.ol-intro-grid input:focus,
.ol-intro-grid select:focus {
  border-color: #074EBB;
}

.ol-intro-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: #22384f;
  padding-top: 4px;
}

.ol-intro-consent input {
  margin-top: 3px;
  accent-color: #1CA3AF;
}

.ol-intro-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ol-intro-start {
  flex: 1;
  background: #074EBB;
  border: none;
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}

.ol-intro-start:hover { background: #063e96; }

.ol-intro-skip {
  background: #eef3fb;
  border: 1px solid #d7deea;
  color: #0a2540;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
}

.ol-intro-skip:hover { background: #e6eefb; }

.ol-intro-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: #546b84;
  line-height: 1.3;
}

/* Utilities */
.hidden { display: none !important; }

/* Scrollbar */
#ol-chatbot-messages::-webkit-scrollbar { width: 6px; }
#ol-chatbot-messages::-webkit-scrollbar-track { background: #f1f1f1; }
#ol-chatbot-messages::-webkit-scrollbar-thumb { background: #074EBB; border-radius: 3px; }

/* Mobile */
@media (max-width: 520px) {
  #ol-chatbot {
    right: 10px;
    left: 10px;
    width: auto;
    height: 70vh;
    bottom: 10px;
  }
  .ol-launcher { right: 10px; bottom: 10px; }
  .ol-nudge { right: 10px; bottom: 64px; width: 240px; }
  .ol-intro-card {
    max-width: calc(100% - 32px);
  }
}
