/* XAS Dark Neutral Chat (no blue, only black/gray/white + #84F9B8) */
#xasai-chat {
  max-width: 900px;
  margin: 0 auto;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #f5f5f5;
  overflow-x: hidden; /* spreči globalni horizontalni scroll */
}
#xasai-chat * {
  box-sizing: border-box;
}

/* Window */
#xasai-chat .xasai-window {
  display: flex;
  flex-direction: column;
  height: min(700px, 80vh); /* responsive visina na većim ekranima */
  background: #050505;
  border-radius: 16px;
  border: 1px solid #262626;
  overflow: hidden;
}

/* Messages area */
#xasai-chat .xasai-messages {
  flex: 1;
  overflow-y: auto;
  background: #050505;
  padding: 18px 0 110px;
  scroll-behavior: smooth;
}

/* Message bubbles */
#xasai-chat .msg {
  width: 100%;
  max-width: 780px;
  margin: 0 auto 16px;
  padding: 16px 18px;
  border-radius: 16px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 15px;
  border: 1px solid #262626;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
}

/* Bot bubble */
#xasai-chat .msg.bot {
  background: #111111;
  color: #f5f5f5;
}

/* User bubble */
#xasai-chat .msg.user {
  background: #181818;
  color: #ffffff;
  border-color: #333333;
}

/* Typing dots */
#xasai-chat .msg.bot.typing {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}
#xasai-chat .msg.bot.typing span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #9e9e9e;
  border-radius: 50%;
  animation: xas-blink 1.2s infinite;
}
#xasai-chat .msg.bot.typing span:nth-child(2) { animation-delay: .2s; }
#xasai-chat .msg.bot.typing span:nth-child(3) { animation-delay: .4s; }

@keyframes xas-blink {
  0% { opacity: .2; }
  20% { opacity: 1; }
  100% { opacity: .2; }
}

/* Input bar */
#xasai-chat .xasai-input {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  padding: 16px 16px 22px;
  background: #050505;
}
#xasai-chat .xasai-input input {
  width: 100%;
  max-width: 820px;
  padding: 14px 56px 14px 16px;
  background: #111111;
  border: 1px solid #262626;
  border-radius: 999px;
  outline: none;
  font-size: 14px;
  line-height: 1.4;
  color: #f5f5f5;
  box-shadow: 0 8px 24px rgba(0,0,0,.7);
}
#xasai-chat .xasai-input input::placeholder {
  color: #737373;
}
#xasai-chat .xasai-input input:focus {
  border-color: #84F9B8;
  box-shadow: 0 0 0 2px rgba(132,249,184,.25);
}

/* Send button */
#xasai-chat .xasai-input button.send {
  margin-left: -52px;
  width: 40px;
  height: 40px;
  align-self: center;
  border: 0;
  border-radius: 999px;
  background: #84F9B8;
  color: #020202;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.8);
  transition: transform .1s ease, box-shadow .1s ease, filter .1s ease;
  font-size: 0;
}
#xasai-chat .xasai-input button.send:hover {
  filter: brightness(1.03);
  transform: scale(1.05);
}
#xasai-chat .xasai-input button.send:active {
  transform: scale(0.95);
  box-shadow: 0 4px 14px rgba(0,0,0,.9);
}
#xasai-chat .xasai-input button.send:before {
  content: "➤";
  font-size: 14px;
  line-height: 1;
  color: #020202;
  transform: translateX(1px);
}

/* Tables in bot replies */
#xasai-chat .part.table {
  width: 100%;
  overflow-x: auto; /* ako je tabela šira, scroll unutar bala, ne beži layout */
}
#xasai-chat .part.table table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 14px;
  background: #111111;
  color: #f5f5f5;
  border: 1px solid #262626;
  border-radius: 10px;
  overflow: hidden;
}
#xasai-chat .part.table th,
#xasai-chat .part.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #262626;
}
#xasai-chat .part.table thead th {
  background: #151515;
  font-weight: 600;
}
#xasai-chat .part.table tbody tr:last-child td {
  border-bottom: 0;
}

/* Notes/cards */
#xasai-chat .part.notes .note {
  margin: 12px auto 0;
  max-width: 780px;
  padding: 12px 14px;
  background: #111111;
  border: 1px solid #262626;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.7);
}
#xasai-chat .part.notes .note-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: #ffffff;
}

/* BetUS link */
#xasai-chat a.xas-betus-link {
  color: #84F9B8;
  text-decoration: none;
  font-weight: 600;
}
#xasai-chat a.xas-betus-link:hover {
  text-decoration: underline;
}

/* Scrollbar */
#xasai-chat .xasai-messages::-webkit-scrollbar {
  width: 8px;
}
#xasai-chat .xasai-messages::-webkit-scrollbar-thumb {
  background: #3d3d3d;
  border-radius: 999px;
}

/* Muted small text */
#xasai-chat .msg small {
  color: #9e9e9e;
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

/* === CHART (NBA player dynamic last 15) === */
#xasai-chat .part.chart {
  margin: 12px auto 0;
  max-width: 780px;
  overflow-x: auto; /* dozvoli horizontalni scroll za chart ako treba */
}

#xasai-chat .xasai-chart-bar15 {
  position: relative;
  width: 100%;
  height: 120px;
  background: #11151f;
  border-radius: 8px;
  padding: 8px 6px 4px;
  overflow: hidden;
}

#xasai-chat .xasai-chart-bars {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 4px;
  bottom: 4px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

#xasai-chat .xasai-chart-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: visible; /* da label ne bude isečen */
}

/* Label u stepeniku (vrednost) */
#xasai-chat .xasai-chart-bar-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 3px;
  padding: 2px 5px;
  min-width: 16px;
  max-width: 26px;
  background: #050505;
  border-radius: 999px;
  color: #FACC15;
  font-size: 10px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 0 4px rgba(0,0,0,.8);
  pointer-events: none;
}

/* Horizontal line = main line value */
#xasai-chat .xasai-chart-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ffffff;
  opacity: 1;
  box-shadow: 0 0 4px rgba(0,0,0,.7);
}

/* Line label pill (koristi .left i .right klase) */
#xasai-chat .xasai-chart-line-label {
  position: absolute;
  transform: translateY(-50%);
  padding: 2px 7px;
  background: #050505;
  border-radius: 999px;
  font-size: 11px;
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 0 4px rgba(0,0,0,.8);
  pointer-events: none;
}

/* Desni label */
#xasai-chat .xasai-chart-line-label.right {
  right: 6px;
}

/* Levi label */
#xasai-chat .xasai-chart-line-label.left {
  left: 6px;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  #xasai-chat {
    max-width: 100%;
    padding: 0 8px;
  }

  #xasai-chat .xasai-window {
    height: calc(100vh - 24px); /* full-screen app look */
    border-radius: 12px;
  }

  #xasai-chat .msg {
    max-width: 100%;
    margin: 0 8px 12px;
    padding: 12px 14px;
    font-size: 14px;
  }

  #xasai-chat .xasai-input {
    padding: 10px 10px 16px;
  }

  /* Ako tabela ili chart budu širi od ekrana, scroll unutar njih, ne širi ceo layout */
  #xasai-chat .part.table table,
  #xasai-chat .xasai-chart-bar15 {
    min-width: 520px;
  }
}
