/* Estilos para el Chatbot "Fan-to-Band" */

/* Globo de Bienvenida */
.chatbot-welcome-bubble {
    position: fixed;
    bottom: 40px;
    right: 100px;
    background-color: #ff4500;
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    font-family: 'Raleway', sans-serif;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease-in-out;
    transform-origin: right center;
    z-index: 998; /* Debajo del FAB */
}

.chatbot-welcome-bubble.visible {
    opacity: 1;
    transform: scale(1);
}


/* Botón Flotante */
.chatbot-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999;
    background-color: #ff4500; /* Naranja rockero */
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    overflow: hidden; /* Para asegurar que la imagen se recorte bien */
}

.chatbot-fab:hover {
    transform: scale(1.1);
}

#chatbot-fab-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease-in-out;
}

.chatbot-fab-close-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 32px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.chatbot-fab.is-open #chatbot-fab-avatar {
    opacity: 0.3; /* Oscurecer el avatar cuando está abierto */
}

.chatbot-fab.is-open .chatbot-fab-close-icon {
    opacity: 1;
}

/* Panel del Chat (Off-canvas) */
.chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: #1e1e1e;
    border: 2px solid #333;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;

    /* Animación de entrada/salida */
    transform: scale(0.5) translateY(100px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chatbot-panel.visible {
    transform: scale(1) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Cabecera del Chat */
.chatbot-header {
    background-color: #111;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    background-color: #333; /* Color de fondo mientras carga la imagen */
    border: 1px solid #555;
}

.chatbot-header .title {
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 1px;
}

.chatbot-header .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
}
.chatbot-header .close-btn:hover {
    color: #fff;
}

/* Área de Mensajes */
.chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #2b2b2b;
    color: #e0e0e0;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 20px;
    margin-bottom: 10px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-bubble.user {
    background-color: #ff4500;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.message-bubble.bot {
    background-color: #3a3a3a;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.message-bubble.bot .cta-button {
    display: block;
    background-color: #ff4500;
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
}
.message-bubble.bot .cta-button:hover {
    background-color: #e03e00;
}

/* Estilo para los enlaces dentro de las respuestas del bot */
.message-bubble.bot a {
    color: #ff9a78; /* Un naranja más claro para que sea legible sobre fondo oscuro */
    text-decoration: underline;
}

.message-bubble.bot a:hover {
    color: #ffb89e;
}


/* Chips de Acciones Rápidas */
.quick-actions {
    padding: 10px 15px;
    border-top: 1px solid #333;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-action-chip {
    background-color: #444;
    color: #ddd;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #555;
    transition: background-color 0.2s;
}

.quick-action-chip:hover {
    background-color: #555;
    color: #fff;
}

/* Input de Usuario */
.chatbot-input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #333;
    background-color: #111;
}

.chatbot-input-area input {
    flex-grow: 1;
    border: 1px solid #555;
    background-color: #333;
    color: #fff;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
}

.chatbot-input-area input::placeholder {
    color: #888;
}

.chatbot-input-area button {
    margin-left: 10px;
    background: #ff4500;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
}
.chatbot-input-area button:hover {
    background-color: #e03e00;
}

/* Scrollbar custom */
.chatbot-messages::-webkit-scrollbar {
  width: 8px;
}
.chatbot-messages::-webkit-scrollbar-track {
  background: #2b2b2b;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 10px;
  border: 2px solid #2b2b2b;
}
.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background-color: #777;
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-panel {
        width: 100%;
        max-width: 100%; /* Asegurar que ocupe todo el ancho */
        height: 100%;
        max-height: 100%;
        right: 0;
        bottom: 0;
        border-radius: 0;
        border: none;
    }

    .chatbot-input-area input {
        font-size: 16px; /* Prevenir zoom en iOS */
    }

    .chatbot-fab {
        bottom: 15px;
        right: 15px;
    }
}
