/* Daccina chatbot shell — foundation UI only */

.daccina-chatbot__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.daccina-chatbot {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 999999;
  font-family: var(--font-primary, "Poppins", sans-serif);
  font-size: 14px;
  color: var(--text-heading, #1f2233);
}

/* Minimized: launcher only */
.daccina-chatbot.daccina-chatbot--minimized .daccina-chatbot__panel {
  display: none;
}

.daccina-chatbot.daccina-chatbot--minimized .daccina-chatbot__launcher {
  display: flex;
}

/* Expanded */
.daccina-chatbot.daccina-chatbot--expanded .daccina-chatbot__panel {
  display: flex;
}

.daccina-chatbot.daccina-chatbot--expanded .daccina-chatbot__launcher {
  display: none;
}

/* Closed: entire widget hidden; reopen chip used */
.daccina-chatbot.daccina-chatbot--closed {
  display: none;
}

.daccina-chatbot__launcher {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  background: var(--primary, #348adc);
  color: #fff;
  box-shadow: var(--card-shadow, 0px 10px 30px rgba(52, 138, 220, 0.25));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.daccina-chatbot__launcher:hover {
  transform: scale(1.05);
}

.daccina-chatbot__launcher-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.6) 100%
  );
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.daccina-chatbot__panel {
  flex-direction: column;
  width: min(380px, calc(100vw - 40px));
  max-height: min(560px, calc(100vh - 100px));
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--card-shadow, 0px 10px 30px rgba(52, 138, 220, 0.2));
  overflow: hidden;
  border: 1px solid var(--neutral-200, #c6d1d7);
}

.daccina-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-muted, #edeff3);
  border-bottom: 1px solid var(--neutral-200, #c6d1d7);
}

.daccina-chatbot__header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.daccina-chatbot__lottie {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(
    145deg,
    var(--accent-cyan, #65c9d4) 0%,
    var(--primary, #348adc) 100%
  );
  opacity: 0.9;
}

.daccina-chatbot__lottie[data-lottie-loaded="true"] {
  background: transparent;
}

.daccina-chatbot__name {
  margin: 0;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
}

.daccina-chatbot__context {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-body, #555663);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daccina-chatbot__header-actions {
  display: flex;
  gap: 4px;
}

.daccina-chatbot__icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--text-heading, #1f2233);
}

.daccina-chatbot__icon-btn:hover {
  background: rgba(52, 138, 220, 0.12);
}

.daccina-chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  min-height: 180px;
  background: #fafbfc;
}

.daccina-chatbot__welcome {
  margin-bottom: 12px;
}

.daccina-chatbot__welcome-text {
  margin: 0;
  padding: 12px 14px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--neutral-200, #c6d1d7);
  line-height: 1.5;
  color: var(--text-body, #555663);
}

.daccina-chatbot__bubble {
  margin-bottom: 10px;
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.45;
}

.daccina-chatbot__bubble--user {
  margin-left: auto;
  background: var(--primary, #348adc);
  color: #fff;
}

.daccina-chatbot__bubble--assistant {
  margin-right: auto;
  background: #fff;
  border: 1px solid var(--neutral-200, #c6d1d7);
  color: var(--text-body, #555663);
}

.daccina-chatbot__typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px 12px;
  background: #fafbfc;
}

.daccina-chatbot__typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neutral-300, #9fa0b5);
  animation: daccina-chatbot-bounce 1.2s ease-in-out infinite;
}

.daccina-chatbot__typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.daccina-chatbot__typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes daccina-chatbot-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.daccina-chatbot__composer {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--neutral-200, #c6d1d7);
  background: #fff;
}

.daccina-chatbot__input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--neutral-200, #c6d1d7);
  border-radius: 10px;
  font: inherit;
}

.daccina-chatbot__send {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  background: var(--primary, #348adc);
  color: #fff;
}

.daccina-chatbot__send:hover {
  filter: brightness(1.05);
}

.daccina-chatbot__reopen {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 999998;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--neutral-200, #c6d1d7);
  background: #fff;
  box-shadow: var(--card-shadow, 0px 10px 30px rgba(52, 138, 220, 0.15));
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--primary, #348adc);
}

.daccina-chatbot__reopen-label {
  pointer-events: none;
}

@media (max-width: 575.98px) {
  .daccina-chatbot {
    left: 12px;
    bottom: 12px;
  }

  .daccina-chatbot__panel {
    width: calc(100vw - 24px);
  }
}
