/* Kashmir Gold Harvest - Priya B2B Mandi Assistant Widget Styles */
.kgh-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  filter: drop-shadow(0 10px 25px rgba(159, 18, 57, 0.35));
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kgh-chat-launcher:hover {
  transform: translateY(-3px) scale(1.02);
}

.kgh-launcher-pill {
  background: #FFFFFF;
  border: 1.5px solid #FDE68A;
  border-radius: 30px;
  padding: 8px 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.kgh-launcher-pill-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #9F1239;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kgh-launcher-pill-sub {
  font-size: 0.7rem;
  color: #64748B;
  font-weight: 600;
}

.kgh-launcher-avatar-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2.5px solid #D4AF37;
  overflow: hidden;
  background: #9F1239;
}

.kgh-launcher-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.kgh-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #22C55E;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  animation: kgh-pulse 2s infinite;
}

@keyframes kgh-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Chat Window */
.kgh-chat-window {
  position: fixed;
  bottom: 95px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kgh-chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.kgh-chat-header {
  background: linear-gradient(135deg, #881337, #9F1239, #B45309);
  color: #FFFFFF;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #D4AF37;
}

.kgh-chat-header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kgh-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #FDE68A;
  object-fit: cover;
}

.kgh-header-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.kgh-header-status {
  font-size: 0.72rem;
  color: #FDE68A;
  display: flex;
  align-items: center;
  gap: 5px;
}

.kgh-header-status::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #4ADE80;
  border-radius: 50%;
}

.kgh-chat-header-tools {
  display: flex;
  gap: 8px;
}

.kgh-tool-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.kgh-tool-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Messages Body */
.kgh-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #FAF8F5;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kgh-msg-row {
  display: flex;
  gap: 8px;
  max-width: 86%;
}

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

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

.kgh-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}

.kgh-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
}

.kgh-msg-row.bot .kgh-msg-bubble {
  background: #FFFFFF;
  color: #1E293B;
  border-bottom-left-radius: 4px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.kgh-msg-row.user .kgh-msg-bubble {
  background: linear-gradient(135deg, #9F1239, #B45309);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(159, 18, 57, 0.25);
}

.kgh-msg-time {
  font-size: 0.65rem;
  color: #94A3B8;
  margin-top: 4px;
  text-align: right;
}

.kgh-msg-row.user .kgh-msg-time {
  color: rgba(255, 255, 255, 0.8);
}

/* Quick Chips */
.kgh-quick-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.kgh-chip-btn {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  padding: 5px 10px;
  border-radius: 16px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kgh-chip-btn:hover {
  background: #FDE68A;
  color: #78350F;
  transform: scale(1.02);
}

/* Action card in chat */
.kgh-card-quote {
  background: #FFF;
  border: 1.5px solid #D4AF37;
  border-radius: 8px;
  padding: 10px;
  margin-top: 8px;
  font-size: 0.8rem;
}

.kgh-card-quote-title {
  font-weight: 800;
  color: #9F1239;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.kgh-card-quote-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: #B45309;
}

.kgh-quote-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.kgh-btn-chat-wa {
  flex: 1;
  background: #25D366;
  color: #FFF;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
}

.kgh-btn-chat-rfq {
  flex: 1;
  background: #9F1239;
  color: #FFF;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Typing Indicator */
.kgh-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid #E2E8F0;
  width: fit-content;
}

.kgh-typing-dot {
  width: 6px;
  height: 6px;
  background: #94A3B8;
  border-radius: 50%;
  animation: kgh-bounce 1.2s infinite ease-in-out;
}

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

@keyframes kgh-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Footer / Input Area */
.kgh-chat-footer {
  padding: 10px 12px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
}

.kgh-chat-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 24px;
  padding: 4px 6px 4px 14px;
  transition: border-color 0.2s;
}

.kgh-chat-input-bar:focus-within {
  border-color: #9F1239;
  background: #FFFFFF;
}

.kgh-chat-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.85rem;
  color: #1E293B;
  font-family: inherit;
}

.kgh-btn-send {
  background: linear-gradient(135deg, #9F1239, #B45309);
  color: #FFFFFF;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s;
}

.kgh-btn-send:hover {
  transform: scale(1.05);
}

.kgh-chat-badge-footer {
  font-size: 0.68rem;
  color: #94A3B8;
  text-align: center;
  margin-top: 4px;
}
