/* FX Bot Widget Styles */
:root {
    --fx-red: #B2181E;        
    --fx-red-dark: #8A1217;   
    --fx-grey: #4A4D50;       
    --fx-grey-light: #DDDDDD;   
    --fx-dark: #121416;       
    --fx-light: #F4F6F8;   

}

#fx-bot {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  width: auto;
  max-width: 90vw;
}

/* Cuando el panel está abierto, el contenedor se expande a 380px */
#fx-bot:has(#fx-bot-panel.open) {
  width: 380px;
}

/* Bot Button - con imagen Q&F */
#fx-bot-button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fx-light) 0%, var(--fx-grey) 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  border: none;
  padding: 0;
  overflow: hidden; /* Asegura que la imagen no se salga del círculo */
}

/* Estilo para la imagen dentro del botón - se verá "ahogada" con padding */
#fx-bot-button img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* La imagen cubre todo el espacio pero mantiene proporción */
  padding: 5px; /* Padding interior para que la imagen no toque los bordes */
  box-sizing: border-box; /* El padding cuenta dentro del ancho/alto */
  background: inherit; /* Hereda el gradiente del botón */
  transition: all 0.3s ease;
}

/* Opcional: si quieres que la imagen tenga un efecto de escala al hacer hover */
#fx-bot-button:hover img {
  transform: scale(1.15);
}

#fx-bot-button:hover {
  transform: scale(1.1);
  box-shadow: 5px 6px 20px white;

}

#fx-bot-button:active {
  transform: scale(0.95);
}

#fx-bot-button:active img {
  transform: scale(0.98);
}

/* Bot Panel */
#fx-bot-panel {
  display: none;
  position: absolute;
  bottom: 80px;
  left: 0;
  width: 100%;
  height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

#fx-bot-panel.open {
  display: flex;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
#fx-bot-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* Messages Container */
#fx-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f9fa;
}

#fx-bot-messages::-webkit-scrollbar {
  width: 6px;
}

#fx-bot-messages::-webkit-scrollbar-track {
  background: transparent;
}

#fx-bot-messages::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

#fx-bot-messages::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Message Styles */
.fx-bot-msg {
  padding: 12px 14px;
  border-radius: 8px;
  max-width: 90%;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fx-bot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.fx-bot-msg.bot {
  align-self: flex-start;
  background: white;
  color: #333;
  border: 1px solid #e0e0e0;
  border-bottom-left-radius: 4px;
}

/* Input Container */
#fx-bot-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: white;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

#fx-bot-text {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

#fx-bot-text:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#fx-bot-text::placeholder {
  color: #999;
}

#fx-bot-send {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

#fx-bot-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#fx-bot-send:active {
  transform: translateY(0);
}

#fx-bot-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
  #fx-bot {
    width: calc(100vw - 20px);
    bottom: 10px;
    left: 10px;
  }

  #fx-bot-panel {
    height: 60vh;
    max-height: 600px;
  }

  #fx-bot-button {
    width: 50px;
    height: 50px;
  }
  
  #fx-bot-button img {
    padding: 8px; /* Padding reducido en móvil para que no se vea demasiado pequeño */
  }

  .fx-bot-msg {
    max-width: 85%;
  }
}