/* ═══════════════════════════════════════════
   AI AGENT WIDGET — Cyril Joseph Photography
   Floating chat bubble + panel
   ═══════════════════════════════════════════ */

/* ── Trigger Button ── */
.cj-agent-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--cj-gold, #B8974A);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(184, 151, 74, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cj-agent-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(184, 151, 74, 0.45);
}
.cj-agent-btn svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}
.cj-agent-btn--pulse::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--cj-gold, #B8974A);
  animation: cjPulse 2s ease-out infinite;
}
@keyframes cjPulse {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* ── Chat Panel ── */
.cj-agent-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 9999;
  width: 380px;
  max-height: 520px;
  background: var(--cj-ink-deep, #1A1A18);
  border: 1px solid var(--cj-border, #2A2A28);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.cj-agent-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.cj-agent-header {
  padding: 16px 20px;
  background: var(--cj-ink, #0C0C0A);
  border-bottom: 1px solid var(--cj-border, #2A2A28);
  display: flex;
  align-items: center;
  gap: 12px;
}
.cj-agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cj-gold, #B8974A);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--cj-font-display, Georgia);
  font-size: 16px;
  color: #fff;
  font-weight: 300;
}
.cj-agent-header-info h4 {
  margin: 0;
  font-family: var(--cj-font-ui, sans-serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--cj-pearl, #F5F3EF);
}
.cj-agent-header-info span {
  font-size: 11px;
  color: var(--cj-ink-muted, #6B6B60);
}
.cj-agent-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--cj-ink-muted, #6B6B60);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}
.cj-agent-close:hover {
  color: var(--cj-pearl, #F5F3EF);
}

/* Messages area */
.cj-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  max-height: 320px;
}
.cj-agent-messages::-webkit-scrollbar { width: 4px; }
.cj-agent-messages::-webkit-scrollbar-track { background: transparent; }
.cj-agent-messages::-webkit-scrollbar-thumb { background: var(--cj-border, #2A2A28); border-radius: 2px; }

.cj-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--cj-font-ui, sans-serif);
  font-size: 13px;
  line-height: 1.5;
  animation: cjMsgIn 0.3s ease;
}
@keyframes cjMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cj-msg--bot {
  align-self: flex-start;
  background: rgba(184, 151, 74, 0.1);
  border: 1px solid rgba(184, 151, 74, 0.2);
  color: var(--cj-pearl, #F5F3EF);
}
.cj-msg--user {
  align-self: flex-end;
  background: var(--cj-gold, #B8974A);
  color: #fff;
}

/* Quick Replies */
.cj-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 12px;
}
.cj-quick-reply {
  background: rgba(184, 151, 74, 0.1);
  border: 1px solid rgba(184, 151, 74, 0.25);
  color: var(--cj-gold, #B8974A);
  font-family: var(--cj-font-ui, sans-serif);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.cj-quick-reply:hover {
  background: var(--cj-gold, #B8974A);
  color: #fff;
}

/* Typing indicator */
.cj-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}
.cj-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cj-gold, #B8974A);
  animation: cjTypingDot 1.2s ease-in-out infinite;
}
.cj-typing span:nth-child(2) { animation-delay: 0.2s; }
.cj-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes cjTypingDot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.1); }
}

/* Input area */
.cj-agent-input {
  padding: 12px 16px;
  border-top: 1px solid var(--cj-border, #2A2A28);
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--cj-ink, #0C0C0A);
}
.cj-agent-input input {
  flex: 1;
  background: var(--cj-ink-deep, #1A1A18);
  border: 1px solid var(--cj-border, #2A2A28);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--cj-pearl, #F5F3EF);
  font-family: var(--cj-font-ui, sans-serif);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.cj-agent-input input:focus {
  border-color: var(--cj-gold, #B8974A);
}
.cj-agent-input input::placeholder {
  color: var(--cj-ink-muted, #6B6B60);
}
.cj-agent-voice-btn,
.cj-agent-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cj-agent-voice-btn {
  background: transparent;
  color: var(--cj-ink-muted, #6B6B60);
}
.cj-agent-voice-btn:hover,
.cj-agent-voice-btn.is-listening {
  color: var(--cj-gold, #B8974A);
}
.cj-agent-send-btn {
  background: var(--cj-gold, #B8974A);
}
.cj-agent-send-btn:hover {
  background: var(--cj-gold-light, #D4AF6E);
}
.cj-agent-send-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .cj-agent-panel {
    right: 12px;
    left: 12px;
    bottom: 80px;
    width: auto;
    max-height: 70vh;
  }
  .cj-agent-btn {
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
  }
}
