/* ============ CHATBOT STYLES ============ */

/* Floating action button */
.chat-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1405;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 16px rgba(0,0,0,0.3),
    0 0 0 1px rgba(212,175,106,0.2),
    0 0 24px rgba(212,175,106,0.4);
  transition: all 0.3s var(--ease);
  z-index: 999;
}
.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 
    0 6px 24px rgba(0,0,0,0.4),
    0 0 0 1px rgba(212,175,106,0.3),
    0 0 32px rgba(212,175,106,0.6);
}
.chat-fab.open {
  background: var(--bg-2);
  color: var(--gold);
}
.chat-fab .victor-mark {
  color: #0a0a0a;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.chat-fab.open .victor-mark { display: none; }
.chat-fab svg {
  transition: transform 0.3s var(--ease);
}
.chat-fab:hover svg {
  transform: rotate(12deg);
}
.chat-fab.open svg {
  transform: rotate(0);
}

/* Chat window */
.chat-window {
  position: fixed;
  bottom: 110px;
  right: 32px;
  width: 400px;
  max-width: calc(100vw - 64px);
  height: 600px;
  max-height: calc(100vh - 180px);
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.6),
    0 0 0 1px rgba(244,241,236,0.08);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s var(--ease);
  z-index: 998;
  overflow: hidden;
}
.chat-window.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Header */
.chat-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
}
.chat-header-info {
  flex: 1;
}
.chat-title {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.chat-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.chat-close {
  background: transparent;
  border: none;
  color: var(--ink-3);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s var(--ease);
}
.chat-close:hover {
  color: var(--gold);
}

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
}
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* Individual message */
.chat-message {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: fadeInUp 0.3s var(--ease);
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.chat-message.user {
  flex-direction: row-reverse;
}
.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-avatar.victor {
  background: linear-gradient(135deg, var(--gold) 0%, #b8945a 100%);
  color: #0a0a0a;
  box-shadow: 0 0 0 1px rgba(212,175,106,0.35), 0 4px 12px rgba(0,0,0,0.3);
}
.chat-avatar.victor .victor-mark {
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.15));
}
.chat-avatar img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}
.chat-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 75%;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-message.assistant .chat-bubble {
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-top-left-radius: 4px;
}
.chat-message.user .chat-bubble {
  background: var(--gold);
  color: #1a1405;
  border-top-right-radius: 4px;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: typing 1.4s ease infinite;
}
.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Input area */
.chat-input-wrapper {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: var(--bg);
}
.chat-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px 16px;
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  transition: border-color 0.2s var(--ease);
}
.chat-input:focus {
  outline: none;
  border-color: var(--gold);
}
.chat-input::placeholder {
  color: var(--ink-3);
}
.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1405;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}
.chat-send:hover:not(:disabled) {
  background: var(--gold-2);
  transform: scale(1.05);
}
.chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Footer */
.chat-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-align: center;
  background: var(--bg-2);
}
.chat-footer a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.chat-footer a:hover {
  color: var(--gold-2);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .chat-fab {
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
  }
  .chat-window {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    bottom: auto;
    top: 0;
  }
  .chat-window.open {
    transform: none;
  }
  .chat-messages {
    padding: 16px;
  }
  .chat-bubble {
    max-width: 85%;
  }
}
