/*
 * Copyright 2024 Akutangulo - navarr0
 * Proprietary software of Akutangulo.com
 * https://www.akutangulo.com
 *
 * Diseñado y creado con todo el amor del mundo por navarr0 de Akutangulo.com.
 */

/************************************************
 * Estilos generales del chatbot de ChatsBotsES *
 ************************************************/
@import url('https://fonts.googleapis.com/css2?family=Afacad+Flux:wght@100..1000&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --color-akutangulo: #9300D3; /* Color primario */
    --color-secundario: #0ff; /* Color secundario */

    --color-fondo-chatbot: #1A1A1A;
    --color-texto-chatbot: #E4E6EB;
    --color-texto-usuario: #E4E6EB;
    --color-mensaje-usuario: #2D3436;
    --color-mensaje-chatbot: #1A2942;


    /*--color-mensaje-usuario: #f6d5f9;
    --color-mensaje-chatbot: #fff9c4;*/
    
    --color-bordes-chatbot: #0ff ;
    --color-boton-chatbot: #0ff;
    --color-texto-boton-chatbot: #1A1A1A;

    --color-fondo-transparente: rgba(255, 255, 255, 0.8); /* Color de fondo semi-transparente */
}

/* Tema Claro */
.tema-claro-chatsbotses {
    --color-fondo-chatbot: #FAFAFA ; /* Gris claro */
    --color-texto-chatbot: #2D3748;
    --color-texto-usuario: #2D3748;
    --color-mensaje-usuario: #C3E6EF;
    --color-mensaje-chatbot: #C3E6C3;

    --color-bordes-chatbot: #9300D3 ;
    --color-boton-chatbot: #9300D3;
    --color-texto-boton-chatbot: #FAFAFA;
    
    --color-fondo-transparente: rgba(30, 30, 30, 0.8); /* Color de fondo semi-transparente */
    
    
}

/***********************
 * Estilos del ChatBot *
 ***********************/
 /* Animación pulse para la burbuja y botones */
 .pulse {
    box-shadow: 0 0 0 0 rgb(0, 255, 255);
    cursor: pointer;
    animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1);
    background-color: var(--color-secundario); /* Asegúrate de que el color de fondo esté presente */
}

.pulse:hover {
    animation: none;
    background-color: var(--color-akutangulo); /* Cambia el color al pasar el mouse */
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 255, 255); /* Cambia a un color RGB con opacidad */
    }
    100% {
        box-shadow: 0 0 0 10px rgba(232, 76, 61, 0); /* Mantener el efecto se desvaneciendo */
    }
}

 /* Animación de rebote de la burbuja */
 @keyframes rebote-bubble {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Estilo de la burbuja del chatbot */
.chatbot-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--color-secundario);
    border: none;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulse 1.25s infinite cubic-bezier(0.66,0,0,1), rebote-bubble 1s infinite ease-in-out; 
}

.chatbot-bubble:hover {
    background-color: var(--color-akutangulo);
    width: 80px;
    height: 80px;
    font-size: 1.3rem;
}

.fa-comments {
    -webkit-text-stroke: 1px black; /* Color y grosor del borde de la foorma del icono */
    font-size: 2em;
    color: white;
}


/* Overlay para el efecto modal */
.chatbot-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  z-index: 999; /* Asegúrate de que esté por encima de todo */
  display: none;
}

/* Estilos generales para la ventana del chatbot */
.chatbot-container {
  position: fixed;
  bottom: 3rem;
  right: 1rem;
  left: 1rem;
  top: 2rem;
  background-color: var(--color-fondo-chatbot);
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000; /* Asegúrate de que esté por encima del overlay */
  overflow-y: auto; /* Asegurar que el contenedor tenga su propio scroll */
}

@media (min-width: 769px) {
    .chatbot-container {
        width: 70%;
        height: 90%;
        top: 5%;
        left: 15%;
        right: 15%;
        bottom: 5%;
        z-index: 9999;
    }
}

.chatbot-content {
    overflow-y: auto;
    flex-grow: 1;
    font-size: 1.2rem;
    background-color: var(--color-fondo-chatbot);
    scrollbar-width: thin;
    scrollbar-color: var(--color-akutangulo);
    color: #191919;
}

.chatbot-content::-webkit-scrollbar {
    width: 8px;
}

.chatbot-content::-webkit-scrollbar-track {
    background: #f9f9f9;
}

.chatbot-content::-webkit-scrollbar-thumb {
    background-color: var(--color-akutangulo);
    border-radius: 10px;
    border: 3px solid #f9f9f9;
}

.chatbot-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--color-bordes-chatbot);
}

.chatbot-input-area textarea {
    width: calc(100% - 60px);
    padding: 12px;
    border: 1px solid var(--color-bordes-chatbot);
    border-radius: 4px;
    box-sizing: border-box;
    resize: none; /* Desactivar el redimensionamiento manual */
    font-size: 1.2rem;
    height: auto; /* Permitir que el script maneje la altura */
    overflow: hidden; /* Ocultar el desplazamiento */
    min-height: 50px; /* Altura mínima del textarea */
    color: var(--color-texto-chatbot);  
    background-color: var(--color-fondo-chatbot);
}
textarea::placeholder {
    opacity: 1; 
    font-family: "Afacad Flux", sans-serif;
  }
  

.chatbot-input-area textarea:focus {
    border: 2px solid var(--color-bordes-chatbot);
    outline: none; 
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5); 
}

.chatbot-input-area button {
    background-color: var(--color-boton-chatbot);
    color: var(--color-texto-boton-chatbot);
    border: none;
    padding: 0.5rem 1rem;
    margin-left: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

/* Estilos del Header del Chatbot donde esta la configuracion del usuario para las opciones del Chatbot */
.chatbot-header,
.text-container {
  width: 100%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: -1vh;
  padding: 10px;
  justify-content: space-between;
}

.chatbot-header {
  filter: url(#goo);
  z-index: 1;
}

.text-container {
  color: white;
  z-index: 2;
  font-size: clamp(14px, 2.5vw, 20px);
}

.chatbot-header .top-header {
  order: 1;
}

.chatbot-header .opciones-chatbot-header {
  order: 2;
}

.chatbot-header .inferior-header {
  order: 3;
}

.text-container .contenido-top-header {
  order: 1;
}

.text-container .contenido-opciones-chatbot-header {
  order: 2;
}

.text-container .contenido-inferior-header {
  order: 3;
}

.inferior-header,
.contenido-inferior-header {
  width: 100%;
  height: clamp(40px, 8dvh, 60px);
  position: relative;
  z-index: 1;
  animation: slide-reverse 2s ease-in-out 1; 
  display: flex;
  justify-content: center;
  align-items: center;
}

.inferior-header {
  background: #0ff;
  border-radius: clamp(5px, 1vw, 10px);
}



.top-header,
.contenido-top-header {
  width: 100%;
  height: clamp(10px, 10dvh, 120px);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.opciones-chatbot-header,
.contenido-opciones-chatbot-header {
  width: 100%;
  height: clamp(80px, 15dvh, 120px);
  position: relative;
  display: block; /* Mantenemos display block para opciones-chatbot-header y contenido-opciones-chatbot-header */
  animation: slide-in 1s ease; /* Animación por defecto al abrir: slide-in */
}

.opciones-chatbot-header {
  background: linear-gradient(180deg, #9300D3, #0ff); /* Degradado de arriba hacia abajo */
  border-radius: clamp(5px, 1vw, 10px);
}

.top-header {
  background: #9300D3;
  padding: 0;
}

.top-header,
.contenido-top-header {
  animation: slide-notification-reverse 2s ease-in-out 1;
  animation-fill-mode: forwards;
}

.contenido-top-header {
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
}

.iconos-derecha {
  display: flex;
  gap: 8px; /* Espacio entre rueda y X */
}

.contenido-top-header h3 {
  margin: 10px;
  padding-right: 10px;
  font-size: clamp(16px, 2.5vw, 24px);
  line-height: 1.2;
  flex-grow: 1;
  word-break: break-word;
}

.close-chat {
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1.5em;
  color: white;
  background-color: transparent;
  border: none;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  transition: transform 0.3s ease;
}

.close-chat:hover {
  transform: scale(1.2);
}

.fa-solid.fa-gear {
  flex-shrink: 0;
  cursor: pointer;
  font-size: 1.5em;
  color: white;
  transition: transform 0.5s ease;
  padding: 0 5px;
}

.fa-solid.fa-gear:hover {
  transform: rotate(180deg);
}

.opciones-chatbot-header.inactive,
.inferior-header.inactive,
.contenido-opciones-chatbot-header.inactive,
.contenido-inferior-header.inactive {
  animation: slide-reverse 2s ease-in-out reverse; /* Animación para ocultar: slide-reverse en reverse */
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.opciones-chatbot-header,
.inferior-header,
.contenido-opciones-chatbot-header,
.contenido-inferior-header {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), transform 1s cubic-bezier(0.4, 0, 0.2, 1); /* Transiciones para opacidad y transform */
}

.opciones-chatbot {
  display: flex;
  justify-content: space-between;
  margin: 1rem;
  flex-direction: column;
}

.storage-container {
  align-self: flex-start;
}

/* Ocultar el checkbox por defecto */
#storage-toggle {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid red;
  border-radius: 50%; /* Hace que el checkbox sea completamente redondo */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  color: rgb(189, 62, 62);
  cursor: pointer;
  position: relative;
}

/* Símbolo de la cruz (cuando no está seleccionado) */
#storage-toggle::before {
  content: "✖";
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cuando el checkbox está marcado */
#storage-toggle:checked {
  border-color: green;
  color: rgb(22, 218, 22);
  /*-webkit-text-stroke: 1px white;*/
}

/* Símbolo del check (cuando está seleccionado) con efecto de aumento centrado */
#storage-toggle:checked::before {
  content: "✔";
  font-size: 1.3rem; /* Aumentamos solo el símbolo */
  transform: scale(1.3); /* Un poco más grande para el efecto cómic */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0; /* Asegura que se centre verticalmente */
}

@keyframes slide-reverse {
  0% { transform: translateY(-200%); }
  45% { transform: translateY(10%); }
  50% { transform: translateY(10%); }
  75% { transform: translateY(-20%); }
  100% { transform: translateY(-20%); }
}

@keyframes slide-notification-reverse {
  0% {
    transform: translateY(-120%);
    width: 70%;
    height: clamp(40px, 8dvh, 60px);
  }
  50% {
    transform: translateY(0%);
    width: 100%;
    height: clamp(80px, 15dvh, 120px);
  }
  100% {
    transform: translateY(-10%);
    width: 100%;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos para las burbujas de mensajes */
.message {
    margin: 10px;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background-color: var(--color-mensaje-usuario);
    align-self: flex-end;
    margin-left: 20%;
    color: var(--color-texto-usuario);
}

.message.bot {
  background-color: var(--color-mensaje-chatbot);
    align-self: flex-start;
    margin-right: 20%;
    color: var(--color-texto-chatbot);
}

/*******************************************
 * Estilo para el preloader de ChatsBotsES *
 *******************************************/
/* Estilo para el spinner preloader */
.chatbot-pensando { 
  color: #9300D3; 
  margin: 5px 0; 
  text-transform: uppercase; 
  text-align: center; 
  font-family: 'Arial', sans-serif; 
  font-size: 10px; 
  letter-spacing: 2px; 
}

.chatbot-pensando .neurona { 
  width: 1px; 
  height: 12px; 
  background: #9300D3; 
  margin: 0 1px; 
  display: inline-block; 
  animation: opacity-2 1000ms infinite ease-in-out; 
}

.chatbot-pensando .neurona-1 { animation-delay: 800ms; }
.chatbot-pensando .neurona-2 { animation-delay: 600ms; }
.chatbot-pensando .neurona-3 { animation-delay: 400ms; }
.chatbot-pensando .neurona-4 { animation-delay: 200ms; }
.chatbot-pensando .neurona-5 { animation-delay: 0ms; }
.chatbot-pensando .neurona-6 { animation-delay: 300ms; }
.chatbot-pensando .neurona-7 { animation-delay: 500ms; }
.chatbot-pensando .neurona-8 { animation-delay: 700ms; }
.chatbot-pensando .neurona-9 { animation-delay: 900ms; }
.chatbot-pensando .neurona-10 { animation-delay: 800ms; }
    @keyframes opacity-2 { 
      0%, 100% { opacity: 1; height: 15px; }
      50% { opacity: 0; height: 12px; }
  }


/* Estilos del boton para cambiar el tema de claro a oscuro en la interfaz del chatbot */
.alternar-tema-chatbot {
    position: absolute;
    top: 10px; 
    right: 10px;
    cursor: pointer;
    font-size: 1rem;
    background-color: var(--color-fondo-transparente);
    color: var(--color-texto-usuario);
    padding: 0.3rem;
    border-radius: 50%;
    transition: background-color 1.3s, color 1.3s;
}

/**************************************************
* Estilos para el panel de control de ChatsBotsES *
***************************************************/
/* Estilos para mostrar el estado del servicio de la API de Open AI */

	/* Estilo para el indicador de estado */
  
  #circulo-info-estado-api {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
	  position: relative;
    margin-left: 4px;
}

/* Colores para los estados */
.verde { background-color: #4CAF50; }  /* Operativo */
.amarillo { background-color: #FFC107; } /* Rendimiento degradado */
.naranja { background-color: #FF9800; }  /* Interrupción parcial */
.rojo { background-color: #F44336; }      /* Interrupción mayor */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
