/* AI Assistant Styles */
#ai-assistant-wrapper {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: 'Inter', sans-serif;
}

#ai-assistant-chat {
    width: 380px;
    height: 350px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

body.dark-mode #ai-assistant-chat {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

#ai-assistant-chat.active {
    display: flex;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header .status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

#chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8fafc;
}

body.dark-mode #chat-messages {
    background: #020617;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.message.bot {
    align-self: flex-start;
    background: #fff;
    color: #1e293b;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.message.admin {
    align-self: flex-start;
    background: #e2e8f0;
    color: #0f172a;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 3px solid #22c55e;
}

body.dark-mode .message.bot {
    background: #1e293b;
    color: #f1f5f9;
}

body.dark-mode .message.admin {
    background: #334155;
    color: #f1f5f9;
    border-left: 3px solid #22c55e;
}

.message.user {
    align-self: flex-end;
    background: #f5b027;
    color: #000;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}

body.dark-mode .chat-input-area {
    background: #111827;
    border-color: #1e293b;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
}

body.dark-mode .chat-input-area input {
    background: #1e293b;
    border-color: #334155;
    color: #fff;
}

.chat-send-btn {
    background: #f5b027;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Floating button style matching the others */
.social-btn.assistant {
    background: #1e293b !important;
}

.social-btn.assistant:hover {
    background: #f5b027 !important;
    color: #000 !important;
    transform: scale(1.1) rotate(10deg);
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 600px) {
    #ai-assistant-wrapper {
        bottom: 85px;
        /* Anclado abajo, por encima de los botones flotantes */
        top: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        /* Centrado solo horizontalmente */
    }

    #ai-assistant-chat {
        width: 330px;
        max-width: 90vw;
        height: 420px;
        max-height: 75vh;
        border-radius: 18px;
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    }

    /* Evita el auto-zoom nativo en iOS Safari al enfocar inputs */
    .chat-input-area input {
        font-size: 16px !important;
    }
}