/* MCQRC AI pićni asistent */
.mcqrc-chat-fab {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: 1048;
  width: 3.35rem;
  height: 3.35rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mc-brand, #6366f1), var(--mc-brand-2, #8b5cf6));
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mcqrc-chat-fab:active {
  transform: scale(0.96);
}

.mcqrc-chat-fab.is-open {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.mcqrc-chat-fab-label {
  position: absolute;
  right: calc(100% + 0.5rem);
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(6px);
}

.mcqrc-chat-fab:not(.is-open) .mcqrc-chat-fab-label {
  animation: mcqrcChatPulse 4s ease-in-out infinite;
}

@keyframes mcqrcChatPulse {
  0%, 70%, 100% { opacity: 0; transform: translateX(6px); }
  75%, 95% { opacity: 1; transform: translateX(0); }
}

.mcqrc-chat-panel {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(110%);
  bottom: calc(5.25rem + env(safe-area-inset-bottom));
  z-index: 1049;
  width: min(100% - 1rem, 420px);
  max-height: min(78vh, 620px);
  background: #fff;
  border-radius: 18px 18px 14px 14px;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.mcqrc-chat-panel.is-open {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mcqrc-chat-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(14, 165, 233, 0.06));
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.mcqrc-chat-avatar {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mc-brand, #6366f1), var(--mc-brand-2, #8b5cf6));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.mcqrc-chat-head-text {
  flex: 1;
  min-width: 0;
}

.mcqrc-chat-head-text strong {
  display: block;
  font-size: 0.92rem;
  line-height: 1.2;
}

.mcqrc-chat-head-text small {
  display: block;
  font-size: 0.68rem;
  color: rgba(15, 23, 42, 0.55);
  margin-top: 0.1rem;
}

.mcqrc-chat-close {
  border: none;
  background: rgba(15, 23, 42, 0.06);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: rgba(15, 23, 42, 0.65);
  cursor: pointer;
}

/* —— Poruke (scroll zona) —— */
.mcqrc-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%);
}

.mcqrc-chat-turn {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 100%;
}

.mcqrc-chat-turn--user {
  align-items: flex-end;
}

.mcqrc-chat-turn--bot {
  align-items: flex-start;
}

.mcqrc-chat-meta {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(15, 23, 42, 0.45);
  padding: 0 0.25rem;
}

.mcqrc-chat-turn--user .mcqrc-chat-meta {
  color: rgba(15, 23, 42, 0.4);
}

.mcqrc-chat-msg {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: 16px;
  font-size: 0.86rem;
  line-height: 1.5;
  word-break: break-word;
}

.mcqrc-chat-msg p {
  margin: 0;
}

.mcqrc-chat-msg p + p {
  margin-top: 0.45rem;
}

.mcqrc-chat-msg--bot {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom-left-radius: 5px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  color: #0f172a;
}

.mcqrc-chat-msg--user {
  background: linear-gradient(135deg, var(--mc-brand, #6366f1), var(--mc-brand-2, #7c3aed));
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.mcqrc-chat-msg--typing {
  opacity: 0.75;
  font-style: italic;
}

/* Preporuke unutar bota */
.mcqrc-chat-picks {
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0.15rem;
}

.mcqrc-chat-picks-label {
  margin: 0.15rem 0 0.1rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(15, 23, 42, 0.45);
}

.mcqrc-chat-pick {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.mcqrc-chat-pick:active {
  background: rgba(99, 102, 241, 0.06);
  border-color: rgba(99, 102, 241, 0.25);
}

.mcqrc-chat-pick-rank {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--mc-brand, #6366f1);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mcqrc-chat-pick-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.mcqrc-chat-pick-body strong {
  font-size: 0.82rem;
  line-height: 1.2;
  color: #0f172a;
}

.mcqrc-chat-pick-body > span {
  font-size: 0.68rem;
  color: rgba(15, 23, 42, 0.5);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mcqrc-chat-pick-price {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--mc-brand, #4f46e5);
  line-height: 1.1;
  text-align: right;
}

.mcqrc-chat-pick-price small {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  opacity: 0.7;
}

/* Brza pitanja — iznad inputa */
.mcqrc-chat-quick {
  flex-shrink: 0;
  padding: 0.45rem 0.75rem 0.35rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

.mcqrc-chat-quick-label {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(15, 23, 42, 0.4);
  margin-bottom: 0.35rem;
}

.mcqrc-chat-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.1rem;
  scrollbar-width: none;
}

.mcqrc-chat-chips::-webkit-scrollbar {
  display: none;
}

.mcqrc-chat-chip {
  flex-shrink: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 0.38rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.mcqrc-chat-chip:active {
  background: var(--mc-brand, #6366f1);
  border-color: var(--mc-brand, #6366f1);
  color: #fff;
}

.mcqrc-chat-input-wrap {
  flex-shrink: 0;
  display: flex;
  gap: 0.45rem;
  padding: 0.55rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom));
  background: #fff;
}

.mcqrc-chat-input {
  flex: 1;
  min-height: 2.5rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  padding: 0 0.9rem;
  font-size: 16px;
  background: #f8fafc;
}

.mcqrc-chat-send {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: var(--mc-brand, #6366f1);
  color: #fff;
  cursor: pointer;
}

.mcqrc-chat-hidden {
  display: none !important;
}

@media (min-width: 480px) {
  .mcqrc-chat-fab {
    right: calc(50% - 220px + 12px);
  }
}
