/* Container */
#nexa-chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 360px;
  max-width: 95%;
  height: 540px;
  background: var(--chat-bg);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  font-family: 'Segoe UI', sans-serif;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  transition: all 0.3s ease;
}

.nexa-chat-open {
  display: flex !important;
}

/* Header */
.nexa-chat-header {
  background: var(--chat-header-bg);
  color: var(--chat-header-color);
  padding: 12px 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--chat-border);
}

.nexa-chat-close {
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

/* Message Area */
.nexa-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: var(--chat-msg-bg);
}

/* Messages */
.nexa-message {
  margin-bottom: 14px;
  display: flex;
  gap: 10px;
}

.nexa-message.user {
  justify-content: flex-end;
}

.nexa-message.user .nexa-text {
  background: var(--chat-user-bubble);
  color: #fff;
  border-radius: 16px 16px 0 16px;
  padding: 10px 14px;
  max-width: 75%;
}

.nexa-message.bot {
  justify-content: flex-start;
}

.nexa-message.bot .nexa-text {
  background: var(--chat-bot-bubble);
  color: var(--chat-bot-color);
  border-radius: 16px 16px 16px 0;
  padding: 10px 14px;
  max-width: 75%;
}

.nexa-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

/* Input Area */
.nexa-chat-input-area {
  display: flex;
  align-items: center;
  padding: 10px;
  gap: 8px;
  background: var(--chat-footer-bg);
  border-top: 1px solid var(--chat-border);
}

.nexa-chat-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--chat-border);
  font-size: 14px;
  background: var(--chat-input-bg);
  color: var(--chat-input-color);
}

.nexa-chat-send,
.nexa-upload-btn,
.nexa-voice-btn {
  background: var(--chat-button-bg);
  border: none;
  color: var(--chat-button-color);
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 16px;
}

.nexa-chat-send:hover,
.nexa-upload-btn:hover,
.nexa-voice-btn:hover {
  background: var(--chat-button-hover);
}

/* Toolbar */
.nexa-chat-toolbar {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  background: var(--chat-footer-bg);
  border-top: 1px solid var(--chat-border);
}

#nexa-clear-chat,
#nexa-dark-mode-toggle {
  font-size: 14px;
  padding: 6px 10px;
  background: var(--chat-button-bg);
  color: var(--chat-button-color);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

#nexa-clear-chat:hover,
#nexa-dark-mode-toggle:hover {
  background: var(--chat-button-hover);
}

/* File input hidden */
#nexa-file-upload {
  display: none;
}

/* Typing effect */
.nexa-message.typing .nexa-text::after {
  content: ' ▌';
  animation: blink 0.8s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Theme variables */
:root {
  --chat-bg: #fff;
  --chat-header-bg: #007bff;
  --chat-header-color: #fff;
  --chat-border: #ccc;
  --chat-msg-bg: #f9f9f9;
  --chat-footer-bg: #fff;
  --chat-input-bg: #fff;
  --chat-input-color: #333;
  --chat-user-bubble: #007bff;
  --chat-bot-bubble: #eaeaea;
  --chat-bot-color: #222;
  --chat-button-bg: #007bff;
  --chat-button-color: #fff;
  --chat-button-hover: #0056b3;
}

body.nexa-dark-mode {
  --chat-bg: #1e1e1e;
  --chat-header-bg: #111;
  --chat-header-color: #eee;
  --chat-border: #333;
  --chat-msg-bg: #1a1a1a;
  --chat-footer-bg: #1e1e1e;
  --chat-input-bg: #2a2a2a;
  --chat-input-color: #eee;
  --chat-user-bubble: #4c8bf5;
  --chat-bot-bubble: #333;
  --chat-bot-color: #eee;
  --chat-button-bg: #444;
  --chat-button-color: #eee;
  --chat-button-hover: #555;
}

.nexa-chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0073aa;
  color: white;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  text-align: center;
  line-height: 60px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 9999;
}
.nexa-chat-input-container {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #ddd;
}

.nexa-upload-btn,
.nexa-chat-send {
  background: #0073aa;
  border: none;
  color: white;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease;
}

.nexa-upload-btn:hover,
.nexa-chat-send:hover {
  background: #005f8d;
}

.nexa-chat-input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 20px;
}
