/* ═══════════════════════════════════════════════
   Mira AI — Chatbot Widget Styles
   ═══════════════════════════════════════════════ */

/* ─── Widget Container ─── */

#mira-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─── Toggle Button ─── */

#mira-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--nal-purple);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: background 0.2s, transform 0.2s;
  position: relative;
  z-index: 2;
  animation: mira-pulse 3s ease-in-out infinite;
}

#mira-toggle:hover {
  background: var(--nal-purple-dark);
  transform: scale(1.08);
}

#mira-toggle::after {
  content: 'M';
}

/* ─── Chat Panel ─── */

#mira-panel {
  display: none;
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 340px;
  max-height: 480px;
  background: hsl(263 15% 12%);
  border: 1px solid hsl(263 12% 22%);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  flex-direction: column;
  animation: mira-fade-in 0.25s ease-out;
}

#mira-panel.open {
  display: flex;
}

/* ─── Header ─── */

#mira-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: hsl(263 15% 15%);
  border-bottom: 1px solid hsl(263 12% 22%);
}

.mira-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--nal-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.mira-header-info {
  flex: 1;
}

.mira-header-name {
  font-size: 13px;
  font-weight: 600;
  color: hsl(263 10% 88%);
}

.mira-header-status {
  font-size: 10px;
  color: var(--nal-sage);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mira-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nal-sage);
  display: inline-block;
}

.mira-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: hsl(263 8% 52%);
  font-size: 18px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.mira-close-btn:hover {
  background: hsl(263 12% 22%);
  color: hsl(263 10% 88%);
}

/* ─── Messages Area ─── */

#mira-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 320px;
  scrollbar-width: thin;
  scrollbar-color: hsl(263 12% 22%) transparent;
}

#mira-messages::-webkit-scrollbar {
  width: 4px;
}

#mira-messages::-webkit-scrollbar-track {
  background: transparent;
}

#mira-messages::-webkit-scrollbar-thumb {
  background: hsl(263 12% 28%);
  border-radius: 2px;
}

/* ─── Chat Bubbles ─── */

.mira-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  animation: mira-fade-in 0.3s ease-out;
}

.mira-msg.bot {
  align-self: flex-start;
  background: hsl(263 15% 18%);
  color: hsl(263 10% 88%);
  border-bottom-left-radius: 4px;
}

.mira-msg.user {
  align-self: flex-end;
  background: var(--nal-purple);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.mira-msg.system {
  align-self: center;
  background: transparent;
  color: hsl(263 8% 52%);
  font-size: 11px;
  font-style: italic;
  padding: 4px 8px;
  text-align: center;
}

/* ─── Suggestion Chips ─── */

.mira-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px 12px;
}

.mira-chip {
  padding: 6px 12px;
  border: 1px solid hsl(263 12% 28%);
  background: hsl(263 15% 15%);
  color: hsl(263 10% 80%);
  font-size: 11px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.mira-chip:hover {
  background: hsl(263 12% 22%);
  border-color: var(--nal-purple);
  color: hsl(263 10% 90%);
}

/* ─── Input Area ─── */

.mira-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid hsl(263 12% 22%);
  background: hsl(263 15% 12%);
}

.mira-input-area input {
  flex: 1;
  border: 1px solid hsl(263 12% 22%);
  background: hsl(263 18% 9%);
  color: hsl(263 10% 88%);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 12px;
  border-radius: 20px;
  outline: none;
  transition: border-color 0.2s;
}

.mira-input-area input::placeholder {
  color: hsl(263 8% 42%);
}

.mira-input-area input:focus {
  border-color: var(--nal-purple);
}

.mira-send-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--nal-purple);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.mira-send-btn:hover {
  background: var(--nal-purple-dark);
}

/* ─── Typing Indicator ─── */

.mira-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  align-self: flex-start;
}

.mira-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(263 8% 52%);
  animation: mira-dot 1.4s ease-in-out infinite;
}

.mira-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.mira-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ─── Animations ─── */

@keyframes mira-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mira-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes mira-pulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(126, 105, 155, 0.15);
  }
}

@keyframes mira-glitch-text {
  0% {
    transform: none;
    opacity: 1;
  }
  7% {
    transform: skew(-0.5deg, -0.9deg);
    opacity: 0.75;
  }
  10% {
    transform: none;
    opacity: 1;
  }
  27% {
    transform: none;
    opacity: 1;
  }
  30% {
    transform: skew(0.8deg, -0.1deg);
    opacity: 0.75;
  }
  35% {
    transform: none;
    opacity: 1;
  }
  52% {
    transform: none;
    opacity: 1;
  }
  55% {
    transform: skew(-1deg, 0.2deg);
    opacity: 0.75;
  }
  50% {
    transform: none;
    opacity: 1;
  }
  72% {
    transform: none;
    opacity: 1;
  }
  75% {
    transform: skew(0.4deg, 1deg);
    opacity: 0.75;
  }
  80% {
    transform: none;
    opacity: 1;
  }
  100% {
    transform: none;
    opacity: 1;
  }
}
