/* =========================================
   ENACONNECT AI ASSISTANT
========================================= */

.ai-fab {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    z-index: 9999;

    background:
        linear-gradient(
            135deg,
            #0ea5e9,
            #2563eb,
            #7c3aed
        );

    box-shadow:
        0 12px 40px rgba(14,165,233,.35),
        0 0 0 0 rgba(14,165,233,.5);

    display: flex;
    align-items: center;
    justify-content: center;

    transition: all .35s ease;

    animation: aiPulse 2.5s infinite;
}

.ai-fab:hover {
    transform: translateY(-4px) scale(1.05);
}

.ai-fab img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

@keyframes aiPulse {

    0% {
        box-shadow:
            0 12px 40px rgba(14,165,233,.35),
            0 0 0 0 rgba(14,165,233,.45);
    }

    70% {
        box-shadow:
            0 12px 40px rgba(14,165,233,.35),
            0 0 0 18px rgba(14,165,233,0);
    }

    100% {
        box-shadow:
            0 12px 40px rgba(14,165,233,.35),
            0 0 0 0 rgba(14,165,233,0);
    }
}

/* =========================================
   CHAT WINDOW
========================================= */

.ai-chat-window {
    position: fixed;
    right: 24px;
    bottom: 180px;

    width: 400px;
    max-width: calc(100vw - 32px);

    height: 620px;
    max-height: calc(100vh - 120px);

    z-index: 9998;

    display: flex;
    flex-direction: column;

    border-radius: 28px;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            rgba(8,15,35,.98),
            rgba(5,10,25,.98)
        );

    border:
        1px solid rgba(255,255,255,.08);

    box-shadow:
        0 25px 80px rgba(0,0,0,.45);

    backdrop-filter: blur(18px);

    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);

    transition: all .35s ease;
}

.ai-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ai-chat-header {
    padding: 20px 22px;

    border-bottom:
        1px solid rgba(255,255,255,.06);

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ai-chat-brand img {
    width: 42px;
    height: 42px;
}

.ai-chat-brand h3 {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 4px;
}

.ai-chat-brand p {
    font-size: .85rem;
    color: rgba(255,255,255,.6);
}

.ai-chat-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: none;
    cursor: pointer;

    background: rgba(255,255,255,.06);

    color: #fff;
    font-size: 1.2rem;

    transition: all .25s ease;
}

.ai-chat-close:hover {
    background: rgba(255,255,255,.12);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;

    padding: 24px;

    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ai-message {
    max-width: 88%;
    padding: 16px 18px;
    border-radius: 22px;

    line-height: 1.7;
    font-size: .97rem;
}

.ai-message.bot {
    align-self: flex-start;

    background:
        rgba(255,255,255,.06);

    border:
        1px solid rgba(255,255,255,.06);

    color: #fff;
}

.ai-message.user {
    align-self: flex-end;

    background:
        linear-gradient(
            135deg,
            #0ea5e9,
            #2563eb
        );

    color: #fff;
}

.ai-chat-input-area {
    padding: 18px;

    border-top:
        1px solid rgba(255,255,255,.06);

    display: flex;
    gap: 12px;
}

.ai-chat-input {
    flex: 1;

    border: none;
    outline: none;

    border-radius: 18px;

    padding: 14px 16px;

    background:
        rgba(255,255,255,.06);

    color: #fff;

    font-size: .95rem;
}

.ai-chat-input::placeholder {
    color: rgba(255,255,255,.45);
}

.ai-chat-send {
    width: 54px;
    min-width: 54px;

    border: none;
    cursor: pointer;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            #0ea5e9,
            #2563eb
        );

    color: #fff;

    font-size: 1.1rem;

    transition: all .25s ease;
}

.ai-chat-send:hover {
    transform: scale(1.05);
}

/* =========================================
   TYPING
========================================= */

.ai-typing {
    display: flex;
    gap: 6px;
    align-items: center;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.7);

    animation: typingBounce 1.2s infinite;
}

.ai-typing span:nth-child(2) {
    animation-delay: .15s;
}

.ai-typing span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes typingBounce {

    0%, 80%, 100% {
        transform: scale(.7);
        opacity: .5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 768px) {

    .ai-chat-window {

        right: 12px;
        left: 12px;

        width: auto;

        bottom: 160px;

        height: 78vh;
    }

    .ai-fab {
        width: 64px;
        height: 64px;

        right: 18px;
        bottom: 86px;
    }
}