/**
 * Sumnima Group — Premium AI Sales & Business Assistant Styles
 * Botanical Forest & Harvest Gold Aesthetic | Mobile-First & Accessible
 */

/* 1. Floating Launcher Button & Tooltip */
.sumnima-ai-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
  outline: none;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.sumnima-ai-launcher-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b4332 0%, #081c15 100%);
  border: 2px solid #52b788;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -4px rgba(8, 28, 21, 0.4), 0 0 0 1px rgba(82, 183, 136, 0.3);
  position: relative;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sumnima-ai-launcher:hover .sumnima-ai-launcher-btn {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 14px 30px -4px rgba(8, 28, 21, 0.5), 0 0 0 3px rgba(82, 183, 136, 0.4);
}

.sumnima-ai-launcher-icon {
  width: 28px;
  height: 28px;
  transition: transform 0.25s ease;
}

.sumnima-ai-launcher.is-open .sumnima-ai-launcher-icon {
  transform: rotate(90deg) scale(0.9);
}

.sumnima-ai-badge-pulse {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: sumnimaPulse 2s infinite;
}

@keyframes sumnimaPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.sumnima-ai-launcher-pill {
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  animation: sumnimaSlidePill 0.35s ease-out;
}

@keyframes sumnimaSlidePill {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.sumnima-ai-launcher-pill span.pill-sparkle {
  color: #fbbf24;
}

/* 2. Chatbot Container Window */
.sumnima-ai-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 60px -12px rgba(8, 28, 21, 0.35), 0 0 0 1px rgba(8, 28, 21, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99995;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.sumnima-ai-window.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 3. Header Bar */
.sumnima-ai-header {
  background: linear-gradient(135deg, #1b4332 0%, #0d281e 100%);
  color: #ffffff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.sumnima-ai-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sumnima-ai-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2d6a4f;
  border: 2px solid #52b788;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.sumnima-ai-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sumnima-ai-avatar-online {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.sumnima-ai-title-wrap {
  display: flex;
  flex-direction: column;
}

.sumnima-ai-name {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sumnima-ai-bot-tag {
  background: rgba(82, 183, 136, 0.25);
  color: #74c69d;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  border: 1px solid rgba(82, 183, 136, 0.4);
  text-transform: uppercase;
}

.sumnima-ai-subtitle {
  font-size: 0.74rem;
  color: #b7e4c7;
  font-weight: 500;
}

.sumnima-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sumnima-ai-btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.sumnima-ai-btn-icon:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}

/* 4. Messages Stream */
.sumnima-ai-messages {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fbfbf9;
  scroll-behavior: smooth;
}

.sumnima-ai-messages::-webkit-scrollbar {
  width: 5px;
}
.sumnima-ai-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Message Bubble */
.sumnima-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: sumnimaMsgIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.sumnima-msg.assistant {
  align-self: flex-start;
}

.sumnima-msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.91rem;
  line-height: 1.52;
  word-break: break-word;
}

.sumnima-msg.user .sumnima-msg-bubble {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.2);
}

.sumnima-msg.assistant .sumnima-msg-bubble {
  background: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sumnima-msg-bubble p {
  margin: 0 0 8px;
}
.sumnima-msg-bubble p:last-child {
  margin-bottom: 0;
}
.sumnima-msg-bubble strong {
  color: #0f172a;
  font-weight: 700;
}
.sumnima-msg.user .sumnima-msg-bubble strong {
  color: #ffffff;
}
.sumnima-msg-bubble ul, .sumnima-msg-bubble ol {
  margin: 6px 0;
  padding-left: 20px;
}
.sumnima-msg-bubble li {
  margin-bottom: 4px;
}

.sumnima-msg-time {
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 4px;
  padding: 0 4px;
}
.sumnima-msg.user .sumnima-msg-time {
  text-align: right;
}

/* 5. Action Cards & Quick Buttons inside Bot Replies */
.sumnima-ai-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.sumnima-btn-wa-action {
  background: #25d366;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: all 0.2s ease;
}
.sumnima-btn-wa-action:hover {
  background: #20ba59;
  transform: translateY(-1px);
  color: #ffffff;
}

.sumnima-btn-quote-trigger {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.sumnima-btn-quote-trigger:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* 6. In-Chat Lead Form */
.sumnima-inchat-form {
  background: #f8faf8;
  border: 1px solid rgba(46, 80, 50, 0.16);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sumnima-inchat-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1b4332;
  margin-bottom: 2px;
}
.sumnima-inchat-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.82rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
}
.sumnima-inchat-input:focus {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.15);
}
.sumnima-inchat-submit {
  background: #1b4332;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.sumnima-inchat-submit:hover {
  background: #2d6a4f;
}

/* 7. Typing Indicator */
.sumnima-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  width: fit-content;
  border-bottom-left-radius: 4px;
}
.sumnima-dot {
  width: 6px;
  height: 6px;
  background: #64748b;
  border-radius: 50%;
  animation: sumnimaBounce 1.4s infinite ease-in-out both;
}
.sumnima-dot:nth-child(1) { animation-delay: -0.32s; }
.sumnima-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes sumnimaBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* 8. Suggested Quick Question Chips */
.sumnima-ai-suggestions {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  background: #fbfbf9;
  border-top: 1px solid #f1f5f9;
}
.sumnima-ai-suggestions::-webkit-scrollbar {
  display: none;
}
.sumnima-chip {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.sumnima-chip:hover {
  background: #f1f5f9;
  border-color: #2d6a4f;
  color: #1b4332;
  transform: translateY(-1px);
}

/* 9. Bottom Input Bar */
.sumnima-ai-footer {
  padding: 12px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}
.sumnima-ai-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8faf8;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 4px 6px 4px 12px;
  transition: border-color 0.2s ease;
}
.sumnima-ai-input-form:focus-within {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
  background: #ffffff;
}
.sumnima-ai-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.88rem;
  color: #0f172a;
  resize: none;
  font-family: inherit;
  padding: 6px 0;
  max-height: 80px;
}
.sumnima-ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1b4332;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.sumnima-ai-send-btn:hover {
  background: #2d6a4f;
  transform: scale(1.05);
}
.sumnima-ai-send-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.sumnima-ai-disclaimer {
  font-size: 0.68rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 6px;
}

/* 10. Mobile Responsiveness */
@media (max-width: 640px) {
  .sumnima-ai-launcher {
    bottom: 16px;
    right: 16px;
  }
  .sumnima-ai-launcher-pill {
    display: none;
  }
  .sumnima-ai-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 88vh;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
  }
}
