
/* NexorMedia v3.14 unified UI overrides - non-destructive */
:root{
  --nexor-accent: #1f6feb; /* fallback accent (logo color preserved if image used) */
  --nexor-bg: #f7f8fb;
  --nexor-surface: #ffffff;
  --nexor-muted: #6b7280;
  --nexor-radius: 14px;
  --nexor-shadow: 0 6px 20px rgba(20,20,40,0.08);
  --nexor-gap: 16px;
  font-synthesis: none;
}

html,body{
  height:100%;
  margin:0;
  padding:0;
  background:var(--nexor-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color:#111827;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
  -webkit-text-size-adjust:100%;
}

/* container helpers */
.container {
  max-width:1200px;
  margin: 0 auto;
  padding: 24px;
  box-sizing: border-box;
}

/* unified chat window style - targets many common class names */
.chat-window,
.chatbox,
.bot-window,
#chatWindow,
.conversation,
.chat-panel,
.chat-area {
  background: var(--nexor-surface);
  border-radius: var(--nexor-radius);
  box-shadow: var(--nexor-shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  min-height: 420px;
  height: 60vh;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid rgba(15,23,42,0.04);
}

/* Ensure chat inner scroll area */
.chat-window .messages,
.chatbox .messages,
.bot-window .messages,
.conversation .messages,
.chat-panel .messages,
.chat-area .messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 6px;
}

/* Message bubbles (safe selectors) */
.message, .msg, .bubble, .chat-message {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  margin-bottom: 10px;
  line-height:1.35;
}

/* Sender/assistant */
.message.user, .msg.user, .bubble.user {
  background: rgba(31,111,235,0.1);
  color: #0b1220;
  align-self: flex-end;
  border-bottom-right-radius: 8px;
}
.message.bot, .msg.bot, .bubble.bot {
  background: rgba(243,244,246,1);
  color: #111827;
  align-self: flex-start;
  border-bottom-left-radius: 8px;
}

/* Input area */
.chat-window .input-area,
.chatbox .input-area,
.bot-window .input-area {
  display:flex;
  gap:8px;
  align-items:center;
  margin-top: 6px;
}
.chat-window input[type="text"],
.chatbox input[type="text"],
.bot-window input[type="text"],
.chat-window textarea,
.chatbox textarea,
.bot-window textarea {
  flex:1;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,0.06);
  background: #fff;
  outline:none;
}
.chat-window button.primary,
.chatbox button.primary,
.bot-window button.primary {
  border: none;
  padding: 10px 14px;
  border-radius:10px;
  background: var(--nexor-accent);
  color: white;
  cursor:pointer;
  box-shadow: 0 6px 18px rgba(31,111,235,0.16);
}

/* Typing indicator */
.nexor-typing {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-radius:12px;
  background: rgba(0,0,0,0.04);
}

/* Responsive layout for demo: side-by-side on desktop, stacked on mobile */
.demo-row {
  display:flex;
  gap:18px;
  align-items:flex-start;
  margin-top:12px;
  flex-wrap:wrap;
}
.demo-row > * {
  flex:1 1 420px;
}

/* Buttons, links */
.btn {
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:10px;
  border:1px solid rgba(15,23,42,0.06);
  background:#fff;
  cursor:pointer;
}
.btn.secondary { background:transparent; }

/* subtle animations */
button, .btn, .card {
  transition: transform .12s ease, box-shadow .12s ease;
}
button:hover, .btn:hover, .card:hover { transform: translateY(-3px); }

/* Utility: center content */
.center { display:flex; align-items:center; justify-content:center; }

/* Minor accessibility improvements */
:focus { outline: 3px solid rgba(31,111,235,0.14); outline-offset: 2px; }

/* Small devices */
@media (max-width: 720px) {
  .chat-window,
  .chatbox,
  .bot-window { height: 60vh; max-width: 100%; min-height: 340px; }
  .container { padding: 14px; }
  .demo-row { flex-direction: column; gap: 12px; }
}


/* === Unified Chat Window Styles === */
.chat-demo.unified-demo {
  width: 350px;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  background: #fff;
  font-family: 'Segoe UI', sans-serif;
}

.chat-demo .chat-header {
  background: linear-gradient(135deg, #4A90E2, #007AFF);
  color: #fff;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
}

.chat-demo .chat-body {
  flex: 1;
  padding: 12px;
  background: #f9f9fb;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.4;
}

.chat-demo .chat-message {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
}

.chat-demo .chat-message.bot {
  background: #e1ecf9;
  align-self: flex-start;
}

.chat-demo .chat-message.user {
  background: #007AFF;
  color: #fff;
  align-self: flex-end;
}

.chat-demo .chat-footer {
  display: flex;
  border-top: 1px solid #ddd;
  background: #fff;
  padding: 8px;
}

.chat-demo .chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.chat-demo .chat-send {
  margin-left: 8px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #007AFF;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

.chat-demo .chat-send:hover {
  background: #005FCC;
}



/* === Unified Chat: support JS message classes and responsiveness === */
.message-bot, .chat-demo .chat-message.bot {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  background: #e1ecf9;
  color: #042017;
  align-self: flex-start;
  word-wrap: break-word;
}

.message-user, .chat-demo .chat-message.user {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  background: #007AFF;
  color: #fff;
  align-self: flex-end;
  word-wrap: break-word;
}

.chat-demo .suggestions {
  margin-top: 8px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.chat-demo .suggestions button {
  border-radius:8px;
  padding:6px 10px;
  border:1px solid rgba(0,0,0,0.06);
  background:rgba(255,255,255,0.9);
  cursor:pointer;
}

/* responsive behaviour: full-width on small screens */
@media (max-width: 520px){
  .chat-demo.unified-demo {
    width: 100% !important;
    border-radius: 12px;
  }
  .chat-demo .chat-header { font-size:15px; padding:10px; }
  .chat-demo .chat-input { font-size:14px; padding:10px; }
  .chat-demo .chat-send { padding:10px 12px; font-size:14px; }
}
/* chat body scroll limit */
.chat-demo .chat-body {
  max-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 8px;
}
