/* ── Floating Bubble ── */
#chatbot-bubble {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: linear-gradient(135deg, #f5a023, #e8880a);
  border-radius: 60px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(245, 160, 35, 0.35);
  transition: all 0.3s;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  font-family: "Source Sans 3", sans-serif;
}

#chatbot-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(245, 160, 35, 0.45);
}

.bubble-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}

/* ── Chat Container ── */
#chatbot-container {
  position: fixed;
  bottom: 76px;
  right: 16px;
  z-index: 1000;
  width: 86%;
  max-width: 440px;
  height: 100dvh;
  max-height: clamp(200px, 80dvh, 640px);
  border-radius: 12px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  /* background: rgba(255, 255, 255, 0.55); */
  background: linear-gradient(135deg, #fdf4e3 0%, #e8f0fe 50%, #fef6e8 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 25px 60px rgba(26, 58, 92, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.06);
  animation: slideUp 0.35s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Header ── */
#chat-header {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(26, 58, 92, 0.05);
  border-bottom: 1px solid rgba(26, 58, 92, 0.08);
  flex-shrink: 0;
}

.avatar-ring {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f5a023, #e8880a);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  box-shadow: 0 4px 14px rgba(245, 160, 35, 0.35);
}

.header-info h2 {
  font-size: 18px;
  font-weight: 700;
  color: #034ea2;
  line-height: 1.2;
  padding: 0;
}

.header-info p {
  font-size: 12px;
  color: #6b8299;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.header-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(26, 58, 92, 0.06);
  color: #1a3a5c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: all 0.2s;
  font-weight: 600;
  font-family: "Source Sans 3";
}

.header-btn:hover {
  background: rgba(245, 160, 35, 0.15);
  color: #e8880a;
}

/* ── Web Chat Area ── */
#webchat {
  flex: 1;
  width: 100%;
  overflow: hidden;
}

/* ── Web Chat Style Overrides ── */
.webchat__suggested-actions__item-box {
  padding: 2px !important;
}

.webchat__suggested-actions__stack {
  flex-wrap: wrap;
  display: flex;
  justify-content: flex-end;
}

.webchat__suggested-actions__button-text {
  overflow: visible !important;
  text-wrap: inherit !important;
  font-weight: 600;
}

.webchat__suggested-actions__item-box
  button:hover
  .webchat__suggested-actions__button-text {
  color: #fff !important;
}

.webchat__send-box__main {
  border-top: 1px solid rgba(26, 58, 92, 0.08) !important;
}

.webchat__send-box__main input,
.webchat__send-box__main textarea,
.webchat__send-box-text-box__input,
.webchat__send-box__main input::placeholder,
.webchat__send-box__main textarea::placeholder,
.webchat__send-box-text-box__input::placeholder {
  font-size: 10px !important;
}

/* Reduce chat font sizes by 30% (except title) */
.webchat__stacked-layout__message-row .webchat__text-content__markdown,
.webchat__stacked-layout__message-row .webchat__text-content__markdown p,
.webchat__bubble__content .webchat__text-content__markdown,
.webchat__bubble__content .webchat__text-content__markdown p,
.webchat__bubble--from-user .webchat__bubble__content,
.webchat__bubble--from-user .webchat__bubble__content p,
.webchat__bubble--from-user p {
  font-size: 12px !important;
  padding-bottom: 0 !important;
}

.webchat__bubble__content .webchat__text-content__markdown p:not(:last-child),
.webchat__stacked-layout__message-row
  .webchat__text-content__markdown
  p:not(:last-child),
.webchat__bubble--from-user .webchat__bubble__content p:not(:last-child),
.webchat__bubble--from-user p:not(:last-child),
.webchat__bubble__content .webchat__text-content__markdown ul:not(:last-child),
.webchat__stacked-layout__message-row
  .webchat__text-content__markdown
  ul:not(:last-child) {
  padding-bottom: 10px !important;
}

.webchat__stacked-layout__message-row
  .webchat__text-content__markdown
  > :last-child,
.webchat__bubble--from-user .webchat__bubble__content > :last-child,
.webchat__bubble__content .webchat__text-content__markdown > :last-child {
  padding-bottom: 0px !important;
}

.webchat__bubble__content .webchat__text-content__markdown ul,
.webchat__stacked-layout__message-row .webchat__text-content__markdown ul {
  list-style-position: outside;
  padding-left: 20px;
  margin: 0;
}

.webchat__bubble__content :is(h1, h2, h3, h4, h5) {
  font-size: 18px;
  padding-bottom: 10px;
  margin-bottom: 0;
}

.webchat__bubble__content .webchat__text-content__markdown ul li,
.webchat__stacked-layout__message-row .webchat__text-content__markdown ul li {
  padding-bottom: 4px !important;
}

.webchat__suggested-actions__button-text {
  font-size: 12px !important;
}

.webchat__stacked-layout__status {
  font-size: 10px !important;
}

.webchat__basic-transcript
  .webchat__basic-transcript__scrollable::-webkit-scrollbar {
  width: 4px;
}

.webchat__basic-transcript
  .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
  background: rgba(26, 58, 92, 0.12);
  border-radius: 4px;
}

/* Adaptive cards */
.ac-container.ac-adaptiveCard {
  background: rgba(255, 255, 255, 0.85) !important;
  border-radius: 14px !important;
}

.ac-textBlock {
  color: #1a3a5c !important;
}

.ac-textRun {
  color: #1a3a5c !important;
  background: transparent !important;
}

.ac-pushButton {
  background: #f7941d !important;
  color: #fff !important;
  border-radius: 10px !important;
  border: none !important;
}

.ac-input .ac-textInput,
.ac-input .ac-textInput.ac-input-required {
  border: 1.5px solid rgba(26, 58, 92, 0.12) !important;
  border-radius: 10px !important;
  color: #1a3a5c !important;
  background: rgba(255, 255, 255, 0.9) !important;
}

.ac-multichoiceInput {
  border: 1.5px solid rgba(26, 58, 92, 0.12) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #1a3a5c !important;
}

.webchat__bubble.webchat__bubble--from-user .webchat__bubble__content {
  min-height: 36px !important;
}

.webchat__send-box .webchat__send-box-text-box__input {
  font-size: 14px !important;
  font-family: var(--font-text) !important;
}

.ac-anchor {
  color: #f7941d !important;
}

.webchat__send-box
  .webchat__suggested-actions
  .webchat__suggested-actions__button {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.webchat__stacked-layout__message-row
  .webchat__text-content--is-markdown
  .webchat__link-definitions__list-item-body {
  font-size: 14px !important;
  font-family: var(--font-text) !important;
}

.webchat__stacked-layout__message-row
  .webchat__link-definitions
  .webchat__link-definitions__badge {
  padding: 2px 6px !important;
}

@media (max-width: 767px) {
  .header-info p {
    font-size: 10px;
  }

  .webchat__send-box
    .webchat__suggested-actions
    .webchat__suggested-actions__button {
    padding: 4px 8px !important;
    height: auto !important;
    font-weight: 600;
  }

  #chatbot-container {
    border-radius: 12px;
  }

  #chat-header {
    padding: 8px 12px;
  }

  .webchat__suggested-actions__button-text {
    font-size: 10px !important;
  }

  #chatbot-bubble {
    padding: 4px;
  }

  #chatbot-bubble span {
    display: none;
  }
}
