/* Chat Bubbles */
.chat-bubble {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9999;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-bubble img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.whatsapp-bubble {
    background-color: #25D366;
    bottom: 30px;
    right: 30px;
}

.chatbot-bubble {
    background-color: #1D3E72;
    bottom: 100px;
    right: 30px;
}

/* Modal del Chatbot */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s ease-out;
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background-color: #1D3E72;
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.modal-icon {
    width: 40px;
    height: 40px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-modal:hover {
    transform: scale(1.2);
}

/* Chat Container */
#chat-container {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.bot-message {
    background-color: #e9e9eb;
    color: #333;
    align-self: flex-start;
    border-top-left-radius: 0;
}

.user-message {
    background-color: #1D3E72;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.message-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.option-btn {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: left;
}

.option-btn:hover {
    background-color: #e0e0e0;
}

.user-input-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

#user-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.form-buttons-container {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.form-btn {
    background-color: #1D3E72;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.form-btn:hover {
    background-color: #1a3363;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background-color: #e9e9eb;
    border-radius: 12px;
    padding: 10px 15px;
    width: 60px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #555;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.whatsapp-btn {
    background-color: #25D366;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    cursor: pointer;
    transition: background-color 0.3s;
}

.whatsapp-btn:hover {
    background-color: #128C7E;
}

.whatsapp-btn img {
    width: 20px;
    height: 20px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .chat-bubble {
        width: 50px;
        height: 50px;
    }

    .whatsapp-bubble {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-bubble {
        bottom: 80px;
        right: 20px;
    }

    .modal-content {
        width: 95%;
    }
}