:root {
  --agent9-bg: #1a1a1a;
  --agent9-header-bg: linear-gradient(90deg, #8b0000, #4a0e4e);
  --agent9-text: #ffffff;
  --agent9-user-msg-bg: #4a0e4e;
  --agent9-bot-msg-bg: #333333;
}

/* Chat Trigger Button */
.agent9-trigger {
  position: fixed;
  bottom: 100px; /* Above the player */
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--agent9-header-bg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.agent9-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(139, 0, 0, 0.6);
}

.agent9-icon {
  width: 32px;
  height: 32px;
  fill: white;
}

/* Chat Window */
.agent9-window {
  position: fixed;
  bottom: 170px;
  right: 20px;
  width: 350px;
  height: 500px;
  background-color: var(--agent9-bg);
  border: 1px solid #444;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
  font-family: "Rajdhani", sans-serif;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.agent9-window.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.agent9-window.minimized {
  height: 50px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.agent9-window.minimized .agent9-messages,
.agent9-window.minimized .agent9-input-area,
.agent9-window.minimized .agent9-privacy-notice {
  display: none;
}

/* Header */
.agent9-header {
  padding: 15px;
  background: var(--agent9-header-bg);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #444;
}

.agent9-title {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 1px;
}

.agent9-controls {
  display: flex;
  gap: 10px;
}

.agent9-close,
.agent9-minimize {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 5px;
  transition: color 0.2s;
}

.agent9-close:hover,
.agent9-minimize:hover {
  color: white;
}

.agent9-minimize {
  font-weight: bold;
}

/* Messages Area */
.agent9-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.agent9-msg.bot {
  align-self: flex-start;
  background-color: var(--agent9-bot-msg-bg);
  border-bottom-left-radius: 2px;
  color: #ddd;
}

.agent9-msg.user {
  align-self: flex-end;
  background-color: var(--agent9-user-msg-bg);
  border-bottom-right-radius: 2px;
  color: white;
}

/* Typing Indicator */
.agent9-typing {
  font-style: italic;
  font-size: 0.8rem;
  color: #888;
  margin-left: 5px;
  display: none;
}

.agent9-typing.active {
  display: block;
}

/* Input Area */
.agent9-privacy-notice {
  padding: 8px 15px 0;
  background-color: #1a1a1a;
  text-align: center;
  border-top: 1px solid #333;
}

.agent9-input-area {
  padding: 15px;
  background-color: #222;
  border-top: 1px solid #333;
  display: flex;
  gap: 10px;
}

.agent9-input {
  flex: 1;
  background-color: #111;
  border: 1px solid #444;
  color: white;
  padding: 10px;
  border-radius: 6px;
  font-family: "Rajdhani", sans-serif;
  font-size: 0.95rem;
  outline: none;
}

.agent9-input:focus {
  border-color: var(--accent-purple);
}

.agent9-send {
  background: var(--accent-purple);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0 15px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.agent9-send:hover {
  background: #6a1b6e;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
  .agent9-window {
    width: 90%;
    right: 5%;
    bottom: 100px;
    height: 60vh;
  }
}
