/* SOTHURA Grow AI Chat-Bot Styles */

.chat-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--gold), #a89350);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(191, 179, 111, 0.4);
  transition: all 0.3s ease;
  z-index: 9998;
  color: var(--navy);
}

.chat-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(191, 179, 111, 0.6);
}

.chat-button svg {
  width: 28px;
  height: 28px;
  stroke: #0A1726;
  stroke-width: 2.5;
  fill: none;
}

/* Attention-grabbing animations */
@keyframes chatbotBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-8px) scale(1.05); }
  50% { transform: translateY(-4px) scale(1.02); }
  75% { transform: translateY(-6px) scale(1.04); }
}

@keyframes chatbotWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
  75% { transform: rotate(-5deg); }
}

@keyframes chatbotPulseGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(191, 179, 111, 0.4); }
  50% { box-shadow: 0 6px 40px rgba(191, 179, 111, 0.8), 0 0 20px rgba(191, 179, 111, 0.4); }
}

.chat-button.attention-bounce {
  animation: chatbotBounce 0.6s ease-in-out;
}

.chat-button.attention-wiggle {
  animation: chatbotWiggle 0.5s ease-in-out;
}

.chat-button.attention-glow {
  animation: chatbotPulseGlow 1s ease-in-out;
}

/* Sales tooltip popup */
.chat-tooltip {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: linear-gradient(135deg, #0f2135, #1a3a5c);
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  border: 2px solid var(--gold);
  opacity: 0;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9997;
}

.chat-tooltip::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 20px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--gold);
}

.chat-tooltip.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-tooltip .tooltip-close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}

.chat-tooltip .tooltip-close:hover {
  color: var(--gold);
}

.chat-tooltip .highlight {
  color: var(--gold);
}

.chat-button.hidden {
  opacity: 0;
  pointer-events: none;
}

.chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  height: 600px;
  background: #0f2135;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  transform: scale(0) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
  border: 2px solid var(--gold);
}

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

.chat-header {
  background: linear-gradient(135deg, var(--navy), #1a3a5c);
  padding: 1.25rem;
  border-radius: 14px 14px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--gold);
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 40px;
  height: 40px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  overflow: hidden;
}

.chat-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.chat-title {
  font-weight: 700;
  color: var(--gold);
  font-size: 1.1rem;
}

.chat-status {
  font-size: 0.8rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.chat-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #0a1420;
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 3px;
}

.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 75%;
  line-height: 1.5;
  font-size: 0.95rem;
  word-wrap: break-word;
}

.chat-message.bot .chat-bubble {
  background: linear-gradient(135deg, #1a3a5c, #2c5a8d);
  color: white;
  border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
  background: var(--gold);
  color: var(--navy);
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.typing-indicator .chat-bubble {
  padding: 16px 20px;
}

.typing-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }
  30% { transform: translateY(-10px); opacity: 1; }
}

.chat-input-container {
  padding: 1rem;
  background: #0f2135;
  border-top: 1px solid rgba(191, 179, 111, 0.2);
  display: flex;
  gap: 12px;
  align-items: center;
  border-radius: 0 0 14px 14px;
}

.chat-input {
  flex: 1;
  background: #1a2e45;
  border: 2px solid transparent;
  border-radius: 24px;
  padding: 12px 18px;
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.chat-input:focus {
  border-color: var(--gold);
  background: #0a1420;
}

.chat-input::placeholder {
  color: #6b7280;
}

.chat-send {
  width: 44px;
  height: 44px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-send:hover {
  background: #a89350;
  transform: scale(1.05);
}

.chat-send:active {
  transform: scale(0.95);
}

.chat-attach {
  width: 44px;
  height: 44px;
  background: rgba(191, 179, 111, 0.2);
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chat-attach:hover {
  background: rgba(191, 179, 111, 0.3);
  transform: scale(1.05);
}

.chat-attach:active {
  transform: scale(0.95);
}

.chat-file-list {
  padding: 0.5rem 1rem;
  background: #0a1420;
  border-top: 1px solid rgba(191, 179, 111, 0.2);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 100px;
  overflow-y: auto;
}

.chat-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(191, 179, 111, 0.1);
  border-radius: 8px;
  color: #aaa;
  font-size: 0.85rem;
  border: 1px solid rgba(191, 179, 111, 0.2);
}

.chat-file-item button {
  background: transparent;
  border: none;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px;
  transition: all 0.2s ease;
}

.chat-file-item button:hover {
  color: #e74c3c;
}

/* Document Download Button */
.chat-doc-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--gold), #a89350);
  border: none;
  border-radius: 8px;
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: center;
}

.chat-doc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(191, 179, 111, 0.4);
}

.chat-doc-btn:active {
  transform: translateY(0);
}

.chat-doc-btn svg {
  flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 100px);
    bottom: 16px;
    right: 16px;
  }
  
  .chat-button {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
}

@media (max-width: 600px) {
  .chat-button {
    bottom: 8px;
    right: 8px;
    width: 50px;
    height: 50px;
  }
  
  .chat-button svg {
    width: 24px;
    height: 24px;
  }
  
  .chat-badge {
    width: 20px;
    height: 20px;
    font-size: 10px;
    top: -3px;
    right: -3px;
  }
  
  .chat-tooltip {
    display: none !important;
  }
}
