/* ============================================
   ESTILOS DEL WIDGET DE CHAT MAYA
   Archivo: maya-widget.css
   ============================================ */

/* Botón flotante para abrir el chat */
#chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FDB813 0%, #F59E0B 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(253, 184, 19, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0;
    overflow: hidden;
}

#chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(253, 184, 19, 0.6);
}

#chat-button img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

/* Ventana del chat */
#chat-widget {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
}

#chat-widget.active {
    display: flex;
}

/* Header del chat */
#chat-header {
    background: linear-gradient(135deg, #FDB813 0%, #F59E0B 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

#chat-header-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-header-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#chat-header-text h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 2px;
    font-family: 'Roboto', sans-serif;
}

#chat-header-text p {
    font-size: 13px;
    opacity: 0.9;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
}

#chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    font-weight: 300;
}

/* Área de mensajes */
#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #F9FAFB;
}

/* Mensaje individual */
.message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

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

/* Mensaje de Maya (bot) */
.message.bot {
    flex-direction: row;
}

.message.bot .message-content {
    background: white;
    color: #1F2937;
    border-radius: 12px 12px 12px 4px;
    font-family: 'Roboto', sans-serif;
}

/* Mensaje del usuario */
.message.user {
    flex-direction: row-reverse;
}

.message.user .message-content {
    background: #FDB813;
    color: white;
    border-radius: 12px 12px 4px 12px;
    font-family: 'Roboto', sans-serif;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.message.bot .message-avatar {
    background: #FEF3C7;
}

.message.bot .message-avatar img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.message.user .message-avatar {
    background: #F59E0B;
    font-size: 18px;
}

.message-content {
    padding: 12px 16px;
    max-width: 75%;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    line-height: 1.5;
}

/* Indicador de escritura */
.typing-indicator {
    display: none;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    width: fit-content;
    margin-left: 40px;
}

.typing-indicator.active {
    display: block;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background: #FDB813;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input de mensaje */
#chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    font-family: 'Roboto', sans-serif;
}

#chat-input:focus {
    border-color: #FDB813;
}

#chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FDB813;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s ease;
}

#chat-send:hover {
    background: #F59E0B;
}

#chat-send:disabled {
    background: #D1D5DB;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
    #chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    #chat-button {
        bottom: 15px;
        right: 15px;
    }
}

/* Scrollbar personalizado */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #F3F4F6;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}