/**
 * chat-widget.css — AI Sales Lead Bot for markandrewmarquez.com
 *
 * Matched to the Personal Web theme's dark palette and
 * Montserrat / Raleway font stack.
 *
 * Deploy this file to Azure Static Web Apps alongside widget.js.
 */

/* ---------------------------------------------------------------------------
   Custom Properties
   --------------------------------------------------------------------------- */

:root {
  --mm-accent: #6366f1;
  --mm-accent-hover: #4f46e5;
  --mm-accent-glow: rgba(99, 102, 241, 0.35);
  --mm-surface: #1a1b2e;
  --mm-surface-raised: #242538;
  --mm-text: #e2e8f0;
  --mm-text-muted: #94a3b8;
  --mm-border: #2d2e42;
  --mm-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --mm-radius: 14px;
  --mm-bubble-size: 56px;
  --mm-panel-width: 380px;
  --mm-panel-height: 560px;
  --mm-z: 99999;
  --mm-font: 'Raleway', 'Montserrat', -apple-system, sans-serif;
  --mm-font-heading: 'Montserrat', 'Raleway', sans-serif;
}

/* ---------------------------------------------------------------------------
   Floating Bubble
   --------------------------------------------------------------------------- */

#mm-chat-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: var(--mm-bubble-size);
  height: var(--mm-bubble-size);
  border-radius: 50%;
  background: var(--mm-accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px var(--mm-accent-glow);
  z-index: var(--mm-z);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--mm-font);
}

#mm-chat-bubble:hover {
  transform: scale(1.08);
  background: var(--mm-accent-hover);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

#mm-chat-bubble:active {
  transform: scale(0.95);
}

#mm-chat-bubble.active {
  background: var(--mm-accent-hover);
}

#mm-chat-bubble .bubble-icon,
#mm-chat-bubble .close-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease;
}

@keyframes mm-bubble-pulse {
  0%, 100% { box-shadow: 0 4px 16px var(--mm-accent-glow); }
  50% { box-shadow: 0 4px 24px rgba(99, 102, 241, 0.6), 0 0 0 8px rgba(99, 102, 241, 0.08); }
}

#mm-chat-bubble.pulse {
  animation: mm-bubble-pulse 1.5s ease-in-out 2;
}

/* ---------------------------------------------------------------------------
   Chat Panel
   --------------------------------------------------------------------------- */

#mm-chat-panel {
  position: fixed;
  bottom: calc(24px + var(--mm-bubble-size) + 14px);
  right: 24px;
  width: var(--mm-panel-width);
  height: var(--mm-panel-height);
  max-height: calc(100vh - 120px);
  max-width: calc(100vw - 32px);
  background: var(--mm-surface);
  border-radius: var(--mm-radius);
  box-shadow: var(--mm-shadow);
  border: 1px solid var(--mm-border);
  z-index: var(--mm-z);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  font-family: var(--mm-font);
}

#mm-chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---------------------------------------------------------------------------
   Chat Header
   --------------------------------------------------------------------------- */

.mm-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--mm-surface-raised);
  border-bottom: 1px solid var(--mm-border);
  flex-shrink: 0;
}

.mm-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mm-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
}

.mm-header-name {
  font-family: var(--mm-font-heading);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  color: var(--mm-text);
}

.mm-header-tagline {
  font-size: 11px;
  color: var(--mm-text-muted);
  line-height: 1.2;
}

.mm-chat-minimize {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--mm-text-muted);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.mm-chat-minimize:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--mm-text);
}

/* ---------------------------------------------------------------------------
   Chat Container (nlux mounts here)
   --------------------------------------------------------------------------- */

#mm-chat-container {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#mm-chat-container .nlux-AiChat-root {
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  background: var(--mm-surface) !important;
  font-family: var(--mm-font) !important;
}

#mm-chat-container .nlux-conversation-container {
  padding: 10px 12px !important;
}

#mm-chat-container .nlux-composer-container {
  padding: 6px 10px 10px !important;
}

#mm-chat-container .nlux-comp-message--received {
  font-size: 13.5px;
  line-height: 1.55;
}

#mm-chat-container .nlux-comp-message--sent {
  font-size: 13.5px;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   Completion Banner
   --------------------------------------------------------------------------- */

#mm-completion-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(16, 185, 129, 0.1);
  color: #6ee7b7;
  font-size: 12.5px;
  font-weight: 500;
  border-top: 1px solid rgba(16, 185, 129, 0.2);
  flex-shrink: 0;
  animation: mm-banner-slide 0.3s ease;
}

@keyframes mm-banner-slide {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------------
   Mobile
   --------------------------------------------------------------------------- */

@media (max-width: 480px) {
  #mm-chat-panel {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-width: 100vw;
    border-radius: 0;
    transform-origin: bottom center;
  }

  #mm-chat-bubble {
    bottom: 16px;
    right: 16px;
  }
}

/* ---------------------------------------------------------------------------
   Reduced Motion
   --------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  #mm-chat-panel {
    transition: opacity 0.1s ease, visibility 0.1s;
    transform: none !important;
  }

  #mm-chat-bubble { transition: none; }
  #mm-chat-bubble.pulse { animation: none; }
  #mm-completion-banner { animation: none; }
}
