/* ==========================================================================
   Carbon AI Feedback Widget — IBM Power Partner Network (/isv)
   Mirrors the widget on the Power Solutions Catalog page.
   ========================================================================== */
.carbon-bot-launcher-wrap,
.carbon-bot-window {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.carbon-bot-launcher-wrap *,
.carbon-bot-window * {
  box-sizing: border-box;
}

.carbon-bot-window p {
  margin: 0;
}

.carbon-bot-launcher-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 8500;
  display: inline-flex;
  align-items: center;
}

.carbon-bot-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  background: none;
  background-color: transparent;
  color: #0f62fe;
  border: none;
  border-radius: 0;
  font-family: inherit;
  cursor: pointer;
  box-shadow: none;
  padding: 0 16px 0 0;
  position: relative;
  transition: color 110ms cubic-bezier(0, 0, 0.38, 0.9),
              transform 110ms cubic-bezier(0, 0, 0.38, 0.9);
}

.carbon-bot-launcher:hover {
  color: #0353e9;
  transform: scale(1.08);
}

.carbon-bot-launcher:focus {
  outline: 2px solid #0f62fe;
  outline-offset: 4px;
}

.carbon-bot-launcher svg {
  width: 48px;
  height: 48px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Carbon tooltip */
.carbon-bot-tooltip {
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background-color: #262626;
  color: #ffffff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  padding: 6px 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms cubic-bezier(0, 0, 0.38, 0.9),
              visibility 120ms cubic-bezier(0, 0, 0.38, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.carbon-bot-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: transparent transparent transparent #262626;
}

.carbon-bot-launcher-wrap:hover .carbon-bot-tooltip,
.carbon-bot-launcher:focus-visible + .carbon-bot-tooltip,
.carbon-bot-launcher:focus + .carbon-bot-tooltip {
  opacity: 1;
  visibility: visible;
}

/* ── Chat window ─────────────────────────────────────────── */
.carbon-bot-window {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 590px;
  max-height: calc(100vh - 100px);
  background-color: #ffffff;
  border: 1px solid #393939;
  box-shadow: 0 12px 32px 0 rgba(0, 0, 0, 0.24);
  z-index: 8600;
  display: none;
  flex-direction: column;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity 150ms cubic-bezier(0, 0, 0.38, 0.9),
              transform 150ms cubic-bezier(0, 0, 0.38, 0.9);
  color: #161616;
  text-align: left;
}

.carbon-bot-window.is-open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Header */
.carbon-bot-header {
  background-color: #161616;
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #393939;
  flex-shrink: 0;
}

.carbon-bot-header__info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.carbon-bot-header__titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.carbon-bot-header__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.carbon-bot-header__tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32px;
  padding: 1px 4px;
  background-color: #393939;
  color: #78a9ff;
}

.carbon-bot-header__subtitle {
  font-size: 11px;
  color: #c6c6c6;
  line-height: 1.3;
}

.carbon-bot-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.carbon-bot-header__btn {
  background: none;
  border: none;
  color: #c6c6c6;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 70ms ease, color 70ms ease;
}

.carbon-bot-header__btn:hover {
  background-color: #393939;
  color: #ffffff;
}

.carbon-bot-header__btn:focus {
  outline: 2px solid #0f62fe;
  outline-offset: -2px;
}

/* Messages */
.carbon-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background-color: #f4f4f4;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.carbon-bot-date-chip {
  align-self: center;
  font-size: 11px;
  color: #6f6f6f;
  background-color: #e0e0e0;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.32px;
}

.carbon-bot-msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 90%;
}

.carbon-bot-msg-row--bot {
  align-self: stretch;
  max-width: 100%;
}

.carbon-bot-msg-row--bot > div {
  flex: 1;
  min-width: 0;
}

.carbon-bot-msg-row--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.carbon-bot-bubble {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.carbon-bot-msg-row--bot .carbon-bot-bubble {
  background-color: #ffffff;
  color: #161616;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.carbon-bot-msg-row--user .carbon-bot-bubble {
  background-color: #0f62fe;
  color: #ffffff;
}

.carbon-bot-msg-meta {
  font-size: 10px;
  margin-top: 4px;
  color: #8d8d8d;
  display: flex;
  align-items: center;
  gap: 6px;
}

.carbon-bot-msg-row--user .carbon-bot-msg-meta {
  justify-content: flex-end;
}

/* Quick action pills */
.carbon-bot-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.carbon-bot-pill {
  background-color: #ffffff;
  border: 1px solid #0f62fe;
  color: #0f62fe;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background-color 70ms ease, color 70ms ease;
}

.carbon-bot-pill:hover {
  background-color: #0f62fe;
  color: #ffffff;
}

.carbon-bot-pill:focus {
  outline: 2px solid #0f62fe;
  outline-offset: 1px;
}

/* Rating buttons */
.carbon-bot-rating-group {
  display: flex;
  gap: 4px;
  margin: 8px 0;
}

.carbon-bot-rating-btn {
  flex: 1;
  height: 36px;
  background-color: #ffffff;
  border: 1px solid #8d8d8d;
  color: #161616;
  font-family: inherit;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 70ms ease;
  padding: 2px;
}

.carbon-bot-rating-btn:hover,
.carbon-bot-rating-btn.is-selected {
  border-color: #0f62fe;
  background-color: #edf5ff;
  color: #0f62fe;
  font-weight: 600;
}

/* Inline form card */
.carbon-bot-form-card {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  padding: 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.carbon-bot-form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32px;
  color: #525252;
}

.carbon-bot-form-select,
.carbon-bot-form-input,
.carbon-bot-form-textarea {
  width: 100%;
  background-color: #f4f4f4;
  border: none;
  border-bottom: 1px solid #8d8d8d;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  color: #161616;
  outline: none;
  transition: border-bottom-color 70ms ease;
}

.carbon-bot-form-textarea {
  min-height: 56px;
  resize: vertical;
}

.carbon-bot-form-select:focus,
.carbon-bot-form-input:focus,
.carbon-bot-form-textarea:focus {
  border-bottom: 2px solid #0f62fe;
}

.carbon-bot-form-submit {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background-color: #0f62fe;
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 70ms ease;
}

.carbon-bot-form-submit:hover {
  background-color: #0353e9;
}

/* Success tile */
.carbon-bot-success-box {
  border-left: 3px solid #24a148;
  background-color: #defbe6;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 6px;
}

.carbon-bot-success-box svg {
  fill: #24a148;
  flex-shrink: 0;
  margin-top: 2px;
}

.carbon-bot-success-box__content {
  font-size: 12px;
  line-height: 1.4;
  color: #161616;
}

.carbon-bot-success-box__title {
  font-weight: 600;
  margin-bottom: 2px;
}

/* Typing indicator */
.carbon-bot-typing {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  width: fit-content;
}

.carbon-bot-typing.is-visible {
  display: flex;
}

.carbon-bot-typing-dot {
  width: 6px;
  height: 6px;
  background-color: #8d8d8d;
  border-radius: 50%;
  animation: carbonTypingDot 1.4s infinite ease-in-out;
}

.carbon-bot-typing-dot:nth-child(1) { animation-delay: 0s; }
.carbon-bot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.carbon-bot-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes carbonTypingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; background-color: #0f62fe; }
}

/* Footer */
.carbon-bot-footer {
  background-color: #ffffff;
  border-top: 1px solid #e0e0e0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.carbon-bot-close-btn {
  height: 40px;
  width: 100%;
  background-color: #0f62fe;
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 70ms ease;
}

.carbon-bot-close-btn[hidden] {
  display: none;
}

.carbon-bot-close-btn:hover {
  background-color: #0353e9;
}

.carbon-bot-close-btn:focus-visible {
  outline: 2px solid #0f62fe;
  outline-offset: 2px;
}

.carbon-bot-footer-disclaimer {
  font-size: 10px;
  color: #8d8d8d;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

@media (max-width: 480px) {
  .carbon-bot-launcher-wrap {
    bottom: 16px;
    right: 16px;
  }
  .carbon-bot-window {
    right: 16px;
    bottom: 76px;
    width: calc(100vw - 32px);
    height: calc(100vh - 96px);
  }
}
