.chat-container {
    border: 1px solid #ccc;
    border-radius: 8px;
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
}

.chat-header {
    background: #222;
    color: #fff;
    padding: 10px;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    text-align: center;
}

.chat-messages {
    padding: 10px;
    height: 300px;
    overflow-y: auto;
    background: #f9f9f9;
    flex: 1 1 auto;
}

.user-message {
    background: #e0f7fa;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: right;
}

.bot-message {
    background: #f1f8e9;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: left;
}

.chat-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

#user-message {
    flex: 1 1 auto;
    resize: none;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-right: 8px;
    font-size: 1em;
}

#send-message {
    background: #1976d2;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1em;
}

#send-message:hover {
    background: #1565c0;
}

.typing-dots span {
    animation: blink 1s infinite;
    opacity: 0.5;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
/* Parpadeo del botón */
#gpt-chatbot-mejorado-boton.parpadeo {
    animation: parpadeo 1s infinite;
}
@keyframes parpadeo {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Efecto de cortina (slide-down) para mensajes del bot */
.bot-message.typewrite-effect {
    overflow: hidden;
    max-height: 0;
    animation: slideDown 3.5s ease-out forwards;
    margin-bottom: 10px;
}
@keyframes slideDown {
    to { max-height: 300px; }
}

/* Efecto fade-in con desplazamiento suave (opcional, elige uno) */
/*
.bot-message.typewrite-effect {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.5s ease-out forwards;
    margin-bottom: 10px;
}
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
*/

/* Ajustes para móvil */
@media (max-width: 600px) {
    #gpt-chatbot-mejorado.fullscreen-mobile {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        z-index: 2147483647 !important;
        background: #fff !important;
        border-radius: 0 !important;
        box-shadow: 0 4px 32px rgba(0,0,0,0.29) !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
    }
    .chat-input {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        width: 100% !important;
        padding: 10px !important;
        background: #fafafa !important;
    }
    .chat-input textarea,
    #user-message {
        width: 100% !important;
        min-height: 50px !important;
        margin-bottom: 0 !important;
        resize: vertical !important;
        font-size: 1em !important;
    }
   .chat-buttons-row {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 8px !important; /* Espacio entre botones */
    }
    #send-message {
        flex: 2 1 0 !important;      /* Enviar ocupa el doble de espacio */
        min-width: 140px !important;
        padding: 13px 0 !important;
        font-size: 1.15em !important;
    }
    #close-chat, .chatbot-close-btn {
        flex: 1 1 0 !important;      /* Cerrar chat ocupa menos */
        min-width: 80px !important;
        padding: 13px 0 !important;
        font-size: 1.05em !important;
    }
}


.gpt-chatbot-embed {
    max-width: 600px;
    margin: 40px auto 40px auto;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    border-radius: 14px;
    background: #fff;
    border: 1px solid #eee;
    font-family: Arial, Helvetica, sans-serif;
}

.gpt-chatbot-embed .chat-header {
    padding: 16px 18px;
    background: #4e8cff; /* puedes poner el color con PHP inline para que sea dinámico */
    color: #fff;
    border-radius: 14px 14px 0 0;
    font-weight: bold;
    font-size: 1.2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gpt-chatbot-embed .chat-messages {
    padding: 18px;
    height: 340px;
    overflow-y: auto;
    background: #FFF;
    border-bottom: 1px solid #eee;
    font-size: 1em;
}

.gpt-chatbot-embed .user-message {
    background: #e0f7fa;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: right;
}
.gpt-chatbot-embed .bot-message {
    background: #f1f8e9;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 8px;
    text-align: left;
}

.gpt-chatbot-embed .chat-input {
    padding: 14px;
    background: #fafafa;
    border-radius: 0 0 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gpt-chatbot-embed #user-message {
    width: 100%;
    padding: 9px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-size: 1em;
    margin-bottom: 6px;
}

.gpt-chatbot-embed #send-message {
    background: #4e8cff;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 16px;
    cursor: pointer;
}

.gpt-chatbot-embed #send-message:hover {
    background: #1976d2;
}

@media (max-width: 800px) {
    .gpt-chatbot-embed {
        max-width: 98vw;
        margin: 25px auto;
    }
    .gpt-chatbot-embed .chat-messages {
        height: 220px;
        padding: 8px;
    }
}
.gpt-chatbot-embed #close-chat,
.gpt-chatbot-embed .chatbot-close-btn {
    background: #f4f4f4;
    color: #333;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    padding: 10px 22px;
    font-size: 16px;
    font-weight: 500;
    box-shadow: none;
    transition: background 0.2s, color 0.2s;
}

.gpt-chatbot-embed #close-chat:hover,
.gpt-chatbot-embed .chatbot-close-btn:hover {
    background: #e0e0e0;
    color: #222;
    border-color: #b0b6be;
}

.chatbot-avatar {
    width: 75px;
    height: 75px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}
#gpt-chatbot-mejorado,
#gpt-chatbot-mejorado-chat,
.gpt-chatbot-expandible,
.gpt-chatbot-widget,
.gpt-chatbot-floating {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 2147483647 !important;
}
#gpt-chatbot-mejorado-chat {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 2147483647 !important;
  width: 380px !important;
  max-width: 90vw !important;
  background: #fff !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25) !important;
}
.gpt-chatbot-floating-btn {
  position: fixed !important;
  right: 30px !important;
  bottom: 30px !important;
  z-index: 2147483647 !important;
}

.gpt-chatbot-popup {
  position: fixed !important;
  right: 30px !important;
  bottom: 80px !important; /* Ajusta según la altura del botón flotante */
  z-index: 2147483647 !important;
  max-height: 80vh !important;
  width: 360px !important;
}

/* También repasa estos, por si usas otro contenedor: */
#gpt-chatbot-mejorado,
#gpt-chatbot-mejorado-chat,
.gpt-chatbot-expandible,
.gpt-chatbot-widget,
.gpt-chatbot-floating {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 2147483647 !important;
}
