﻿/* ==========================================
   TECHNO WEBS AI ASSISTANT
========================================== */

#tw-ai-chat {
    position: fixed;
    right: 25px;
    bottom: 105px;
    z-index: 99999;
    font-family: inherit;
}


/* Floating Button */

#twAiButton {
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8b00ff, #006eff);
    color: #fff;
    font-size: 30px;
    box-shadow: 0 8px 30px rgba(123, 0, 255, .45);
    transition: all .25s ease;
}

    #twAiButton:hover {
        transform: scale(1.08);
        box-shadow: 0 10px 35px rgba(123, 0, 255, .65);
    }

.tw-ai-spark {
    line-height: 1;
}


/* ==========================================
   CHAT WINDOW
========================================== */

.tw-ai-window {
    position: absolute;
    right: 0;
    bottom: 60px;
    width: 390px;
    height: 550px;
    /* Never allow chatbot to go above viewport */
    max-height: calc(100vh - 125px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: #0b0b0f;
    border: 1px solid rgba(163, 39, 255, .45);
    box-shadow: 0 20px 70px rgba(0, 0, 0, .65);
}

    .tw-ai-window.open {
        display: flex;
    }


/* Header */

.tw-ai-header {
    min-height: 78px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #17101f, #10101c);
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.tw-ai-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    background: linear-gradient(135deg, #8b00ff, #006eff);
    color: white;
    font-size: 23px;
}

.tw-ai-header-text {
    display: flex;
    flex-direction: column;
    color: white;
}

    .tw-ai-header-text strong {
        font-size: 16px;
    }

    .tw-ai-header-text span {
        margin-top: 3px;
        font-size: 12px;
        color: #aaa;
    }

.tw-ai-online {
    width: 7px;
    height: 7px;
    display: inline-block;
    margin-right: 5px;
    border-radius: 50%;
    background: #31e981;
}

.tw-ai-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #aaa;
    font-size: 28px;
    cursor: pointer;
}


/* Messages */

.tw-ai-messages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    background: radial-gradient( circle at top right, rgba(102,0,255,.10), transparent 35% );
}

.tw-ai-message {
    display: flex;
    margin-bottom: 14px;
}

    .tw-ai-message.bot {
        justify-content: flex-start;
    }

    .tw-ai-message.user {
        justify-content: flex-end;
    }

.tw-ai-bubble {
    max-width: 82%;
    padding: 11px 14px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.55;
}

.tw-ai-message.bot .tw-ai-bubble {
    color: #e8e8e8;
    background: #19191f;
    border-bottom-left-radius: 5px;
}

.tw-ai-message.user .tw-ai-bubble {
    color: white;
    background: linear-gradient(135deg, #7400d9, #285cff);
    border-bottom-right-radius: 5px;
}


/* Quick Actions */

.tw-ai-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

    .tw-ai-quick-actions button {
        padding: 8px 11px;
        border-radius: 18px;
        border: 1px solid rgba(151,48,255,.6);
        background: transparent;
        color: #d7b9ff;
        font-size: 12px;
        cursor: pointer;
        transition: .2s;
    }

        .tw-ai-quick-actions button:hover {
            background: #7817c9;
            color: white;
        }


/* Typing */

.tw-ai-typing {
    display: none;
    padding: 8px 20px 12px;
    background: #0b0b0f;
}

    .tw-ai-typing.show {
        display: block;
    }

    .tw-ai-typing span {
        width: 6px;
        height: 6px;
        display: inline-block;
        margin-right: 3px;
        border-radius: 50%;
        background: #aaa;
        animation: twTyping 1.2s infinite;
    }

        .tw-ai-typing span:nth-child(2) {
            animation-delay: .15s;
        }

        .tw-ai-typing span:nth-child(3) {
            animation-delay: .3s;
        }

@keyframes twTyping {

    0%, 60%, 100% {
        transform: translateY(0);
        opacity: .5;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}


/* Input */

.tw-ai-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    background: #101014;
}

#twAiInput {
    flex: 1;
    resize: none;
    max-height: 100px;
    padding: 11px 13px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.12);
    outline: none;
    background: #19191f;
    color: white;
    font-size: 14px;
}

    #twAiInput::placeholder {
        color: #777;
    }

    #twAiInput:focus {
        border-color: #7e22ce;
    }


/* Send */

#twAiSend {
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, #8b00ff, #006eff);
    font-size: 18px;
}


/* Footer */

.tw-ai-footer {
    padding: 7px;
    text-align: center;
    font-size: 10px;
    color: #666;
    background: #0b0b0f;
}

/* ==========================================
   AI CHAT LEAD FORM
========================================== */

.tw-ai-lead-form {
    width: 100%;
    max-width: 92% !important;
    padding: 16px !important;
}

.tw-ai-lead-title {
    margin-bottom: 5px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

.tw-ai-lead-text {
    margin-bottom: 14px;
    color: #aaa;
    font-size: 12px;
    line-height: 1.5;
}


/* Form Fields */

.tw-ai-form-group {
    margin-bottom: 10px;
}

    .tw-ai-form-group input {
        width: 100%;
        box-sizing: border-box;
        padding: 10px 12px;
        border: 1px solid rgba(255,255,255,.12);
        border-radius: 10px;
        outline: none;
        background: #101014;
        color: #ffffff;
        font-family: inherit;
        font-size: 13px;
        transition: border-color .2s ease, box-shadow .2s ease;
    }

        .tw-ai-form-group input::placeholder {
            color: #777;
        }

        .tw-ai-form-group input:focus {
            border-color: #8b00ff;
            box-shadow: 0 0 0 2px rgba(139,0,255,.12);
        }


/* Error Message */

.tw-ai-lead-error {
    min-height: 0;
    margin-bottom: 8px;
    color: #ff6b6b;
    font-size: 11px;
    line-height: 1.4;
}

    .tw-ai-lead-error:empty {
        display: none;
    }


/* Submit Button */

.tw-ai-lead-submit {
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient( 135deg, #8b00ff, #006eff );
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

    .tw-ai-lead-submit:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(123,0,255,.35);
    }

    .tw-ai-lead-submit:disabled {
        cursor: not-allowed;
        opacity: .6;
        transform: none;
    }


/* Successful Submission */

.tw-ai-lead-success {
    color: #e8e8e8;
    font-size: 13px;
    line-height: 1.55;
}

    .tw-ai-lead-success strong {
        color: #31e981;
    }

/* Mobile */

@media (max-width: 576px) {

    #tw-ai-chat {
        right: 15px;
        bottom: 90px;
    }

    #twAiButton {
        width: 55px;
        height: 55px;
    }

    .tw-ai-window {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 80px;
        width: auto;
        height: 70vh;
        max-height: 600px;
    }

    .tw-ai-lead-form {
        max-width: 95% !important;
        padding: 14px !important;
    }

    .tw-ai-form-group input {
        font-size: 16px;
    }

    .tw-ai-lead-submit {
        min-height: 44px;
    }
}
