/* ============================================
   VANTREX GLOBAL
   LIVE CHAT WIDGET
============================================ */


/* ============================================
   CHAT WIDGET
============================================ */

.chat-widget {

    position: fixed;

    right: 24px;
    bottom: 24px;

    z-index: 9999;

    font-family:
        Inter,
        Arial,
        sans-serif;
}


/* ============================================
   CHAT LAUNCHER
============================================ */

.chat-launcher {

    position: relative;

    width: 62px;
    height: 62px;

    border: none;
    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #f5b942,
            #d99a20
        );

    color: #050914;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow:
        0 14px 35px
        rgba(0, 0, 0, 0.35);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.chat-launcher:hover {

    transform:
        translateY(-3px);

    box-shadow:
        0 18px 40px
        rgba(0, 0, 0, 0.45);
}


.chat-launcher-icon {

    font-size: 25px;

    line-height: 1;
}


.chat-launcher-badge {

    position: absolute;

    top: -2px;
    right: -2px;

    width: 21px;
    height: 21px;

    border-radius: 50%;

    background: #ff4d4d;

    color: #ffffff;

    font-size: 11px;
    font-weight: 800;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 2px solid #050914;
}


.chat-launcher-badge.hidden {

    display: none;
}


/* ============================================
   CHAT WINDOW
============================================ */

.chat-window {

    position: absolute;

    right: 0;
    bottom: 78px;

    width: 390px;
    max-width: calc(100vw - 30px);

    height: 610px;
    max-height: calc(100vh - 110px);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    background: #07101d;

    border:
        1px solid
        rgba(255, 255, 255, 0.09);

    border-radius: 20px;

    box-shadow:
        0 25px 70px
        rgba(0, 0, 0, 0.5);

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(15px)
        scale(0.97);

    transform-origin:
        bottom right;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}


.chat-window.open {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);
}


/* ============================================
   HEADER
============================================ */

.chat-header {

    min-height: 76px;

    padding:
        15px 17px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background:
        linear-gradient(
            135deg,
            #0d1a2b,
            #081321
        );

    border-bottom:
        1px solid
        rgba(255, 255, 255, 0.07);
}


.chat-header-info {

    display: flex;

    align-items: center;

    gap: 11px;
}


.chat-avatar {

    width: 42px;
    height: 42px;

    border-radius: 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #f5b942,
            #1769ff
        );

    color: #ffffff;

    font-size: 12px;
    font-weight: 900;
}


.chat-header-info strong {

    display: block;

    color: #ffffff;

    font-size: 14px;

    margin-bottom: 3px;
}


.chat-header-info span {

    display: flex;

    align-items: center;

    gap: 6px;

    color: #7f91a8;

    font-size: 11px;
}


.chat-header-info span::before {

    content: "";

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #32d583;

    box-shadow:
        0 0 8px
        rgba(50, 213, 131, 0.7);
}


.chat-header-actions {

    display: flex;

    align-items: center;

    gap: 5px;
}


.chat-header-button {

    width: 32px;
    height: 32px;

    border: none;

    border-radius: 9px;

    background:
        rgba(255, 255, 255, 0.05);

    color: #aebbd0;

    font-size: 20px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


.chat-header-button:hover {

    background:
        rgba(255, 255, 255, 0.1);

    color: #ffffff;
}


/* ============================================
   MESSAGES
============================================ */

.chat-messages {

    flex: 1;

    min-height: 0;

    padding: 18px;

    overflow-y: auto;

    background:
        #050b14;
}


.chat-messages::-webkit-scrollbar {

    width: 5px;
}


.chat-messages::-webkit-scrollbar-track {

    background: transparent;
}


.chat-messages::-webkit-scrollbar-thumb {

    background:
        rgba(255, 255, 255, 0.12);

    border-radius: 10px;
}


/* ============================================
   MESSAGE
============================================ */

.chat-message {

    display: flex;

    margin-bottom: 13px;
}


.chat-message.visitor {

    justify-content: flex-end;
}


.chat-message.bot,
.chat-message.admin,
.chat-message.system {

    justify-content: flex-start;
}


.chat-message-content {

    max-width: 82%;

    padding:
        11px 13px;

    border-radius: 14px;

    font-size: 13px;

    line-height: 1.55;

    word-wrap: break-word;
}


.chat-message.visitor
.chat-message-content {

    background:
        linear-gradient(
            135deg,
            #1769ff,
            #315fe9
        );

    color: #ffffff;

    border-bottom-right-radius: 4px;
}


.chat-message.bot
.chat-message-content {

    background: #0e1928;

    color: #dce5f1;

    border:
        1px solid
        rgba(255, 255, 255, 0.06);

    border-bottom-left-radius: 4px;
}


.chat-message.admin
.chat-message-content {

    background:
        rgba(245, 185, 66, 0.1);

    color: #f4f7fb;

    border:
        1px solid
        rgba(245, 185, 66, 0.2);

    border-bottom-left-radius: 4px;
}


.chat-message.system
.chat-message-content {

    width: 100%;

    max-width: 100%;

    text-align: center;

    background:
        rgba(255, 255, 255, 0.035);

    color: #91a0b4;

    border:
        1px solid
        rgba(255, 255, 255, 0.06);

    font-size: 11px;
}


/* ============================================
   MESSAGE LABEL
============================================ */

.chat-message-label {

    display: block;

    margin-bottom: 4px;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 0.08em;

    text-transform: uppercase;

    opacity: 0.65;
}


/* ============================================
   LOADING
============================================ */

.chat-loading {

    height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 12px;

    color: #718198;

    font-size: 12px;
}


.chat-loading-spinner {

    width: 25px;
    height: 25px;

    border-radius: 50%;

    border:
        3px solid
        rgba(255, 255, 255, 0.08);

    border-top-color:
        #f5b942;

    animation:
        chatSpin 0.8s linear infinite;
}


@keyframes chatSpin {

    to {

        transform:
            rotate(360deg);

    }

}


/* ============================================
   QUICK QUESTIONS
============================================ */

.chat-quick-questions {

    padding:
        10px 13px 7px;

    display: flex;

    gap: 7px;

    overflow-x: auto;

    background: #07101d;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.05);
}


.chat-quick-questions::-webkit-scrollbar {

    height: 3px;
}


.chat-quick-button {

    flex-shrink: 0;

    padding:
        8px 11px;

    border:
        1px solid
        rgba(245, 185, 66, 0.25);

    border-radius: 20px;

    background:
        rgba(245, 185, 66, 0.06);

    color: #e7c978;

    font-size: 10px;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


.chat-quick-button:hover {

    background:
        rgba(245, 185, 66, 0.12);

    border-color:
        rgba(245, 185, 66, 0.45);
}


/* ============================================
   LIVE AGENT
============================================ */

.chat-agent-area {

    padding:
        7px 13px 10px;

    background: #07101d;
}


.chat-agent-button {

    width: 100%;

    padding:
        10px 13px;

    border:
        1px solid
        rgba(255, 255, 255, 0.1);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.035);

    color: #cbd6e5;

    font-size: 11px;
    font-weight: 700;

    cursor: pointer;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


.chat-agent-button:hover {

    background:
        rgba(245, 185, 66, 0.08);

    border-color:
        rgba(245, 185, 66, 0.3);

    color: #f5c967;
}


.chat-agent-button:disabled {

    opacity: 0.55;

    cursor: not-allowed;
}


/* ============================================
   INPUT
============================================ */

.chat-input-area {

    padding:
        10px 12px;

    display: flex;

    gap: 8px;

    background: #07101d;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.06);
}


.chat-input-area input {

    flex: 1;

    min-width: 0;

    height: 42px;

    padding:
        0 13px;

    border:
        1px solid
        rgba(255, 255, 255, 0.09);

    border-radius: 11px;

    outline: none;

    background:
        #0b1624;

    color: #ffffff;

    font-family: inherit;

    font-size: 12px;

    transition:
        border-color 0.2s ease;
}


.chat-input-area input::placeholder {

    color: #65758a;
}


.chat-input-area input:focus {

    border-color:
        rgba(245, 185, 66, 0.5);
}


.chat-input-area button {

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    border: none;

    border-radius: 11px;

    background:
        #f5b942;

    color: #050914;

    font-size: 16px;

    font-weight: 900;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease;
}


.chat-input-area button:hover {

    background: #ffd878;

    transform:
        translateY(-1px);
}


.chat-input-area button:disabled {

    opacity: 0.5;

    cursor: not-allowed;

    transform: none;
}


/* ============================================
   FOOTER
============================================ */

.chat-footer {

    padding:
        7px 13px 9px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    background: #07101d;

    color: #4f6075;

    font-size: 9px;

    border-top:
        1px solid
        rgba(255, 255, 255, 0.035);
}


.chat-footer button {

    border: none;

    background: transparent;

    color: #65758a;

    font-size: 9px;

    cursor: pointer;
}


.chat-footer button:hover {

    color: #ff7777;
}


/* ============================================
   DISABLED STATE
============================================ */

.chat-widget.chat-disabled
.chat-input-area input {

    opacity: 0.5;

    cursor: not-allowed;
}


.chat-widget.chat-disabled
.chat-send-button {

    opacity: 0.5;
}


/* ============================================
   MOBILE
============================================ */

@media (max-width: 600px) {

    .chat-widget {

        right: 14px;
        bottom: 14px;

    }


    .chat-launcher {

        width: 57px;
        height: 57px;

    }


    .chat-window {

        position: fixed;

        right: 10px;
        left: 10px;

        bottom: 10px;

        width: auto;
        max-width: none;

        height:
            calc(100vh - 20px);

        max-height:
            calc(100vh - 20px);

        border-radius: 18px;

    }

}


@media (max-width: 380px) {

    .chat-widget {

        right: 10px;
        bottom: 10px;

    }


    .chat-window {

        right: 6px;
        left: 6px;

        bottom: 6px;

        height:
            calc(100vh - 12px);

        max-height:
            calc(100vh - 12px);

    }


    .chat-header {

        min-height: 68px;

    }


    .chat-messages {

        padding: 14px;

    }

}