/* ── lunvaraAI Chat Widget ── */

:root {
  --lunvara-red: #DD0072;
  --lunvara-pink: #FF0000;
  --lunvara-dark: #1a1a1a;
  --lunvara-radius: 16px;
  --lunvara-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

/* Outer wrapper */
.lunvara-ai-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 0;
  font-family: -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

/* Top header */
.lunvara-ai-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.lunvara-ai-icon {
  font-size: 22px;
  color: var(--lunvara-dark);
}

.lunvara-ai-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--lunvara-dark);
  margin: 0;
  letter-spacing: -0.5px;
}

.lunvara-ai-title span {
  color: var(--lunvara-pink);
}

.lunvara-ai-subtitle {
  font-size: 15px;
  color: #666;
  margin: 0 0 20px;
}

/* Widget card */
.lunvara-ai-widget {
  border-radius: var(--lunvara-radius);
  overflow: hidden;
  box-shadow: var(--lunvara-shadow);
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: #fff;
}

/* Top bar */
.lunvara-ai-bar {
  background: linear-gradient(90deg, var(--lunvara-red) 0%, #c00019 100%);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--lunvara-radius) var(--lunvara-radius) 0 0;
}

.lunvara-ai-avatar {
  width: 46px;
  height: 46px;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #DD0072;
  flex-shrink: 0;
}

.lunvara-ai-bar strong {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}

.lunvara-ai-status {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lunvara-ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
  animation: lunvara-pulse 2s infinite;
}

@keyframes lunvara-pulse {

  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(74, 222, 128, 0.1);
  }
}

/* Messages area */
.lunvara-ai-messages {
  padding: 24px 22px;
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #fafafa;
  scroll-behavior: smooth;
}

.lunvara-ai-messages::-webkit-scrollbar {
  width: 4px;
}

.lunvara-ai-messages::-webkit-scrollbar-track {
  background: transparent;
}

.lunvara-ai-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

/* Message rows */
.lunvara-ai-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  animation: lunvara-fade-in 0.22s ease;
}

@keyframes lunvara-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lunvara-ai-msg--user {
  flex-direction: row-reverse;
}

.lunvara-ai-msg-icon {
  width: 30px;
  height: 30px;
  background: var(--lunvara-red);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

/* Bubbles */
.lunvara-ai-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.lunvara-ai-msg--ai .lunvara-ai-bubble {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom-left-radius: 4px;
}

.lunvara-ai-msg--user .lunvara-ai-bubble {
  background: var(--lunvara-red);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing dots */
.lunvara-dot-anim {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #999;
  margin: 0 2px;
  animation: lunvara-bounce 1.2s infinite;
}

.lunvara-dot-anim:nth-child(2) {
  animation-delay: 0.2s;
}

.lunvara-dot-anim:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes lunvara-bounce {

  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.4;
  }

  40% {
    transform: scale(1.0);
    opacity: 1;
  }
}

/* Input area */
.lunvara-ai-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.lunvara-ai-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
  background: #f7f7f7;
  color: #1a1a1a;
  transition: border-color 0.2s, background 0.2s;
}

.lunvara-ai-input:focus {
  border-color: var(--lunvara-red);
  background: #fff;
}

.lunvara-ai-input::placeholder {
  color: #aaa;
}

.lunvara-ai-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lunvara-ai-send {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: none;
  background: var(--lunvara-red);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
}

.lunvara-ai-send:hover {
  background: #c00019;
}

.lunvara-ai-send:active {
  transform: scale(0.95);
}

.lunvara-ai-send:disabled,
.lunvara-ai-send--loading {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
  .lunvara-ai-wrap {
    padding: 16px 0;
  }

  .lunvara-ai-bar {
    padding: 14px 16px;
  }

  .lunvara-ai-messages {
    padding: 16px;
    min-height: 220px;
  }

  .lunvara-ai-bubble {
    max-width: 90%;
  }
}