/* ==========================================================================
   CHATBOT.CSS - Rediseno Premium del Chatbot con IA
   Clave del Peluquero Exitoso
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CONTENEDOR PRINCIPAL - En la misma fila horizontal que WhatsApp
   -------------------------------------------------------------------------- */
.chatbot-container {
    position: fixed;
    bottom: 25px;
    right: 95px;
    z-index: 9998;
}

/* --------------------------------------------------------------------------
   2. BOTON FLOTANTE - Igual de pequeno y anclado que el de WhatsApp
   -------------------------------------------------------------------------- */
.chatbot-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: chatbotPulse 2.5s infinite;
}

.chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(212, 175, 55, 0.7);
    animation: none;
}

@keyframes chatbotPulse {
    0%   { box-shadow: 0 0 0 0 rgba(212,175,55,0.7); }
    70%  { box-shadow: 0 0 0 14px rgba(212,175,55,0); }
    100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); }
}

/* Ocultar imagen gigante si existe */
.chatbot-btn img,
.chatbot-btn .chatbot-assistant-img {
    display: none !important;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #A78BFA;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #0D0D0D;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-5px); }
}

/* --------------------------------------------------------------------------
   3. VENTANA DEL CHAT - Diseno premium oscuro
   -------------------------------------------------------------------------- */
.chatbot-window {
    width: 360px;
    height: 520px;
    background: #1a1a1a;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212,175,55,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 75px;
    right: 0;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
    font-family: 'Inter', 'Outfit', sans-serif;
}

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

/* --------------------------------------------------------------------------
   4. HEADER DEL CHAT
   -------------------------------------------------------------------------- */
.chatbot-header {
    background: linear-gradient(135deg, #D4AF37 0%, #8B6914 100%);
    color: white;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    letter-spacing: 0.3px;
}

.chatbot-header h3 small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 2px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px #4CAF50;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.chatbot-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.chatbot-close:hover {
    background: rgba(255,255,255,0.2);
}

/* --------------------------------------------------------------------------
   5. AREA DE MENSAJES
   -------------------------------------------------------------------------- */
.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #111;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 4px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
    background: #D4AF37;
    border-radius: 10px;
}
.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

/* --------------------------------------------------------------------------
   6. MENSAJES
   -------------------------------------------------------------------------- */
.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

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

.message-content {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-content p {
    margin: 0;
}

.message-content ul {
    margin-top: 6px;
    margin-bottom: 0;
    padding-left: 18px;
}

/* Mensajes de Usuario */
.user-message {
    align-self: flex-end;
}
.user-message .message-content {
    background: linear-gradient(135deg, #A78BFA, #7C3AED);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Mensajes del Bot */
.bot-message {
    align-self: flex-start;
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    display: flex;
}
.bot-message .message-content {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid rgba(212,175,55,0.2);
    border-bottom-left-radius: 4px;
}

.bot-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    color: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #2a2a2a;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(212,175,55,0.2);
    align-self: flex-start;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: #D4AF37;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40%           { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------------------------------
   7. INPUT DEL CHAT
   -------------------------------------------------------------------------- */
.chatbot-input {
    display: flex;
    padding: 10px 12px;
    background: #1a1a1a;
    border-top: 1px solid rgba(212,175,55,0.15);
    gap: 8px;
    align-items: center;
}

.chatbot-input input {
    flex: 1;
    padding: 9px 14px;
    background: #2a2a2a;
    border: 1px solid rgba(212,175,55,0.2);
    border-radius: 24px;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #e0e0e0;
    transition: border-color 0.2s ease;
}

.chatbot-input input::placeholder { color: #666; }

.chatbot-input input:focus {
    border-color: #D4AF37;
    background: #222;
}

.chatbot-input button#chatbotSend {
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    border: none;
    color: #111;
    font-size: 15px;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    font-weight: bold;
}

.chatbot-input button#chatbotSend:hover {
    transform: scale(1.1);
}

.voice-btn {
    background: transparent;
    border: 1px solid rgba(212,175,55,0.3);
    color: #D4AF37;
    font-size: 14px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.voice-btn:hover {
    background: rgba(212,175,55,0.15);
}

/* --------------------------------------------------------------------------
   8. RESPUESTAS RAPIDAS
   -------------------------------------------------------------------------- */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.quick-reply {
    background: transparent;
    border: 1px solid rgba(212,175,55,0.5);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    color: #D4AF37;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-reply:hover {
    background: rgba(212,175,55,0.15);
    border-color: #D4AF37;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-container {
        right: 85px;
        bottom: 20px;
    }
    .chatbot-btn {
        width: 52px;
        height: 52px;
        font-size: 22px;
    }
    .chatbot-window {
        width: calc(100vw - 30px);
        max-width: 360px;
        height: calc(100vh - 140px);
        bottom: 68px;
        right: -65px;
    }
}