/* ============================================
   ARON MASCOT — Voice-First Live Guide
   ============================================ */

#aron-mascot {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9997;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mascot-body {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.mascot-body:hover {
  transform: scale(1.05);
}

#mascot-canvas {
  width: 140px;
  height: 175px;
  filter: drop-shadow(0 0 15px rgba(230, 57, 70, 0.15));
}

/* Listening Ring — Siri-style glow when active */
.mascot-listening-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
  transition: all 0.5s ease;
}
.mascot-listening-ring.active {
  border-color: rgba(0, 200, 100, 0.4);
  box-shadow: 0 0 30px rgba(0, 200, 100, 0.2), inset 0 0 20px rgba(0, 200, 100, 0.05);
  animation: listeningPulse 2s ease-in-out infinite;
}
@keyframes listeningPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
}

/* Status indicator */
.mascot-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s ease;
}
.status-dot.active {
  background: #00c864;
  box-shadow: 0 0 8px rgba(0, 200, 100, 0.6);
  animation: dotPulse 1.5s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.status-text {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Speech Bubble */
.mascot-speech-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-40%) translateY(-5px) scale(0.9);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 260px;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}
.mascot-speech-bubble.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-40%) translateY(-10px) scale(1);
}
.mascot-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 40%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--bg-secondary);
}
.mascot-speech-bubble p {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Mute button */
.mascot-actions {
  margin-top: 5px;
}
.mascot-mute {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.mascot-mute:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}
.mascot-mute svg {
  width: 12px;
  height: 12px;
}

/* Responsive */
@media (max-width: 768px) {
  #aron-mascot { bottom: 10px; left: 10px; }
  #mascot-canvas { width: 100px; height: 125px; }
  .mascot-speech-bubble { max-width: 200px; min-width: 120px; }
  .mascot-listening-ring { width: 120px; height: 120px; }
}


.mascot-body {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.mascot-body:hover {
  transform: scale(1.05);
}

#mascot-canvas {
  width: 140px;
  height: 175px;
  filter: drop-shadow(0 0 15px rgba(230, 57, 70, 0.15));
}

/* Speech Bubble */
.mascot-speech-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px) scale(0.9);
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 260px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}
.mascot-speech-bubble.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-10px) scale(1);
}
.mascot-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--bg-secondary);
}
.mascot-speech-bubble p {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}


/* Mascot Chat Panel */
.mascot-chat {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 300px;
  max-height: 0;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  margin-bottom: 10px;
  transition: all 0.4s ease;
  opacity: 0;
}
.mascot-chat.open {
  max-height: 350px;
  opacity: 1;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.mascot-chat-messages {
  max-height: 250px;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--red-primary) transparent;
}

.mascot-msg {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 85%;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.mascot-msg-user {
  align-self: flex-end;
  background: var(--red-primary);
  color: white;
  border-bottom-right-radius: 2px;
}
.mascot-msg-bot {
  align-self: flex-start;
  background: rgba(230, 57, 70, 0.08);
  border: 1px solid rgba(230, 57, 70, 0.15);
  color: var(--text-secondary);
  border-bottom-left-radius: 2px;
}

.mascot-chat-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid var(--glass-border);
  gap: 8px;
}
.mascot-chat-input input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
}
.mascot-chat-input input:focus {
  border-color: var(--red-primary);
}
.mascot-chat-input button {
  width: 34px;
  height: 34px;
  background: var(--red-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.mascot-chat-input button svg {
  width: 14px;
  height: 14px;
}

/* Mute button */
.mascot-actions {
  margin-top: 5px;
}
.mascot-mute {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.mascot-mute:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}
.mascot-mute svg {
  width: 14px;
  height: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  #aron-mascot { bottom: 10px; left: 10px; }
  #mascot-canvas { width: 100px; height: 125px; }
  .mascot-chat { width: 260px; }
  .mascot-speech-bubble { max-width: 200px; }
}


/* Voice activation controls — retain the portfolio's red/charcoal visual identity. */
.mascot-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.mascot-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(230, 57, 70, 0.45);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(20, 20, 24, 0.88);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.mascot-mic svg { width: 14px; height: 14px; flex: 0 0 auto; }
.mascot-mic:hover, .mascot-mic:focus-visible {
  outline: none;
  color: #fff;
  border-color: var(--red-primary);
  background: rgba(230, 57, 70, 0.18);
  box-shadow: 0 0 18px rgba(230, 57, 70, 0.18);
}
.mascot-mic.active {
  color: #fff;
  border-color: #00c864;
  background: rgba(0, 200, 100, 0.12);
  box-shadow: 0 0 14px rgba(0, 200, 100, 0.16);
}
.mascot-mic:disabled { opacity: 0.5; cursor: not-allowed; }
#aron-mascot[data-state="thinking"] .mascot-body { animation: aronThink 1.5s ease-in-out infinite; }
#aron-mascot[data-state="speaking"] #mascot-canvas { filter: drop-shadow(0 0 20px rgba(230, 57, 70, 0.4)); }
#aron-mascot[data-state="listening"] #mascot-canvas { filter: drop-shadow(0 0 18px rgba(0, 200, 100, 0.22)); }
@keyframes aronThink { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.015); } }
@media (prefers-reduced-motion: reduce) {
  #aron-mascot[data-state="thinking"] .mascot-body,
  .mascot-listening-ring.active, .status-dot.active { animation: none !important; }
  .mascot-body, .mascot-mic { transition: none !important; }
}
