/* Feedback chat widget — injected into every codelab page at build time. */

#bilue-feedback-root {
  all: initial;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#bilue-feedback-root * {
  box-sizing: border-box;
  font-family: inherit;
}

#bilue-feedback-root {
  /* Bilue brand blue (matches --bilue-primary / --bilue-blue in authed.css) */
  --bfw-accent: #00a1ff;
  --bfw-accent-dark: #0a84d6;
  --bfw-bg: #ffffff;
  --bfw-bg-alt: #f5f3f1;
  --bfw-text: #24211e;
  --bfw-text-muted: #6b6560;
  --bfw-border: #e5e1dc;
  --bfw-bubble-user: #00a1ff;
  --bfw-bubble-user-text: #ffffff;
  --bfw-bubble-assistant: #f5f3f1;
  --bfw-bubble-assistant-text: #24211e;
  --bfw-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  #bilue-feedback-root {
    --bfw-bg: #262421;
    --bfw-bg-alt: #322f2b;
    --bfw-text: #f2efec;
    --bfw-text-muted: #a8a29a;
    --bfw-border: #3d3934;
    --bfw-bubble-assistant: #322f2b;
    --bfw-bubble-assistant-text: #f2efec;
    --bfw-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.4);
  }
}

.bfw-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--bfw-accent);
  color: #fff;
  box-shadow: var(--bfw-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483000;
  transition: transform 0.15s ease, background 0.15s ease;
}

.bfw-fab:hover {
  background: var(--bfw-accent-dark);
  transform: scale(1.05);
}

.bfw-fab svg {
  width: 26px;
  height: 26px;
}

.bfw-panel {
  position: fixed;
  right: 24px;
  bottom: 92px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 140px);
  background: var(--bfw-bg);
  border-radius: 16px;
  box-shadow: var(--bfw-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 2147483000;
  border: 1px solid var(--bfw-border);
}

.bfw-panel[hidden],
.bfw-fab[hidden] {
  display: none;
}

.bfw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bfw-accent);
  color: #fff;
  flex-shrink: 0;
}

.bfw-header-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.bfw-header-subtitle {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 400;
}

.bfw-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  opacity: 0.85;
}

.bfw-close:hover {
  opacity: 1;
}

.bfw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bfw-bg);
}

.bfw-msg {
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.bfw-msg-user {
  align-self: flex-end;
  background: var(--bfw-bubble-user);
  color: var(--bfw-bubble-user-text);
  border-bottom-right-radius: 4px;
}

.bfw-msg-assistant {
  align-self: flex-start;
  background: var(--bfw-bubble-assistant);
  color: var(--bfw-bubble-assistant-text);
  border-bottom-left-radius: 4px;
}

.bfw-msg-error {
  align-self: flex-start;
  background: transparent;
  color: #b3261e;
  font-size: 12.5px;
}

.bfw-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  background: var(--bfw-bubble-assistant);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.bfw-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bfw-text-muted);
  animation: bfw-bounce 1.2s infinite ease-in-out;
}

.bfw-typing span:nth-child(2) { animation-delay: 0.15s; }
.bfw-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bfw-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.bfw-inputbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--bfw-border);
  background: var(--bfw-bg-alt);
  flex-shrink: 0;
}

.bfw-textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--bfw-border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--bfw-text);
  background: var(--bfw-bg);
  max-height: 90px;
  line-height: 1.4;
}

.bfw-textarea:focus {
  outline: 2px solid var(--bfw-accent);
  outline-offset: -1px;
}

.bfw-send {
  border: none;
  background: var(--bfw-accent);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.bfw-send:hover:not(:disabled) {
  background: var(--bfw-accent-dark);
}

.bfw-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.bfw-footer {
  text-align: center;
  font-size: 10.5px;
  color: var(--bfw-text-muted);
  padding: 4px 0 8px;
  background: var(--bfw-bg-alt);
  flex-shrink: 0;
}

@media (max-width: 420px) {
  .bfw-panel {
    right: 16px;
    left: 16px;
    width: auto;
  }
  .bfw-fab {
    right: 16px;
    bottom: 16px;
  }
}
