/* AI Assistant Chat Widget Styles */
:root {
    --chat-primary: #2563eb;
    --chat-bg: #ffffff;
    --chat-text: #1e293b;
    --chat-bubble-user: #eff6ff;
    --chat-bubble-ia: #f8fafc;
    --chat-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.dark-mode {
    --chat-bg: #0f172a;
    --chat-text: #f1f5f9;
    --chat-bubble-user: #1e293b;
    --chat-bubble-ia: #334155;
}

#ai-chat-widget {
    position: fixed;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 10005 !important;
    font-family: 'Outfit', 'Inter', sans-serif;
}

/* Voice Assistant Button (Common with Chat) */
.floating-assistant-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: fixed;
    z-index: 10004;
}

.floating-assistant-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
}

#btn-nav-mic-fixed {
    bottom: 95px;
    /* Above the chat button */
    right: 20px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

#ai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chat-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ai-chat-button:hover {
    transform: scale(1.1) rotate(-5deg);
}

#ai-chat-window {
    width: 350px;
    height: 500px;
    background: var(--chat-bg);
    border-radius: 16px;
    box-shadow: var(--chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#ai-chat-window.active {
    display: flex;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: var(--chat-primary);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.message-user {
    align-self: flex-end;
    background: var(--chat-bubble-user);
    color: var(--chat-text);
    border-bottom-right-radius: 2px;
}

.message-ia {
    align-self: flex-start;
    background: var(--chat-bubble-ia);
    color: var(--chat-text);
    border-bottom-left-radius: 2px;
}

.chat-footer {
    padding: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 8px;
}

.chat-footer input {
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 8px 16px;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--chat-text);
}

.chat-footer button {
    background: var(--chat-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-indicator {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    display: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {

    #ai-chat-button,
    .floating-assistant-btn {
        width: 70px;
        height: 70px;
    }

    #ai-chat-button svg,
    .floating-assistant-btn i {
        transform: scale(1.2);
    }

    #btn-nav-mic-fixed {
        bottom: 105px;
    }

    #ai-chat-window {
        width: calc(100vw - 40px);
        height: 70vh;
        right: -10px;
        bottom: 85px;
    }
}