/* --- CONFIGURAZIONE E PRIMO PIANO ASSOLUTO --- */
.zoe-chat-widget-root {
  --zoe-accent: #1b3d5d; 
  --zoe-accent-dark: #142c44;
  --zoe-border: #d9e1e6;
  --zoe-text: #20313a;
  --zoe-muted: #6c7d87;
  --zoe-bg: #ffffff;
  --zoe-panel-width: 400px;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483647 !important; 
  font-family: "Segoe UI", Arial, sans-serif;
}

/* --- LAUNCHER STILE UNG --- */
.zoe-launcher {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
  outline: none !important;
}

.zoe-launcher-label { display: none !important; }

.zoe-launcher::before {
  content: 'Chiedi a ZoE';
  background: var(--zoe-accent) !important;
  color: #fff !important;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 25px 25px 5px 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  border: 1.5px solid transparent;
}

.zoe-launcher::after {
  content: '';
  display: block;
  width: 75px;
  height: 75px;
  background: #fff url('/sites/default/files/immagini_poliba/icone/zoe-avatar-256.webp') no-repeat center;
  background-size: cover;
  border-radius: 50%;
  border: 4px solid #fff !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.zoe-launcher:hover::after { transform: scale(1.08); }
.zoe-launcher:hover::before {
  background: #fff !important;
  color: #008195 !important;
  border-color: #008195 !important;
}

/* --- PANNELLO CHAT --- */
.zoe-panel {
  position: absolute;
  right: 0;
  bottom: 95px;
  width: var(--zoe-panel-width);
  height: 550px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 2147483647 !important;
  display: flex;
  flex-direction: column;
}

.zoe-panel-header {
  background: var(--zoe-accent);
  padding: 16px 20px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.zoe-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff !important;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- MESSAGGI E FIX LINK --- */
.zoe-messages {
  flex: 1;
  padding: 20px;
  background: #f4f7f9;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.zoe-message-panel {
  padding: 14px 18px;
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 88%;
  word-break: break-word;
}

.zoe-message-assistant .zoe-message-panel {
  background: #fff !important;
  color: var(--zoe-text) !important;
  align-self: flex-start;
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* FIX COLORE LINK NELLE RISPOSTE */
.zoe-message-assistant .zoe-message-text a {
  color: #004a99 !important; /* Blu scuro e leggibile */
  text-decoration: underline !important;
  font-weight: 600;
}

.zoe-message-user .zoe-message-panel {
  background: var(--zoe-accent) !important;
  color: #fff !important;
  align-self: flex-end;
  border-radius: 18px 18px 4px 18px;
}

/* --- RIPRISTINO ANIMAZIONE TYPING --- */
.zoe-typing {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoe-typing-label {
  color: var(--zoe-text) !important;
  font-size: 13.5px;
  font-weight: 500;
}

.zoe-typing-dots { display: flex; gap: 4px; }

.zoe-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--zoe-muted);
  display: inline-block;
  animation: zoeTypingPulse 1.4s infinite ease-in-out both;
}

.zoe-typing-dots i:nth-child(1) { animation-delay: -0.32s; }
.zoe-typing-dots i:nth-child(2) { animation-delay: -0.16s; }

@keyframes zoeTypingPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* --- AREA INPUT E TASTO SEND --- */
.zoe-composer {
  padding: 12px 15px;
  background: #fff;
  border-top: 1px solid var(--zoe-border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.zoe-input {
  flex: 1;
  background: #f8fafb;
  border: 1px solid #e1e8ed;
  border-radius: 12px;
  padding: 10px 15px;
  min-height: 42px;
  max-height: 120px;
  outline: none;
  font-size: 14px;
  color: var(--zoe-text);
  line-height: 1.4;
}

.zoe-send {
  background: var(--zoe-accent);
  color: #fff !important;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  /* ALTEZZA RIDOTTA PER ARMONIA */
  height: 42px; 
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- FEEDBACK ICONS --- */
.zoe-feedback-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  justify-content: flex-end;
}

.zoe-feedback {
  background: #fff !important;
  border: 1px solid var(--zoe-border) !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
}

.zoe-feedback span { display: none !important; }

.zoe-feedback::after {
  content: '';
  width: 16px;
  height: 16px;
  background-color: var(--zoe-muted);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
}

.zoe-feedback[data-feedback="like"]::after {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M14 10h4.708c.95 0 1.765.65 1.956 1.558l1.328 6.326c.21 1.002-.55 1.916-1.572 1.916H6.18c-1.125 0-2.091-.84-2.228-1.956l-.667-5.416C3.146 11.31 4.025 10.3 5.15 10.3H9.25V5.5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5V10z' /%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M14 10h4.708c.95 0 1.765.65 1.956 1.558l1.328 6.326c.21 1.002-.55 1.916-1.572 1.916H6.18c-1.125 0-2.091-.84-2.228-1.956l-.667-5.416C3.146 11.31 4.025 10.3 5.15 10.3H9.25V5.5c0-1.38 1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5V10z' /%3E%3C/svg%3E");
}

.zoe-feedback[data-feedback="dislike"]::after {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10 14H5.292c-.95 0-1.765-.65-1.956-1.558L2.008 6.116c-.21-1.002.55-1.916 1.572-1.916h14.24c1.125 0 2.091.84 2.228 1.956l.667 5.416c.139 1.134-.74 2.144-1.865 2.144h-4.1v4.8c0 1.38-1.12 2.5-2.5 2.5s-2.5-1.12-2.5-2.5V14z' /%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10 14H5.292c-.95 0-1.765-.65-1.956-1.558L2.008 6.116c-.21-1.002.55-1.916 1.572-1.916h14.24c1.125 0 2.091.84 2.228 1.956l.667 5.416c.139 1.134-.74 2.144-1.865 2.144h-4.1v4.8c0 1.38-1.12 2.5-2.5 2.5s-2.5-1.12-2.5-2.5V14z' /%3E%3C/svg%3E");
}