
:root {
  --primary-color: #8b83f6;
  --secondary-color: #35259c;
  --hover-color: #9f3810;
  --background-color: #fff;
  --user-message-bg: #dcf8c6;
  --assistant-message-bg: #f1f0f0;
  --font-color: #000000;
  --link-color: #8a350d;
  --sidebar-bg: #f9f9f9;
  --button-border-radius: 48px;
  --button-shadow: 0 0px 0px rgba(0,0,0,0.0);
}

/* Overlay */
#afroditabot-chat-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 9990;
}

/* Widget principal */
#afroditabot-chat-widget {
  position: fixed;
  bottom: 15px;
  right: 20px;
  width: 350px;
  height: 520px;
  background-color: var(--background-color);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  z-index: 1000001;
  overflow: hidden;
  transition: width 0.3s, height 0.3s, top 0.3s, bottom 0.3s, left 0.3s, right 0.3s;
}
#afroditabot-chat-widget.fullscreen {
  top: 10%; left: 10%;
  bottom: auto; right: auto;
  width: 80vw; height: 80vh;
  border-radius: 8px;
}

/* Header */
#afroditabot-widget-header {
  background-color: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between; /* h2 a la izquierda, controles a la derecha */
  padding: 8px 12px;
}

#afroditabot-widget-header h2 {
  font-weight: bold;
  color: #fff;
  font-size: 1rem;
  margin: 0;
  padding: 0;
  line-height: 1;
}

#widget-controls {
  display: flex;
  gap: 8px;
}


/* Content y chat */
#afroditabot-widget-content {
  display: flex; flex-direction: column; flex: 1; height: 100%;
  overflow: hidden;
}
#afroditabot-chat-container {
  flex: 1; min-height: 0;
  overflow-y: auto; 
  padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  background-color: #fff;
}

/* Input */


#afroditabot-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px;
  background: #ececec;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}


#afroditabot-chat-user-input {
  flex: 1;
  padding: 0 8px;
  font-size: 1rem;
  height: 36px !important;
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  background-color: #ffff;
  color: #000;
  
}

#afroditabot-chat-user-input:hover {
  flex: 1;

  font-size: 1rem;
  height: 36px !important;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  background-color: #ffff;
  color: #000;
  

}

#afroditabot-send-btn {
  display: flex; /* importante para centrar el texto */
  align-items: center;
  justify-content: center;
  padding: 0 16px; /* más espacio horizontal */
  margin-left: 4px; /* separación con el input */
  font-size: 1rem;
  line-height: 1;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
  height: 36px;
  min-width: 64px; /* para evitar que sea muy pequeño */
}

#afroditabot-send-btn:hover {
  background: var(--secondary-color);
}


/* Loading */
#afroditabot-loading {
  position: absolute; inset: 0;
  background: linear-gradient(45deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
  display: none; justify-content: center; align-items: center;
  z-index: 9999; pointer-events: none;
}
.afroditabot-loading-container {
  display: flex; flex-direction: column; align-items: center;
}
.spinner {
  width: 40px; height: 40px;
  border: 8px solid rgba(255,255,255,0.3);
  border-top: 8px solid #fff;
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}
#afroditabot-loading-text {
  color: #fff; font-size: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
  opacity: 0; transition: opacity 0.4s;
}

/* Mensajes */

.message a[href] {
  color: var(--primary-color);
  text-decoration: underline;
}

.message {
  padding: 12px;
  border-radius: 12px;
  max-width: 80%;
  line-height: 1.4;
  font-size: 1.06rem;
  font-family: Arial, sans-serif;
  text-align: left;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #000;
}
.message.user {
  background-color: var(--user-message-bg);
  align-self: flex-end;
  border-bottom-right-radius: 0;
}
.message.assistant {
  background-color: var(--assistant-message-bg);
  align-self: flex-start;
  border-bottom-left-radius: 0;
}

/* Botón flotante */
#afroditabot-chat-button {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 1000000 !important;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 12px;
  background-color: var(--primary-color);
  color: #fff; font-size: 1rem;
  border-radius: var(--button-border-radius);
  cursor: pointer; box-shadow: var(--button-shadow);
  border: none; outline: none; font-weight: bold;
  animation: pulse 1.5s infinite;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
@keyframes pulse {
  0% { transform: scale(1);}
  50% { transform: scale(1.07);}
  100% { transform: scale(1);}
}
#afroditabot-chat-button:hover {
  background-color: var(--hover-color, var(--secondary-color));
  transform: scale(1.05);
}
#afroditabot-chat-button:disabled { opacity: 0.5; cursor: not-allowed; }
#afroditabot-chat-button .icon { margin-right: 8px; font-size: 1.2em; }

#afroditabot-chat-button.sm { font-size: 0.85rem; padding: 4px 18px; }
#afroditabot-chat-button.md { font-size: 1rem;  padding: 8px 28px; }
#afroditabot-chat-button.lg { font-size: 1.2rem; padding: 12px 28px; }

/* Variantes de botón */
#afroditabot-chat-button.solid { background-color: var(--primary-color); color: #fff; border: none; }
#afroditabot-chat-button.outline { background-color: #fff; color: var(--primary-color); border: 1px solid var(--primary-color);}
#afroditabot-chat-button.ghost { background-color: rgba(255,255,255,0.5); color: var(--primary-color); border: none; }
#afroditabot-chat-button.shadow { box-shadow: 0 2px 8px rgba(0,0,0,0.462);}
#afroditabot-chat-button.noshadow { box-shadow: none; }

/* Responsive */
@media (max-width: 600px) {
  #afroditabot-chat-widget {
    width: 90vw;
    height: 80vh;
    left: 5vw !important;
    right: auto;
    bottom: 10px !important;
  }
  #afroditabot-chat-button {
    bottom: 10px;
    right: 10px;
  }
}


.afroditabot-widget-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.4rem;
  padding: 2px 10px;
  border-radius: 5px;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  
}
.afroditabot-widget-btn:hover {
  background: rgba(0,0,0,0.16);
  color: #ffe4b3;
  background: transparent;

}
#afroditabot-close-btn {
  font-size: 1.1rem;
  color: #fff;
  background: transparent;
  height: 25px; 

}
#afroditabot-close-btn:hover {
  color: #ffb3b3;
  background: transparent;

}
#afroditabot-expand-btn {
  font-size: 1.35rem;
  color: #fff;
  background: transparent;
  height: 25px; 


}
#afroditabot-expand-btn:hover {
  color: #ffe49c;
  background: transparent;
}

  
  
  