/* tAI Chat Widget — Dark theme (yellow/black) */

.sc-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eab308;
  color: #0c0a08;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.875rem;
  font-family: 'Geist Sans', system-ui, sans-serif;
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.sc-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(234, 179, 8, 0.4);
}

.sc-bubble--hidden { display: none; }

.sc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(12, 10, 8, 0.6);
  backdrop-filter: blur(4px);
  display: none;
}

.sc-backdrop--visible { display: block; }

.sc-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  width: 380px;
  max-height: 560px;
  background: #131110;
  border: 1px solid #2d2a26;
  border-radius: 12px;
  display: none;
  flex-direction: column;
  font-family: 'Geist Sans', system-ui, sans-serif;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.sc-panel--open { display: flex; }

.sc-panel--max {
  bottom: 5vh;
  right: 5vw;
  width: 90vw;
  max-width: 700px;
  max-height: 90vh;
}

/* Header */
.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #0c0a08;
  border-bottom: 1px solid #2d2a26;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #eab308;
}

.sc-header button {
  background: none;
  border: none;
  color: #6b6660;
  cursor: pointer;
  font-size: 1.125rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.sc-header button:hover {
  color: #faf9f7;
  background: #1e1c1a;
}

/* Messages */
.sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.sc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #d1cdc8;
  word-break: break-word;
}

.sc-msg--user {
  align-self: flex-end;
  background: #eab308;
  color: #0c0a08;
  border-bottom-right-radius: 4px;
}

.sc-msg--assistant {
  align-self: flex-start;
  background: #1e1c1a;
  border: 1px solid #2d2a26;
  border-bottom-left-radius: 4px;
}

.sc-msg a { color: #eab308; }
.sc-msg code {
  background: #0c0a08;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
}

.sc-msg pre {
  background: #0c0a08;
  border: 1px solid #2d2a26;
  border-radius: 6px;
  padding: 10px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 0.75rem;
}

.sc-msg pre code {
  background: none;
  padding: 0;
}

.sc-msg strong { color: #faf9f7; }

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

/* Typing indicator */
.sc-typing {
  padding: 8px 16px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.sc-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b6660;
  animation: sc-dot 1.2s infinite;
}

.sc-typing span:nth-child(2) { animation-delay: 0.2s; }
.sc-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sc-dot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Input */
.sc-input-row {
  display: flex;
  align-items: flex-end;
  padding: 12px;
  border-top: 1px solid #2d2a26;
  background: #0c0a08;
  gap: 8px;
}

.sc-input {
  flex: 1;
  background: #131110;
  border: 1px solid #2d2a26;
  border-radius: 8px;
  padding: 10px 12px;
  color: #faf9f7;
  font-family: inherit;
  font-size: 0.8125rem;
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 120px;
}

.sc-input:focus { border-color: #eab308; }

.sc-input::placeholder { color: #6b6660; }

.sc-send {
  background: #eab308;
  color: #0c0a08;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.sc-send:hover { background: #ca8a04; }

/* Buttons (onboarding actions) */
.sc-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.sc-btn {
  background: #1e1c1a;
  border: 1px solid #2d2a26;
  border-radius: 8px;
  padding: 8px 16px;
  color: #d1cdc8;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.sc-btn:hover {
  border-color: #eab308;
  color: #faf9f7;
}

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

  .sc-bubble {
    bottom: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 0.75rem;
  }
}
