/*
 * Cosmic Souls of Sovereignty Inc. — Enterprise Arkitech Chatbot
 * Modern Luxury Obsidian & Gold Floating Conversational Interface
 */

:root {
  --chat-gold: #d4af37;
  --chat-gold-hover: #e5c158;
  --chat-gold-dim: #997b20;
  --chat-gold-glow: rgba(212, 175, 55, 0.35);
  --chat-bg: #0b1120;
  --chat-card: #0e172a;
  --chat-bubble-bot: #131d31;
  --chat-bubble-user: linear-gradient(135deg, #1e293b 0%, #25334d 100%);
  --chat-border: #24344d;
  --chat-text: #f8fafc;
  --chat-text-muted: #94a3b8;
  --chat-font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --chat-font-mono: 'JetBrains Mono', Consolas, monospace;
  --chat-font-serif: 'Cinzel', Georgia, serif;
}

/* Chatbot Floating Trigger Button */
.arkitech-chat-trigger {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, #131d31 0%, #0b1120 100%);
  border: 1.5px solid var(--chat-gold);
  border-radius: 9999px;
  padding: 0.65rem 1.25rem 0.65rem 0.75rem;
  color: var(--chat-text);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--chat-gold-glow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--chat-font-sans);
  outline: none;
}

.arkitech-chat-trigger:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.7), 0 0 30px rgba(212, 175, 55, 0.5);
  border-color: var(--chat-gold-hover);
}

.arkitech-trigger-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--chat-gold);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b1120;
  flex-shrink: 0;
}

.arkitech-trigger-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.arkitech-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10b981;
  border-radius: 50%;
  border: 2px solid #0b1120;
  box-shadow: 0 0 6px #10b981;
}

.arkitech-trigger-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.arkitech-trigger-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--chat-text);
  line-height: 1.2;
}

.arkitech-trigger-sub {
  font-family: var(--chat-font-mono);
  font-size: 0.65rem;
  color: var(--chat-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Chat Widget Window Container */
.arkitech-chat-window {
  position: fixed;
  bottom: 6rem;
  left: 2rem;
  width: 420px;
  max-width: calc(100vw - 3rem);
  height: 600px;
  max-height: calc(100vh - 8rem);
  background: var(--chat-card);
  border: 1px solid var(--chat-border);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(212, 175, 55, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: var(--chat-font-sans);
}

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

/* Header */
.arkitech-chat-header {
  background: linear-gradient(180deg, #131d31 0%, #0e172a 100%);
  border-bottom: 1px solid var(--chat-border);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.arkitech-header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.arkitech-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--chat-gold);
  object-fit: cover;
}

.arkitech-header-info h4 {
  font-family: var(--chat-font-serif);
  font-size: 1rem;
  color: var(--chat-text);
  line-height: 1.2;
}

.arkitech-header-status {
  font-family: var(--chat-font-mono);
  font-size: 0.68rem;
  color: #34d399;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.arkitech-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.arkitech-contact-human-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.08) 100%);
  border: 1px solid var(--chat-gold);
  color: var(--chat-gold) !important;
  font-family: var(--chat-font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.arkitech-contact-human-btn:hover {
  background: var(--chat-gold);
  color: #0b1120 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.arkitech-contact-human-btn:active {
  transform: translateY(0);
}

.arkitech-suggestion-chip.human-chip {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--chat-gold);
  color: var(--chat-gold);
  font-weight: 700;
}

.arkitech-icon-btn {
  background: transparent;
  border: 1px solid var(--chat-border);
  color: var(--chat-text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.arkitech-icon-btn:hover {
  border-color: var(--chat-gold);
  color: var(--chat-gold);
  background: rgba(212, 175, 55, 0.1);
}

/* Quick Question Suggestions */
.arkitech-suggestions-wrap {
  padding: 0.65rem 1rem;
  background: #0b1120;
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}

.arkitech-suggestion-chip {
  background: rgba(19, 29, 49, 0.8);
  border: 1px solid var(--chat-border);
  border-radius: 9999px;
  color: var(--chat-text-muted);
  font-size: 0.72rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.arkitech-suggestion-chip:hover {
  border-color: var(--chat-gold);
  color: var(--chat-gold);
  background: rgba(212, 175, 55, 0.1);
}

/* Messages Scroll Container */
.arkitech-chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: radial-gradient(circle at 50% 10%, rgba(212, 175, 55, 0.03) 0%, transparent 80%);
}

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

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

/* Message Bubble */
.arkitech-msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
  animation: arkitechFadeIn 0.25s ease forwards;
}

@keyframes arkitechFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.arkitech-msg.bot {
  align-self: flex-start;
}

.arkitech-msg.user {
  align-self: flex-end;
}

.arkitech-bubble {
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  position: relative;
}

.arkitech-msg.bot .arkitech-bubble {
  background: var(--chat-bubble-bot);
  border: 1px solid var(--chat-border);
  color: var(--chat-text);
  border-top-left-radius: 4px;
}

.arkitech-msg.user .arkitech-bubble {
  background: var(--chat-bubble-user);
  border: 1px solid #3b82f6;
  color: #eff6ff;
  border-top-right-radius: 4px;
}

.arkitech-msg-time {
  font-family: var(--chat-font-mono);
  font-size: 0.65rem;
  color: var(--chat-text-muted);
  margin-top: 0.3rem;
  padding: 0 0.3rem;
}

.arkitech-msg.user .arkitech-msg-time {
  text-align: right;
}

/* Rich Message Contents */
.arkitech-bubble strong {
  color: var(--chat-gold);
}

.arkitech-bubble a {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.arkitech-bubble a:hover {
  color: #7dd3fc;
}

.arkitech-badge {
  display: inline-block;
  font-family: var(--chat-font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--chat-gold);
  color: var(--chat-gold);
  margin-bottom: 0.4rem;
}

.arkitech-card-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.6rem;
}

.arkitech-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--chat-border);
  border-radius: 8px;
  color: var(--chat-text) !important;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.arkitech-link-btn:hover {
  border-color: var(--chat-gold);
  background: rgba(212, 175, 55, 0.15);
}

/* Typing Indicator Animation */
.arkitech-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.9rem;
  background: var(--chat-bubble-bot);
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  width: fit-content;
  align-self: flex-start;
}

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

.arkitech-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.arkitech-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes arkitechBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Input Area */
.arkitech-chat-footer {
  background: #0b1120;
  border-top: 1px solid var(--chat-border);
  padding: 0.85rem 1rem;
}

.arkitech-input-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.arkitech-input-field {
  flex: 1;
  background: var(--chat-card);
  border: 1px solid var(--chat-border);
  border-radius: 9999px;
  padding: 0.65rem 1.15rem;
  color: var(--chat-text);
  font-family: var(--chat-font-sans);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.arkitech-input-field:focus {
  border-color: var(--chat-gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.arkitech-input-field::placeholder {
  color: #64748b;
}

.arkitech-send-btn {
  background: linear-gradient(135deg, #d4af37 0%, #b89320 100%);
  color: #0b1120;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.arkitech-send-btn:hover {
  transform: scale(1.06);
  background: #e5c158;
}

.arkitech-footer-disclaimer {
  font-size: 0.68rem;
  color: #64748b;
  text-align: center;
  margin-top: 0.5rem;
  font-family: var(--chat-font-mono);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .arkitech-chat-window {
    left: 1rem;
    right: 1rem;
    bottom: 5.5rem;
    width: auto;
    height: calc(100vh - 7rem);
    max-height: none;
  }
  .arkitech-chat-trigger {
    left: 1rem;
    bottom: 1.25rem;
    padding: 0.55rem 1rem 0.55rem 0.6rem;
  }
}
