/* ══════════════════════════════════════════════════════════════════════════
 * Global AI Chat — Floating Widget Styles
 * ══════════════════════════════════════════════════════════════════════════ */

/* ── Floating Action Button ────────────────────────────────── */
.gc-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  background: linear-gradient(135deg, hsl(265, 65%, 50%), hsl(280, 60%, 42%));
  color: white;
  box-shadow: 0 4px 20px hsla(265, 65%, 40%, 0.4),
              0 2px 8px hsla(0, 0%, 0%, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
}
.gc-fab:hover {
  width: 130px;
  border-radius: 28px;
  box-shadow: 0 6px 28px hsla(265, 65%, 40%, 0.5),
              0 4px 12px hsla(0, 0%, 0%, 0.2);
  transform: translateY(-2px);
}
.gc-fab .gc-fab-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.3s, opacity 0.3s;
}
.gc-fab:hover .gc-fab-label {
  max-width: 80px;
  opacity: 1;
}
.gc-fab.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

/* Subtle pulse animation on idle */
@keyframes gc-pulse {
  0%, 100% { box-shadow: 0 4px 20px hsla(265, 65%, 40%, 0.4), 0 2px 8px hsla(0,0%,0%,0.15); }
  50%      { box-shadow: 0 4px 28px hsla(265, 65%, 40%, 0.55), 0 2px 12px hsla(0,0%,0%,0.2); }
}
.gc-fab:not(:hover) {
  animation: gc-pulse 3s ease-in-out infinite;
}

/* ── Chat Panel ────────────────────────────────────────────── */
.gc-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9001;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 560px;
  max-height: calc(100vh - 120px);
  border-radius: 16px;
  background: var(--surface-0, #fff);
  border: 1px solid var(--border, hsl(0,0%,88%));
  box-shadow: 0 12px 48px hsla(0, 0%, 0%, 0.15),
              0 4px 16px hsla(0, 0%, 0%, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gc-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ────────────────────────────────────────────────── */
.gc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, hsl(265, 65%, 50%), hsl(280, 60%, 42%));
  color: white;
  flex-shrink: 0;
}
.gc-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.gc-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: hsla(0, 0%, 100%, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.gc-header-title {
  font-size: 14px;
  font-weight: 700;
}
.gc-header-sub {
  font-size: 11px;
  opacity: 0.8;
}
.gc-header-actions {
  display: flex;
  gap: 4px;
}
.gc-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: hsla(0, 0%, 100%, 0.15);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.gc-icon-btn:hover {
  background: hsla(0, 0%, 100%, 0.25);
}

/* ── Messages Area ─────────────────────────────────────────── */
.gc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

/* ── Welcome Screen ────────────────────────────────────────── */
.gc-welcome {
  text-align: center;
  padding: 24px 12px;
}
.gc-welcome-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.gc-welcome-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
  margin-bottom: 6px;
}
.gc-welcome-sub {
  font-size: 13px;
  color: var(--text-muted, #6c7a89);
  line-height: 1.5;
  margin-bottom: 20px;
}
.gc-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.gc-quick-btn {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border, hsl(0,0%,88%));
  background: var(--surface-1, hsl(0,0%,97%));
  color: var(--text-primary, #1a1a2e);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.gc-quick-btn:hover {
  background: hsl(265, 60%, 95%);
  border-color: hsl(265, 50%, 70%);
  color: hsl(265, 65%, 40%);
}

/* ── Message Bubbles ───────────────────────────────────────── */
.gc-msg {
  display: flex;
}
.gc-msg-user {
  justify-content: flex-end;
}
.gc-msg-assistant, .gc-msg-error {
  justify-content: flex-start;
}
.gc-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.gc-bubble p {
  margin: 0 0 6px;
}
.gc-bubble p:last-child {
  margin-bottom: 0;
}
.gc-bubble ul {
  margin: 4px 0;
  padding-left: 18px;
}
.gc-bubble li {
  margin-bottom: 2px;
}
.gc-bubble-user {
  background: linear-gradient(135deg, hsl(265, 65%, 50%), hsl(280, 55%, 45%));
  color: white;
  border-bottom-right-radius: 4px;
}
.gc-bubble-ai {
  background: var(--surface-1, hsl(0,0%,96%));
  color: var(--text-primary, #1a1a2e);
  border-bottom-left-radius: 4px;
}
.gc-bubble-ai code {
  background: hsla(0, 0%, 0%, 0.06);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12px;
}
.gc-bubble-error {
  background: hsl(0, 85%, 95%);
  color: hsl(0, 65%, 40%);
  border-bottom-left-radius: 4px;
  font-size: 12px;
}

/* ── Typing Indicator ──────────────────────────────────────── */
.gc-typing {
  padding: 12px 18px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.gc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted, #6c7a89);
  opacity: 0.4;
  animation: gc-bounce 1.4s ease-in-out infinite;
}
.gc-dot:nth-child(2) { animation-delay: 0.2s; }
.gc-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes gc-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── Input Area ────────────────────────────────────────────── */
.gc-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border, hsl(0,0%,90%));
  background: var(--surface-0, #fff);
  flex-shrink: 0;
}
.gc-input {
  flex: 1;
  border: 1px solid var(--border, hsl(0,0%,88%));
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: var(--surface-1, hsl(0,0%,97%));
  color: var(--text-primary, #1a1a2e);
  transition: border-color 0.15s;
  line-height: 1.4;
  max-height: 100px;
}
.gc-input:focus {
  border-color: hsl(265, 50%, 60%);
}
.gc-input::placeholder {
  color: var(--text-muted, #999);
}
.gc-send-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, hsl(265, 65%, 50%), hsl(280, 55%, 45%));
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.gc-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px hsla(265, 65%, 40%, 0.4);
}
.gc-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

/* ── Compact Mini-Dock Bar Mode ────────────────────────────── */
.gc-panel.compact {
  height: auto !important;
  max-height: 165px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.gc-panel.compact .gc-messages,
.gc-panel.compact .gc-history-panel,
.gc-panel.compact .gc-welcome {
  display: none !important;
}
.gc-panel.compact .gc-header {
  padding: 6px 12px;
}
.gc-panel.compact .gc-header-sub {
  display: none;
}
.gc-panel.compact .gc-header-title {
  font-size: 13px;
}
.gc-panel.compact .gc-spectrum-container {
  padding: 3px 12px !important;
}
.gc-panel.compact .gc-spectrum-label {
  font-size: 10px !important;
}
.gc-panel.compact .gc-spec-bar {
  max-height: 14px !important;
}
.gc-panel.compact .gc-input-wrap {
  padding: 4px 10px;
}
