/* ══════════════════════════════════════════════════
   SOLVE CORPORATE - AI ASSISTANT WIDGET STYLES
   100% Fully Responsive
══════════════════════════════════════════════════ */

/* Floating Launcher Button */
.solve-ai-launcher {
  position: fixed;
  bottom: clamp(16px, 3vw, 28px);
  right: clamp(16px, 3vw, 28px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 8px;
  background: #123a63;
  color: #ffffff;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(15, 59, 122, 0.35), 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Montserrat', sans-serif;
  user-select: none;
}

.solve-ai-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 38px rgba(15, 59, 122, 0.45), 0 4px 12px rgba(0,0,0,0.15);
}

.solve-ai-launcher:active {
  transform: translateY(0) scale(0.98);
}

.solve-ai-avatar-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.solve-ai-avatar-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.solve-ai-pulse-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0f3b7a;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: solveAiPulse 2s infinite;
}

@keyframes solveAiPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.solve-ai-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.solve-ai-launcher-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.solve-ai-launcher-sub {
  font-size: 11px;
  opacity: 0.85;
  font-weight: 500;
}

/* Chat Window */
.solve-ai-window {
  position: fixed;
  bottom: clamp(76px, 10vw, 92px);
  right: clamp(16px, 3vw, 28px);
  width: min(390px, calc(100vw - 32px));
  height: min(580px, calc(100dvh - 120px));
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(226, 218, 201, 0.9);
  box-shadow: 0 20px 60px rgba(15, 35, 70, 0.18), 0 4px 16px rgba(0,0,0,0.06);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s;
  font-family: 'Montserrat', sans-serif;
}

.solve-ai-window.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.solve-ai-header {
  padding: 14px 18px;
  background: #123a63;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.solve-ai-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.solve-ai-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.solve-ai-header-avatar img,
.solve-ai-header-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.solve-ai-header-info h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.solve-ai-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  opacity: 0.9;
  font-weight: 500;
}

.solve-ai-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.solve-ai-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.solve-ai-close-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.08);
}

/* Chat Messages Container */
.solve-ai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  background: #f8f6f0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
}

.solve-ai-body::-webkit-scrollbar {
  width: 5px;
}
.solve-ai-body::-webkit-scrollbar-thumb {
  background: #d4ccba;
  border-radius: 10px;
}

/* Messages */
.solve-msg {
  display: flex;
  gap: 10px;
  max-width: 90%;
  animation: solveFadeIn 0.25s ease-out;
  align-items: flex-end;
}

.solve-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ffffff;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(15, 59, 122, 0.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 2px;
}

.solve-msg-avatar svg {
  width: 100%;
  height: 100%;
}

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

.solve-msg-bot {
  align-self: flex-start;
}

.solve-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.solve-msg-bubble {
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.solve-msg-bot .solve-msg-bubble {
  background: #ffffff;
  color: #1a2332;
  border: 1px solid rgba(226, 218, 201, 0.85);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 35, 70, 0.04);
}

.solve-msg-user .solve-msg-bubble {
  background: #123a63;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 3px 12px rgba(15, 59, 122, 0.22);
}

/* Rich Message Extras */
.solve-ai-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.solve-ai-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: #eef4fc;
  border: 1px solid #c7dcfa;
  color: #0f3b7a;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.solve-ai-action-btn:hover {
  background: #0f3b7a;
  color: #ffffff;
  border-color: #0f3b7a;
  transform: translateY(-1px);
}

/* Suggested Chips */
.solve-ai-chips-wrap {
  padding: 10px 14px 4px;
  background: #f8f6f0;
  border-top: 1px solid rgba(226, 218, 201, 0.5);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.solve-ai-chips-wrap::-webkit-scrollbar {
  display: none;
}

.solve-chip {
  white-space: nowrap;
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid rgba(226, 218, 201, 0.95);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0f3b7a;
  cursor: pointer;
  transition: all 0.2s;
}

.solve-chip:hover {
  background: #0f3b7a;
  color: #ffffff;
  border-color: #0f3b7a;
  transform: translateY(-1px);
}

/* Typing Indicator */
.solve-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid rgba(226, 218, 201, 0.8);
  border-radius: 16px;
  width: fit-content;
}

.solve-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0f3b7a;
  opacity: 0.4;
  animation: solveTyping 1.3s infinite ease-in-out;
}

.solve-typing-dot:nth-child(1) { animation-delay: 0s; }
.solve-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.solve-typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Input Footer */
.solve-ai-footer {
  padding: 12px 14px;
  background: #ffffff;
  border-top: 1px solid rgba(226, 218, 201, 0.8);
  display: flex;
  align-items: center;
  gap: 8px;
}

.solve-ai-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1px solid rgba(226, 218, 201, 0.95);
  background: #fdfcf9;
  font-size: 14px;
  color: #1a2332;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.solve-ai-input:focus {
  border-color: #0f3b7a;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 59, 122, 0.1);
}

.solve-ai-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #123a63;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.solve-ai-send-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(15, 59, 122, 0.3);
}

.solve-ai-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .solve-ai-launcher {
    bottom: 16px;
    right: 16px;
    padding: 6px 12px 6px 6px;
  }
  .solve-ai-launcher-text {
    display: none;
  }
  .solve-ai-window {
    right: 12px;
    bottom: 76px;
    width: calc(100vw - 24px);
    height: calc(100dvh - 96px);
    border-radius: 16px;
  }
  .solve-ai-input {
    font-size: 16px; /* Prevents iOS Safari auto-zoom */
  }
}
