/* ==========================================================
   KASHMIRI VALLEY ASSISTANT (CHAT & VOICE)
   Brand: Kashmir Gold Harvest
   ========================================================== */

/* Floating Launcher Button */
.kgh-assistant-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 6px 18px 6px 6px;
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(22, 36, 77, 0.18), 0 0 0 1.5px rgba(109, 71, 216, 0.2);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
}

.kgh-assistant-launcher:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 45px rgba(109, 71, 216, 0.3), 0 0 0 2px rgba(109, 71, 216, 0.45);
}

.kgh-launcher-avatar-wrap {
  position: relative;
  width: 52px;
  height: 52px;
}

.kgh-launcher-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #6d47d8;
  display: block;
}

.kgh-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  background: #19a95b;
  border: 2.5px solid #ffffff;
  border-radius: 50%;
  animation: kghPulseGreen 2s infinite;
}

@keyframes kghPulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(25, 169, 91, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(25, 169, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 169, 91, 0); }
}

.kgh-launcher-info {
  display: flex;
  flex-direction: column;
}

.kgh-launcher-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #1a274d;
  display: flex;
  align-items: center;
  gap: 5px;
}

.kgh-launcher-tag {
  font-size: 11px;
  color: #6d47d8;
  font-weight: 700;
}

/* Chat Modal Window */
.kgh-assistant-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: min(390px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 120px));
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(18, 32, 64, 0.25), 0 0 0 1px rgba(109, 71, 216, 0.18);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

/* Header */
.kgh-assistant-header {
  background: linear-gradient(135deg, #12372a 0%, #1c523e 50%, #4b2c96 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
}

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

.kgh-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffd700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: all 0.3s ease;
}

.kgh-header-avatar.speaking {
  animation: kghAvatarPulse 1.2s infinite;
}

@keyframes kghAvatarPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
  50% { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.kgh-header-details h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.kgh-header-details p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #d1fae5;
  font-weight: 500;
}

.kgh-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kgh-btn-icon {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.kgh-btn-icon:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.06);
}

/* Chat Messages */
.kgh-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #faf8f5;
  scroll-behavior: smooth;
}

.kgh-msg {
  display: flex;
  gap: 8px;
  max-width: 90%;
  font-size: 13px;
  line-height: 1.5;
}

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

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

.kgh-msg-bubble {
  padding: 11px 15px;
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  position: relative;
  word-wrap: break-word;
}

.kgh-msg.assistant .kgh-msg-bubble {
  background: #ffffff;
  color: #16244d;
  border: 1px solid #ede8e3;
  border-top-left-radius: 4px;
}

.kgh-msg.user .kgh-msg-bubble {
  background: linear-gradient(135deg, #6d47d8, #4b2c96);
  color: #ffffff;
  border-top-right-radius: 4px;
}

/* High-Definition Media Card inside Chat */
.kgh-media-card {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2ded8;
  background: #fdfdfd;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.kgh-media-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.kgh-media-card-body {
  padding: 8px 10px;
  font-size: 11.5px;
  color: #2b395f;
  background: #fff;
}

.kgh-media-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  background: #effcf4;
  color: #14864a;
  border: 1px solid #ccefd8;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.kgh-msg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 8px;
  font-size: 10px;
}

.kgh-speak-btn {
  background: #f0ecfa;
  border: none;
  color: #6d47d8;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.kgh-speak-btn:hover {
  background: #6d47d8;
  color: #ffffff;
}

/* Question Chips */
.kgh-chips-bar {
  padding: 8px 14px 4px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: #ffffff;
  border-top: 1px solid #f0ebe5;
  white-space: nowrap;
}

.kgh-chips-bar::-webkit-scrollbar {
  display: none;
}

.kgh-chip {
  background: #f4f1fc;
  border: 1px solid #dfd8f5;
  color: #4b2c96;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.kgh-chip:hover {
  background: #6d47d8;
  color: #ffffff;
  border-color: #6d47d8;
}

/* Input Area */
.kgh-input-area {
  padding: 10px 14px 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kgh-mic-btn {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  color: #15803d;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.kgh-mic-btn.listening {
  background: #ef4444;
  color: #ffffff;
  border-color: #b91c1c;
  animation: kghPulseRed 1.2s infinite;
}

@keyframes kghPulseRed {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.kgh-input-wrapper {
  flex: 1;
  position: relative;
}

.kgh-chat-input {
  width: 100%;
  padding: 11px 40px 11px 14px;
  background: #f7f6fb;
  border: 1px solid #e2deed;
  border-radius: 12px;
  font-size: 13px;
  color: #1a274d;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.kgh-chat-input:focus {
  border-color: #6d47d8;
  background: #ffffff;
}

.kgh-send-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: #6d47d8;
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.kgh-send-btn:hover {
  background: #4b2c96;
}

/* Mobile Responsiveness */
@media (max-width: 500px) {
  .kgh-assistant-launcher {
    bottom: 16px;
    right: 16px;
    padding: 4px;
  }
  .kgh-launcher-info {
    display: none;
  }
  .kgh-assistant-window {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 82vh;
    border-radius: 22px 22px 0 0;
  }
}
