/* =========================================================
   ✨ GYANOGRAM AI - FLOATING ASSISTANT STYLES
   ========================================================= */

/* Floating Launcher Button */
.gyanogram-ai-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #ffffff;
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.5), 0 8px 10px -6px rgba(124, 58, 237, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.gyanogram-ai-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 32px -6px rgba(37, 99, 235, 0.6), 0 12px 14px -6px rgba(124, 58, 237, 0.5);
}

.gyanogram-ai-launcher-icon {
  font-size: 1.25rem;
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255,255,255,0.6)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(255,255,255,0.9)); }
}

/* Chat Modal Window */
.gyanogram-ai-modal {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.gyanogram-ai-modal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Modal Header */
.ai-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #7c3aed 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.ai-header-title {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
}

.ai-header-status {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ai-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background 0.2s;
}

.ai-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Stream */
.ai-messages-container {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-message {
  display: flex;
  gap: 10px;
  max-width: 92%;
}

.ai-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-message.agent {
  align-self: flex-start;
}

.ai-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.ai-message.user .ai-avatar {
  background: #2563eb;
  color: white;
}

.ai-message.agent .ai-avatar {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: white;
}

.ai-bubble {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #0f172a;
}

.ai-message.user .ai-bubble {
  background: #2563eb;
  color: white;
  border-top-right-radius: 4px;
}

.ai-message.agent .ai-bubble {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  border-top-left-radius: 4px;
}

.ai-bubble p {
  margin: 0 0 8px 0;
}

.ai-bubble p:last-child {
  margin-bottom: 0;
}

.ai-bubble ul {
  margin: 4px 0 8px 0;
  padding-left: 18px;
}

.ai-bubble li {
  margin-bottom: 4px;
}

.ai-bubble code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: #1e40af;
  font-family: monospace;
}

.ai-message.user .ai-bubble code {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Quick Prompts Chips */
.ai-quick-prompts {
  padding: 10px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ai-quick-prompts::-webkit-scrollbar {
  display: none;
}

.ai-chip {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #334155;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.ai-chip:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Input Row */
.ai-input-wrapper {
  padding: 14px 16px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-input-field {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.ai-input-field:focus {
  border-color: #2563eb;
}

.ai-send-btn {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.ai-send-btn:hover {
  background: #1d4ed8;
}

.ai-send-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* Mobile Adjustment */
@media (max-width: 480px) {
  .gyanogram-ai-modal {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
}
