/* rCohen Chatbot - Panel lateral basado en Dialogflow Messenger */

/* Botón flotante cerrado */
#rc-chatbot-toggle {
  z-index: 10000;
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--rc-chatbot-color, #31749B);
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.3s ease;
}

#rc-chatbot-toggle:hover {
  filter: brightness(0.85);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
}

#rc-chatbot-toggle:active {
  transform: scale(0.95);
}

/* Ocultar botón hasta que inicie sesión */
#rc-chatbot-toggle.rc-chatbot-hidden {
  display: none !important;
}

/* Panel lateral del bot */
df-messenger#rc-chatbot-bot {
  z-index: 9999;
  position: fixed;
  --df-messenger-font-color: #000;
  --df-messenger-font-family: "Google Sans", "Quicksand", sans-serif;
  --df-messenger-chat-background: #F3F6FC;
  --df-messenger-message-user-background: #D3E3FD;
  --df-messenger-message-bot-background: #fff;
  top: 0;
  bottom: 0;
  right: 0;
  width: 350px;
  display: none;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
}

/* Cuando el bot está abierto */
body.rc-chatbot-open df-messenger#rc-chatbot-bot {
  display: block;
  animation: rc-chatbot-slideInRight 0.3s ease;
}

body.rc-chatbot-open #rc-chatbot-toggle {
  display: none !important;
}

/* Animación de entrada */
@keyframes rc-chatbot-slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Botón cerrar */
#rc-chatbot-close {
  z-index: 10001;
  position: fixed;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #333333;
  font-size: 18px;
  line-height: 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: none;
  transition: all 0.2s ease;
}

body.rc-chatbot-open #rc-chatbot-close {
  display: block;
}

#rc-chatbot-close:hover {
  background: #eeeeee;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#rc-chatbot-close:active {
  transform: scale(0.9);
}

/* Clases AdminLTE: .content-wrapper/.right-side/.main-footer — no aplican en otros frameworks */
body.rc-chatbot-open .content-wrapper,
body.rc-chatbot-open .right-side,
body.rc-chatbot-open .main-footer {
  margin-right: 350px;
  transition: margin-right 0.3s ease;
}

/* Responsive para pantallas chicas */
@media (max-width: 768px) {
  df-messenger#rc-chatbot-bot {
    top: 0;
    width: 100%;
    left: 0;
    right: 0;
  }

  body.rc-chatbot-open .content-wrapper,
  body.rc-chatbot-open .right-side,
  body.rc-chatbot-open .main-footer {
    margin-right: 0;
  }

  #rc-chatbot-close {
    top: 8px;
    right: 8px;
  }

  #rc-chatbot-toggle {
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
}

/* Responsive para pantallas muy chicas */
@media (max-width: 480px) {
  #rc-chatbot-toggle {
    width: 45px;
    height: 45px;
    font-size: 18px;
    right: 12px;
    bottom: 12px;
  }

  #rc-chatbot-close {
    width: 28px;
    height: 28px;
    font-size: 16px;
    top: 8px;
    right: 8px;
  }
}
