/* support-widget.css — Giny d'atenció al client automatitzada per a URIstudio3D */

.uri-support-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.uri-support-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(2, 132, 199, 0.6);
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.uri-support-fab .pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: uriPulse 2s infinite;
}

@keyframes uriPulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Finestra de Xat */
.uri-chat-window {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--card, #131720);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  z-index: 9995;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
  transition: transform 0.25s ease, opacity 0.25s ease;
  backdrop-filter: blur(16px);
}

.uri-chat-window[hidden] {
  display: none !important;
}

.uri-chat-header {
  padding: 14px 18px;
  background: var(--primary-soft, rgba(2, 132, 199, 0.18));
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.uri-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.uri-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.uri-chat-title {
  display: flex;
  flex-direction: column;
}

.uri-chat-title b {
  font-size: 0.95rem;
  color: var(--foreground, #fff);
  font-weight: 700;
}

.uri-chat-title span {
  font-size: 0.76rem;
  color: var(--primary, #38bdf8);
  display: flex;
  align-items: center;
  gap: 5px;
}

.uri-chat-close {
  background: transparent;
  border: none;
  color: var(--muted-foreground, #94a3b8);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.uri-chat-close:hover {
  color: var(--foreground, #fff);
  background: var(--muted, rgba(255, 255, 255, 0.1));
}

/* Cos del xat i missatges */
.uri-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uri-msg {
  max-width: 84%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}

.uri-msg-ai {
  align-self: flex-start;
  background: var(--muted, rgba(255, 255, 255, 0.07));
  color: var(--foreground, #f1f5f9);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-bottom-left-radius: 4px;
}

.uri-msg-user {
  align-self: flex-end;
  background: #0284c7;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.uri-msg-typing {
  align-self: flex-start;
  font-style: italic;
  font-size: 0.8rem;
  color: var(--muted-foreground, #94a3b8);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Botons de suggeriments ràpids */
.uri-quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.uri-quick-btn {
  background: var(--card, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  color: var(--foreground, #e2e8f0);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.uri-quick-btn:hover {
  background: var(--primary-soft, rgba(2, 132, 199, 0.25));
  border-color: var(--primary, #38bdf8);
  color: var(--foreground, #fff);
}

.uri-wa-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #22c55e;
  color: #fff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: 6px;
  margin-top: 6px;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.uri-wa-link:hover {
  background: #16a34a;
}

/* Formulari inferior */
.uri-chat-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  background: var(--muted, rgba(0, 0, 0, 0.2));
  display: flex;
  gap: 8px;
}

.uri-chat-input {
  flex: 1;
  background: var(--background, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--input, rgba(255, 255, 255, 0.14));
  color: var(--foreground, #fff);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  outline: none;
}

.uri-chat-input:focus {
  border-color: var(--ring, #38bdf8);
  background: var(--background, rgba(255, 255, 255, 0.09));
}

.uri-chat-send {
  background: #0284c7;
  color: #fff;
  border: none;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.uri-chat-send:hover {
  background: #0ea5e9;
}

@media (max-width: 480px) {
  .uri-support-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  .uri-chat-window {
    bottom: 74px;
    right: 12px;
    width: calc(100vw - 24px);
    height: 480px;
  }
}

.uri-chat-input::placeholder { color: var(--muted-foreground, #94a3b8); opacity: 1; }
