/* CONTAINER GENERAL FLOTANT */
.assistant-widget {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

/* BOTÓ DEL ROBOTET */
.assistant-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--purple-primary, #7c3aed);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.3);
  transition: transform 0.3s ease, background 0.3s ease;
}

.assistant-btn:hover {
  transform: scale(1.1);
  background: var(--purple-hover, #6d28d9);
}

/* CAIXA DEL XAT (OCULTA PER DEFECTE) */
.assistant-chat {
  position: fixed;
  bottom: 105px;
  right: 30px;
  width: 360px;
  height: 500px;
  background: rgba(15, 12, 25, 0.85); /* Fons fosc semitransparent */
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  
  /* Efecte per amagar-ho i animar-ho de forma suau */
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease, pointer-events 0s;
}

/* CLASSE QUE S'ACTIVA DES DEL TEU JS AL CLICAR EL BOTÓ */
.assistant-chat.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* CAPÇALERA DEL XAT */
.assistant-chat-header {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.assistant-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assistant-avatar {
  font-size: 24px;
}

.assistant-name {
  color: #fff;
  font-weight: 600;
  font-size: 15px;
}

.assistant-sub {
  color: #a7a2b6;
  font-size: 11px;
}

.assistant-close {
  background: none;
  border: none;
  color: #a7a2b6;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.2s;
}

.assistant-close:hover {
  color: #fff;
}

/* ÀREA DE MISSATGES */
.assistant-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ESTILS DELS MISSATGES INTERNS (Xat real) */
.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #fff;
  word-wrap: break-word;
}

.msg.bot {
  background: rgba(255, 255, 255, 0.06);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg.user {
  background: var(--purple-primary, #7c3aed);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* SUTGESTIONS / BOTONS RÀPIDS */
.assistant-actions {
  padding: 0 20px 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.assistant-action {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: #c0a5ff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.assistant-action:hover {
  background: var(--purple-primary, #7c3aed);
  color: #fff;
  border-color: transparent;
}

/* INPUT D'INFERIOR I ENVIAMENT */
.assistant-input-area {
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 10px;
}

.assistant-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.assistant-input:focus {
  border-color: var(--purple-primary, #7c3aed);
}

.assistant-send {
  background: var(--purple-primary, #7c3aed);
  border: none;
  color: #fff;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.assistant-send:hover {
  background: var(--purple-hover, #6d28d9);
}
