/* Floating chat bubble + widget styles for Datamex student portal */
/* Place this file at the web root or the same folder as the pages that include it */

.dcsa-chat-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg,#992600,#d31960);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  cursor: pointer;
  z-index: 2147483646;
  transition: transform .15s ease;
}
.dcsa-chat-bubble:hover { transform: translateY(-4px); }

/* Chat window */
.dcsa-chat-window {
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 360px;
  max-width: calc(100% - 48px);
  height: 520px;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 2147483647;
  font-family: Arial, Helvetica, sans-serif;
}

/* Header */
.dcsa-chat-header {
  background: linear-gradient(90deg,#992600,#d31960);
  color: white;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dcsa-chat-header .title { font-weight: 600; font-size: 14px; }
.dcsa-chat-header .sub { font-size: 11px; opacity: .9; }

/* Close button */
.dcsa-chat-close {
  margin-left: auto;
  background: transparent;
  color: white;
  border: 0;
  font-size: 18px;
  cursor: pointer;
}

/* Messages area */
.dcsa-chat-messages {
  padding: 12px;
  overflow-y: auto;
  flex: 1 1 auto;
  background: linear-gradient(#fafafa,#fff);
}

/* Message bubbles */
.dcsa-msg { margin-bottom: 12px; display: flex; gap: 8px; align-items: flex-end; }
.dcsa-msg .avatar { width: 34px; height: 34px; border-radius: 50%; background: #eee; display:flex;align-items:center;justify-content:center;font-weight:700;color:#992600; }
.dcsa-msg.user { justify-content: flex-end; }
.dcsa-msg.user .bubble { background: #007bff; color: #fff; border-radius: 14px 14px 6px 14px; padding: 10px 12px; max-width: 78%; word-wrap:break-word; }
.dcsa-msg.bot { justify-content: flex-start; }
.dcsa-msg.bot .bubble { background: #f1f1f1; color: #333; border-radius: 14px 14px 14px 6px; padding: 10px 12px; max-width: 78%; word-wrap:break-word; }

/* Source / link block */
.dcsa-source { font-size: 12px; color: #555; margin-top: 6px; }
.dcsa-source a { color: #0066cc; text-decoration: none; }
.dcsa-source a:hover { text-decoration: underline; }

/* Input area */
.dcsa-chat-input {
  border-top: 1px solid #eee;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.dcsa-chat-input input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 14px;
  outline: none;
}
.dcsa-chat-input button {
  padding: 10px 12px;
  background: #992600;
  color: white;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

/* Small helper, typing indicator */
.dcsa-typing { font-size: 13px; color: #666; opacity: .9; }

/* Responsive adjustments */
@media (max-width: 420px) {
  .dcsa-chat-window { right: 12px; left: 12px; width: auto; bottom: 84px; height: 68vh; }
  .dcsa-chat-bubble { right: 12px; bottom: 12px; }
}