.chat-float-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #35a9aa;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 9999;
    transition: all 0.3s ease;
    font-size: 24px;
}

.chat-float-button:hover {
    transform: scale(1.1);
    background-color: #0249aa;
}

.chat-float-button.minimized {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(53, 169, 170, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(53, 169, 170, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(53, 169, 170, 0);
    }
}

.elektra-chat-interface {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transition: all 0.3s ease;
}

.chat-header {
    background: #35a9aa;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.elektra-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.ai-video-container {
    position: fixed;
    bottom: 90px;
    right: 380px; /* Posicionado a la izquierda del chat */
    width: 240px;
    height: 360px; /* Altura aumentada para mostrar el video completo */
    overflow: hidden; /* Evitar que el contenido se desborde */
    border-radius: 15px;
    z-index: 10000; /* Valor alto para asegurar que esté por encima de todo */
    background-color: transparent;
    display: none; /* Inicialmente oculto */
    pointer-events: none; /* Permitir hacer clic a través del contenedor */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 15px;
}

/* Estilo para los videos */
.ai-avatar-video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mostrar el video completo sin recortar */
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background-color: transparent;
    position: absolute;
    top: 0;
    left: 0;
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 0; /* Por defecto, todos los videos están ocultos */
    z-index: 1; /* Todos los videos tienen un z-index base */
}

/* El video activo se muestra */
.ai-avatar-video.active {
    opacity: 1;
    z-index: 2; /* El video activo tiene un z-index mayor */
}

.chat-header h3 {
    margin: 0;
    flex-grow: 1;
}

.close-chat, .minimize-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: 10px;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

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

.user-message {
    background-color: #0249aa;
    color: white;
    margin-left: auto;
    border-radius: 15px 15px 0 15px;
}

.ai-message {
    background-color: white;
    color: #333;
    margin-right: auto;
    border-radius: 15px 15px 15px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.chat-input-container {
    display: flex;
    padding: 10px;
    background-color: white;
    border-top: 1px solid #eee;
}

#user-input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    margin-right: 10px;
}

#send-message {
    background-color: #35a9aa;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#send-message:hover {
    background-color: #0249aa;
}

/* Responsive */
@media (max-width: 480px) {
    .elektra-chat-interface {
        width: 90%;
        height: 70vh;
        bottom: 80px;
        right: 5%;
        left: 5%;
    }

    .chat-float-button {
        bottom: 10px;
        right: 10px;
    }
}

.ai-message {
    background-color: #dbeafe; /* Azul claro */
    color: #1e3a8a;
}

.user-message {
    background-color: #f3f4f6; /* Gris claro */
    color: #111827;
}

.message {
    padding: 8px 12px;
    margin: 8px;
    border-radius: 8px;
    max-width: 80%;
    font-size: 16px;
    animation: fadeIn 0.3s ease-in-out;
}

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

.ai-loading-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e6f0f5;
    padding: 10px 14px;
    border-radius: 12px;
    animation: fadeIn 0.3s ease-in-out;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    color: #0d3b66;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ai-icon {
    font-size: 20px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 3px solid #3db2ff;
    border-top: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ai-text {
    font-weight: 500;
    color: #0d3b66;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.chat-input-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #999;
}

