/* =========================================================
   NEXUS DELIGHT AI CHAT
========================================================= */

.nd-ai-chat-button {
    position: fixed;
    right: 20px;
    bottom: 20px;

    width: 50px;
    height: 50px;

    border: 0;
    border-radius: 50%;

    background: #6421ff;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 18px;

    cursor: pointer;

    box-shadow: 0 10px 30px rgba(100, 33, 255, 0.35);

    z-index: 99999;

    transition: all 0.3s ease;
}

.nd-ai-chat-button:hover {
    transform: translateY(-3px) scale(1.04);
}


/* Notification dot */

.nd-ai-chat-button::after {
    content: "";

    position: absolute;

    top: 4px;
    right: 5px;

    width: 12px;
    height: 12px;

    background: #22c55e;

    border: 2px solid #ffffff;

    border-radius: 50%;
}


/* =========================================================
   CHAT BOX
========================================================= */

.nd-ai-chat-box {
    position: fixed;

    right: 25px;
    bottom: 100px;

    width: 380px;
    max-width: calc(100vw - 30px);

    height: 570px;
    max-height: calc(100vh - 130px);

    background: #ffffff;

    border-radius: 18px;

    overflow: hidden;

    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.18);

    display: none;

    flex-direction: column;

    z-index: 99998;
}

.nd-ai-chat-box.active {
    display: flex;
}


/* =========================================================
   HEADER
========================================================= */

.nd-ai-chat-header {
    background: #6421ff;

    color: #ffffff;

    padding: 17px 18px;

    display: flex;

    align-items: center;

    justify-content: space-between;
}

.nd-ai-chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nd-ai-chat-avatar {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: #ffffff;

    color: #6421ff;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 19px;
}

.nd-ai-chat-title {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

.nd-ai-chat-status {
    margin: 3px 0 0;

    font-size: 12px;

    opacity: 0.85;
}

.nd-ai-chat-close {
    border: 0;

    background: transparent;

    color: #ffffff;

    font-size: 22px;

    cursor: pointer;

    width: 35px;
    height: 35px;
}


/* =========================================================
   MESSAGES
========================================================= */

/*.nd-ai-chat-messages {*/
/*    flex: 1;*/

/*    padding: 18px;*/

/*    overflow-y: auto;*/

/*    background: #f7f7fb;*/
/*}*/

/*.nd-ai-message {*/
/*    display: flex;*/

/*    margin-bottom: 14px;*/
/*}*/


/* Chat Messages Area */
.nd-ai-chat-messages {
    flex: 1;
    min-height: 0;

    padding: 30px 18px 20px;

    overflow-y: auto;
    overflow-x: hidden;

    background: #f7f7fb;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}


/* Common Message Row */
.nd-ai-message {
    display: flex;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}


/* AI Message - LEFT */
.nd-ai-message.ai {
    justify-content: flex-start;
}


/* User Message - RIGHT */
.nd-ai-message.user {
    justify-content: flex-end;
}


/* Message Content */
.nd-ai-message-content {
    max-width: 82%;
    padding: 11px 14px;

    border-radius: 13px;

    font-size: 14px;
    line-height: 1.6;

    word-wrap: break-word;
    overflow-wrap: break-word;
}


/* AI Message Design */
.nd-ai-message.ai .nd-ai-message-content {
    background: #ffffff;
    color: #252525;

    border-bottom-left-radius: 4px;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}


/* User Message Design */
.nd-ai-message.user .nd-ai-message-content {
    background: #6421ff;
    color: #ffffff;

    border-bottom-right-radius: 4px;

    box-shadow: 0 3px 12px rgba(100, 33, 255, 0.15);
}


/* =========================================================
   QUICK QUESTIONS
========================================================= */

.nd-ai-quick-questions {
    display: flex;

    flex-wrap: wrap;

    gap: 7px;

    padding: 0 18px 12px;

    background: #f7f7fb;
}

.nd-ai-quick-btn {
    border: 1px solid #ddd6ff;

    background: #ffffff;

    color: #6421ff;

    padding: 7px 10px;

    border-radius: 20px;

    font-size: 12px;

    cursor: pointer;

    transition: all 0.2s ease;
}

.nd-ai-quick-btn:hover {
    background: #6421ff;

    color: #ffffff;

    border-color: #6421ff;
}


/* =========================================================
   INPUT
========================================================= */

.nd-ai-chat-input-area {
    padding: 12px;

    background: #ffffff;

    border-top: 1px solid #eeeeee;
}

.nd-ai-chat-form {
    display: flex;

    gap: 8px;
}

.nd-ai-chat-input {
    flex: 1;

    height: 45px;

    border: 1px solid #dddddd;

    border-radius: 10px;

    outline: none;

    padding: 0 13px;

    font-size: 14px;
}

.nd-ai-chat-input:focus {
    border-color: #6421ff;
}

.nd-ai-chat-send {
    width: 45px;
    height: 45px;

    border: 0;

    border-radius: 10px;

    background: #6421ff;

    color: #ffffff;

    cursor: pointer;

    font-size: 17px;
}

.nd-ai-chat-send:disabled {
    opacity: 0.6;

    cursor: not-allowed;
}


/* =========================================================
   TYPING
========================================================= */

.nd-ai-typing {
    display: flex;

    align-items: center;

    gap: 4px;

    padding: 4px 0;
}

.nd-ai-typing span {
    width: 6px;
    height: 6px;

    background: #6421ff;

    border-radius: 50%;

    animation: ndTyping 1.2s infinite ease-in-out;
}

.nd-ai-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.nd-ai-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes ndTyping {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 575px) {

    .nd-ai-chat-button {
        right: 15px;
        bottom: 15px;

        width: 56px;
        height: 56px;

        font-size: 22px;
    }

    .nd-ai-chat-box {
        right: 10px;
        bottom: 82px;

        width: calc(100vw - 20px);

        height: 70vh;

        max-height: 600px;

        border-radius: 15px;
    }

    .nd-ai-chat-messages {
        padding: 14px;
    }

    .nd-ai-message-content {
        max-width: 88%;
    }
}