/* J(AI)SON Bespoke Conversational Sales Chat Widget */

/* Launcher Container */
#jaison-chat-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  outline: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#jaison-chat-launcher:hover {
  transform: translateY(-3px) scale(1.03);
}

/* Launcher Pill / Badge */
.jaison-launcher-badge {
  background: rgba(10, 15, 30, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 195, 215, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 15px rgba(0, 155, 172, 0.25);
  border-radius: 999px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.jaison-launcher-badge span {
  font-family: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

#jaison-chat-launcher:hover .jaison-launcher-badge {
  border-color: rgba(6, 182, 212, 0.7);
  box-shadow: 0 10px 35px rgba(0, 195, 215, 0.4);
}

/* Launcher Avatar Circle */
.jaison-launcher-avatar-wrap {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #009bac 0%, #001e4e 100%);
  box-shadow: 0 10px 30px rgba(0, 155, 172, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(6, 182, 212, 0.4);
}

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

/* Pulsing Status Dot */
.jaison-launcher-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #10B981;
  border: 2px solid #050814;
  border-radius: 50%;
  box-shadow: 0 0 10px #10B981;
}

.jaison-launcher-pulse {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 155, 172, 0.35);
  z-index: -1;
  animation: jaisonPulse 2.4s infinite;
}

@keyframes jaisonPulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* Chat Window Modal */
#jaison-chat-window {
  position: fixed;
  bottom: 105px;
  right: 28px;
  width: 395px;
  height: 580px;
  max-height: calc(100vh - 130px);
  max-width: calc(100vw - 36px);
  background: rgba(10, 15, 30, 0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.65), 0 0 25px rgba(0, 155, 172, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

#jaison-chat-window.active {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Chat Header */
.jaison-chat-header {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.jaison-header-profile {
  display: flex;
  align-items: center;
  gap: 11px;
}

.jaison-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.jaison-header-info h4 {
  margin: 0;
  color: #FFFFFF;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.jaison-header-info p {
  margin: 3px 0 0 0;
  color: #10B981;
  font-family: 'Inter', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.jaison-header-status-dot {
  width: 7px;
  height: 7px;
  background: #10B981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10B981;
}

.jaison-chat-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  padding: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, transform 0.2s;
}

.jaison-chat-close-btn:hover {
  color: #FFFFFF;
  transform: rotate(90deg);
}

/* Chat Messages */
.jaison-chat-messages {
  flex: 1;
  padding: 18px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.2);
  scroll-behavior: smooth;
}

.jaison-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.jaison-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
}

.jaison-message {
  padding: 12px 15px;
  border-radius: 16px;
  max-width: 86%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.88rem;
  line-height: 1.52;
  color: #F8FAFC;
  word-break: break-word;
}

.jaison-message a {
  color: #06B6D4;
  text-decoration: underline;
  font-weight: 600;
}

.jaison-bot {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.jaison-user {
  background: linear-gradient(135deg, #009bac 0%, #005f73 100%);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 155, 172, 0.25);
}

/* Quick Action Suggestion Chips */
.jaison-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.jaison-chat-chip {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 99px;
  color: #67E8F9;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.jaison-chat-chip:hover {
  background: rgba(6, 182, 212, 0.22);
  border-color: rgba(6, 182, 212, 0.5);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Typing Indicator */
.jaison-typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  height: 18px;
}

.jaison-typing-dots span {
  width: 6px;
  height: 6px;
  background: #94A3B8;
  border-radius: 50%;
  animation: jaisonTyping 1.4s infinite ease-in-out both;
}
.jaison-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.jaison-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes jaisonTyping {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}

/* Lead Handoff Bar */
.jaison-chat-lead-toggle-wrap {
  padding: 6px 14px;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: center;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.jaison-toggle-lead-btn {
  background: transparent;
  border: none;
  color: #06B6D4;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s, text-decoration 0.2s;
}
.jaison-toggle-lead-btn:hover {
  color: #38BDF8;
  text-decoration: underline;
}

.jaison-chat-lead-bar {
  padding: 10px 16px;
  background: rgba(6, 182, 212, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.jaison-lead-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.jaison-lead-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 7px 10px;
  color: #FFF;
  font-size: 0.78rem;
  outline: none;
}

.jaison-lead-input:focus {
  border-color: rgba(6, 182, 212, 0.5);
}

.jaison-lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #94A3B8;
  font-size: 0.68rem;
  line-height: 1.3;
}

.jaison-lead-consent a {
  color: #06B6D4;
}

/* Chat Input Area */
.jaison-chat-input-area {
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  gap: 8px;
  align-items: center;
}

.jaison-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 11px 14px;
  color: #FFF;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}

.jaison-chat-input:focus {
  border-color: rgba(6, 182, 212, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.jaison-chat-send-btn {
  background: #009bac;
  border: none;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  color: #FFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

.jaison-chat-send-btn:hover {
  background: #00b4c4;
}
.jaison-chat-send-btn:active {
  transform: scale(0.95);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
  #jaison-chat-launcher {
    right: 16px;
    bottom: 16px;
  }
  .jaison-launcher-badge span {
    font-size: 0.84rem;
  }
  .jaison-launcher-avatar-wrap {
    width: 52px;
    height: 52px;
  }
  #jaison-chat-window {
    width: 100%;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
    border: none;
  }
}
