/* ══════════════════════════════════════════════════════
   GhosTech AI Assistant Stylesheet
   ══════════════════════════════════════════════════════ */

/* Floating chat button */
.ai-chat-bubble {
  position: fixed;
  bottom: 85px;
  right: 20px;
  height: 50px;
  border-radius: 25px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(124, 107, 255, 0.4);
  z-index: 99;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255,255,255,0.1);
}

.ai-chat-bubble:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 12px 30px rgba(124, 107, 255, 0.6);
  background: var(--accent2, #6456e0);
}

.ai-chat-bubble .ai-bubble-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 5px rgba(255,255,255,0.4));
}

.ai-chat-bubble .ai-bubble-text {
  font-family: inherit;
  white-space: nowrap;
}

.ai-chat-bubble .notification-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--green);
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Chat container */
.ai-chat-container {
  position: fixed;
  bottom: 155px;
  right: 20px;
  width: 380px;
  height: 500px;
  max-height: calc(100vh - 180px);
  background: rgba(22, 27, 40, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  transform: translateY(30px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-container.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

/* Header */
.ai-chat-header {
  padding: 16px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.ai-chat-header-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text1);
  margin-bottom: 2px;
}

.ai-chat-header-status {
  font-size: 0.72rem;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-chat-header-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.ai-chat-close {
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.ai-chat-close:hover {
  color: var(--text1);
}

/* Chat Feed */
.ai-chat-feed {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.ai-chat-msg.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-chat-msg.assistant {
  background: var(--bg3);
  color: var(--text1);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
}

/* Typing indicator */
.ai-chat-msg.typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

.ai-chat-dot {
  width: 6px;
  height: 6px;
  background: var(--text2);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.ai-chat-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Form Area */
.ai-chat-form {
  padding: 14px 16px;
  background: rgba(0,0,0,0.15);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}

.ai-chat-input {
  flex: 1;
  background: var(--bg0);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text1);
  outline: none;
  transition: border-color 0.2s;
}

.ai-chat-input:focus {
  border-color: var(--accent);
}

.ai-chat-send {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.ai-chat-send:hover {
  transform: scale(1.05);
  background: var(--accent2);
}

/* Dynamic chips inside chat */
.ai-chat-chip {
  display: inline-block;
  padding: 6px 12px;
  background: rgba(124, 107, 255, 0.1);
  border: 1px solid rgba(124, 107, 255, 0.25);
  color: var(--accent);
  border-radius: 12px;
  font-size: 0.8rem;
  margin-top: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chat-chip:hover {
  background: var(--accent);
  color: #fff;
}

/* Theme overrides */
.theme-light .ai-chat-container {
  background: rgba(248, 250, 252, 0.9);
  border-color: #cbd5e1;
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}
.theme-light .ai-chat-msg.assistant {
  background: #ffffff;
  border-color: #e2e8f0;
}
.theme-light .ai-chat-form {
  background: rgba(0,0,0,0.02);
}

.theme-black .ai-chat-container {
  background: rgba(10, 10, 10, 0.92);
  border-color: #262626;
  box-shadow: 0 15px 40px rgba(0,0,0,0.5);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .ai-chat-container {
    width: calc(100% - 32px);
    right: 16px;
    left: 16px;
    bottom: 80px;
    height: 420px;
  }
  .ai-chat-bubble {
    bottom: 16px;
    right: 16px;
    height: 44px;
    border-radius: 22px;
    padding: 0 14px;
    font-size: 13px;
  }
}

/* Contextual help prompt banner (Bottom Center) */
.ai-contextual-prompt {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(241, 245, 249, 0.98); /* Premium Light Gray */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 30px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 98;
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  max-width: 90vw;
  width: auto;
  pointer-events: none;
}

.ai-contextual-prompt.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ai-prompt-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ai-prompt-text {
  color: #1e293b; /* Dark charcoal text */
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-prompt-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-prompt-close:hover {
  color: var(--danger);
}

@media (max-width: 768px) {
  .ai-contextual-prompt {
    bottom: 80px;
  }
}

