/* ==========================================
   VIXIOT AI CHATBOT
========================================== */

#vixiot-chat-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;

    width: 62px;
    height: 62px;

    border: none;
    border-radius: 50%;

    background: #0d9488;
    color: white;

    font-size: 28px;
    cursor: pointer;

    box-shadow: 0 4px 18px rgba(0,0,0,0.25);

    z-index: 999999;
}

#vixiot-chat-window {
    position: fixed;

    right: 24px;
    bottom: 100px;

    width: 360px;
    max-width: calc(100vw - 30px);

    height: 500px;
    max-height: calc(100vh - 120px);

    display: none;
    flex-direction: column;

    background: white;

    border-radius: 18px;
    overflow: hidden;

    box-shadow: 0 8px 35px rgba(0,0,0,0.2);

    font-family: Arial, sans-serif;

    z-index: 999999;
}

#vixiot-chat-header {
    background: #0d9488;
    color: white;

    padding: 18px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

#vixiot-chat-header small {
    display: block;
    margin-top: 5px;
    opacity: 0.85;
}

#vixiot-chat-close {
    background: transparent;
    color: white;

    border: none;

    font-size: 25px;
    cursor: pointer;
}

#vixiot-chat-messages {
    flex: 1;

    overflow-y: auto;

    padding: 15px;

    display: flex;
    flex-direction: column;

    gap: 12px;

    background: #f8fafc;
}

.vixiot-bot-message {
    align-self: flex-start;

    max-width: 85%;

    background: white;

    padding: 12px;

    border-radius: 12px;

    border: 1px solid #e5e7eb;

    color: #222;

    font-size: 14px;
    line-height: 1.5;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.vixiot-user-message {
    align-self: flex-end;

    max-width: 85%;

    background: #0d9488;
    color: white;

    padding: 12px;

    border-radius: 12px;

    font-size: 14px;
    line-height: 1.5;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#vixiot-chat-input-area {
    display: flex;

    padding: 12px;

    gap: 8px;

    border-top: 1px solid #e5e7eb;
}

#vixiot-chat-input {
    flex: 1;
    min-width: 0;

    padding: 12px;

    border: 1px solid #d1d5db;

    border-radius: 10px;

    outline: none;

    font-size: 14px;
}

#vixiot-chat-send {
    background: #0d9488;
    color: white;

    border: none;

    padding: 12px 15px;

    border-radius: 10px;

    cursor: pointer;
}

#vixiot-chat-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 480px) {

    #vixiot-chat-window {
        right: 15px;
        bottom: 90px;

        width: calc(100vw - 30px);
    }

    #vixiot-chat-toggle {
        right: 20px;
        bottom: 20px;
    }
}
