/* ═══════════════════════════════════════════════════════════════════
   FUEsion App Guide Agent — Chat Panel Styles
   ═══════════════════════════════════════════════════════════════════ */

.guide-agent-panel {
  position: fixed;
  right: -420px;
  top: 0;
  width: 400px;
  height: 100vh;
  background: var(--bg-card, #1a1d2e);
  border-left: 1px solid var(--border-color, rgba(255,255,255,0.08));
  box-shadow: -4px 0 24px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.guide-agent-panel.open {
  right: 0;
}

/* Header */
.guide-agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(59,130,246,0.05));
}

.guide-agent-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
}

.guide-agent-title svg {
  stroke: #8b5cf6;
}

.guide-agent-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.guide-agent-close:hover {
  color: #f87171;
  background: rgba(248,113,113,0.1);
}

/* Messages area */
.guide-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-agent-messages::-webkit-scrollbar {
  width: 5px;
}

.guide-agent-messages::-webkit-scrollbar-track {
  background: transparent;
}

.guide-agent-messages::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,0.3);
  border-radius: 3px;
}

/* Message bubbles */
.guide-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: guideSlideIn 0.2s ease-out;
}

@keyframes guideSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.guide-msg.user {
  align-self: flex-end;
}

.guide-msg.ai {
  align-self: flex-start;
}

.guide-msg-content {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
}

.guide-msg.user .guide-msg-content {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.guide-msg.ai .guide-msg-content {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.guide-msg.ai .guide-msg-content code {
  background: rgba(139,92,246,0.15);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: #c4b5fd;
}

.guide-msg.ai .guide-msg-content strong {
  color: #a78bfa;
}

/* Action buttons in messages */
.guide-action-btn {
  margin-top: 8px;
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.guide-action-btn.nav-action {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
}

.guide-action-btn.nav-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,0.4);
}

.guide-action-btn.trigger-action {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.guide-action-btn.trigger-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,158,11,0.4);
}

/* Thinking animation */
.guide-thinking {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
  font-style: italic;
}

.guide-thinking::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(139,92,246,0.3);
  border-top-color: #8b5cf6;
  border-radius: 50%;
  animation: guideSpin 0.8s linear infinite;
}

@keyframes guideSpin {
  to { transform: rotate(360deg); }
}

/* User attachments in messages */
.user-attachments {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.user-attachments img.att-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
}

.user-attachments .att-file-badge {
  background: rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #94a3b8;
}

/* Attachments preview area */
.guide-agent-attachments {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

.guide-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(139,92,246,0.15);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: #c4b5fd;
}

.guide-attachment-chip img {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
}

.guide-attachment-chip .file-icon {
  display: flex;
}

.guide-attachment-chip .att-name {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-attachment-chip .att-remove {
  cursor: pointer;
  color: #f87171;
  font-weight: bold;
  margin-left: 2px;
}

.guide-attachment-chip .att-remove:hover {
  color: #fca5a5;
}

/* Input area */
.guide-agent-input-area {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.2);
}

.guide-text-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 9px 12px;
  color: #e2e8f0;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.guide-text-input:focus {
  border-color: rgba(139,92,246,0.5);
}

.guide-text-input::placeholder {
  color: #64748b;
}

.guide-attach-btn,
.guide-voice-btn,
.guide-send-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.guide-attach-btn:hover,
.guide-voice-btn:hover {
  color: #c4b5fd;
  background: rgba(139,92,246,0.1);
}

.guide-send-btn {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  padding: 7px;
}

.guide-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(139,92,246,0.4);
}

.guide-voice-btn.listening {
  color: #f87171;
  background: rgba(248,113,113,0.15);
  animation: guidePulse 1.5s infinite;
}

@keyframes guidePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(248,113,113,0); }
}

/* Sidebar launcher button */
.guide-agent-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.guide-agent-launcher:hover {
  background: rgba(139,92,246,0.1);
  color: #c4b5fd;
  border-color: rgba(139,92,246,0.2);
}

.guide-agent-launcher svg {
  flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .guide-agent-panel {
    width: 100%;
    right: -100%;
  }
}

/* ===== AI Guide launcher highlight (menu-only assistant) ===== */
.guide-agent-launcher-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #ffffff;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.45);
}

/* Pulsing attention state — applied until the user opens the guide for the first time */
.guide-agent-launcher--attention {
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(139, 92, 246, 0.30);
  animation: guideLauncherPulse 1.8s ease-in-out infinite;
}
.guide-agent-launcher--attention .guide-agent-launcher-badge {
  animation: guideBadgePulse 1.8s ease-in-out infinite;
}
@keyframes guideLauncherPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18); }
}
@keyframes guideBadgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.08); opacity: 0.85; }
}
