/* ── Buggazi Public Support Chat Widget ─────────────────────────────
 * impeccable.style: Geist Sans, tinted neutrals, orange accent,
 * focus-visible, 44px touch targets, ease-out-quart motion.
 */

.sc-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f97316;
  color: #faf9f7;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4);
  z-index: 900;
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}
.sc-bubble:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(249, 115, 22, 0.5); }
.sc-bubble:active { transform: scale(0.95); }
.sc-bubble.hidden { display: none; }

.sc-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  height: 560px;
  background: #0c0a08;
  border: 1px solid #2d2a26;
  border-radius: 16px;
  display: none;
  flex-direction: column;
  z-index: 901;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  font-family: 'Geist Sans', 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}
.sc-panel.open { display: flex; }
.sc-panel.maximized {
  bottom: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: none;
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #1e1c1a;
  background: #131110;
  flex-shrink: 0;
}
.sc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sc-header-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f97316;
  color: #faf9f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}
.sc-header-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #faf9f7;
}
.sc-header-sub {
  font-size: 0.6875rem;
  color: #6b6660;
}
.sc-header-actions {
  display: flex;
  gap: 4px;
}
.sc-header-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: none;
  border: none;
  color: #9c9690;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.15s, color 0.15s;
}
.sc-header-btn:hover { background: #1e1c1a; color: #faf9f7; }

.sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sc-messages::-webkit-scrollbar { width: 4px; }
.sc-messages::-webkit-scrollbar-track { background: transparent; }
.sc-messages::-webkit-scrollbar-thumb { background: #2d2a26; border-radius: 2px; }

.sc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.6;
  word-wrap: break-word;
}
.sc-msg-user {
  align-self: flex-end;
  background: #f97316;
  color: #faf9f7;
  border-bottom-right-radius: 4px;
}
.sc-msg-assistant {
  align-self: flex-start;
  background: #1e1c1a;
  color: #d1cdc8;
  border-bottom-left-radius: 4px;
}
.sc-msg-assistant code {
  background: #0c0a08;
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}
.sc-msg-assistant pre {
  background: #0c0a08;
  border: 1px solid #2d2a26;
  border-radius: 6px;
  padding: 10px;
  margin: 8px 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
}
.sc-msg-assistant h2, .sc-msg-assistant h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #faf9f7;
  margin: 8px 0 4px;
}
.sc-msg-assistant strong { color: #faf9f7; }
.sc-msg-assistant a { color: #f97316; }

.sc-msg-expert {
  display: inline-block;
  font-size: 0.625rem;
  color: #6b6660;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sc-typing {
  padding: 0 16px 8px;
  font-size: 0.75rem;
  color: #6b6660;
  display: none;
}
.sc-typing.active { display: block; }
.sc-typing-dots { display: inline-flex; gap: 3px; }
.sc-typing-dots span {
  width: 5px; height: 5px; border-radius: 50%; background: #6b6660;
  animation: scBounce 1.2s infinite;
}
.sc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.sc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes scBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.sc-input-area {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #1e1c1a;
  background: #131110;
  flex-shrink: 0;
}
.sc-input {
  flex: 1;
  background: #1e1c1a;
  border: 1px solid #2d2a26;
  border-radius: 8px;
  padding: 10px 12px;
  color: #faf9f7;
  font-size: 0.8125rem;
  font-family: inherit;
  resize: none;
  min-height: 40px;
  max-height: 100px;
  outline: none;
  transition: border-color 0.2s;
}
.sc-input:focus { border-color: #f97316; }
.sc-input::placeholder { color: #4a4640; }

.sc-send {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f97316;
  color: #faf9f7;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.sc-send:hover { background: #ea580c; }
.sc-send:disabled { opacity: 0.5; cursor: not-allowed; }

.sc-welcome {
  text-align: center;
  padding: 2rem 1.5rem;
  color: #9c9690;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.sc-welcome h3 {
  color: #faf9f7;
  font-size: 1rem;
  margin-bottom: 8px;
}

.sc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.sc-button {
  padding: 6px 12px;
  background: #1e1c1a;
  border: 1px solid #2d2a26;
  border-radius: 6px;
  color: #d1cdc8;
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.sc-button:hover { border-color: #f97316; color: #faf9f7; }

/* Focus visible */
.sc-input:focus-visible, .sc-send:focus-visible, .sc-bubble:focus-visible, .sc-header-btn:focus-visible, .sc-button:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: 2px;
}

/* Mobile */
@media (max-width: 480px) {
  .sc-panel {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
  }
  .sc-bubble { bottom: 16px; right: 16px; }
}
