/* =========================================
   TRISTAR CUSTOMER SUPPORT CHATBOT
========================================= */

.chatbot {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 99999;
    font-family: inherit;
}


/* =========================================
   FLOATING BUTTON
========================================= */

.chatbot-toggle {
    position: relative;
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 50%;
    background: #0b3b63;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    box-shadow: 0 10px 30px rgba(5, 35, 60, 0.25);

    transition: transform 0.3s ease,
        box-shadow 0.3s ease;
}

.chatbot-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(5, 35, 60, 0.32);
}

.chatbot-icon {
    font-size: 25px;
    line-height: 1;
}

.chatbot-pulse {
    position: absolute;
    top: 3px;
    right: 3px;

    width: 11px;
    height: 11px;

    background: #f58220;

    border: 2px solid #ffffff;
    border-radius: 50%;
}


/* =========================================
   CHAT WINDOW
========================================= */

.chatbot-window {
    position: absolute;

    right: 0;
    bottom: 78px;

    width: 370px;
    max-width: calc(100vw - 30px);
    height: 540px;

    background: #ffffff;

    border-radius: 20px;
    overflow: hidden;

    box-shadow: 0 20px 60px rgba(7, 36, 60, 0.20);

    border: 1px solid #e5edf2;

    display: flex;
    flex-direction: column;

    opacity: 0;
    visibility: hidden;

    transform: translateY(15px) scale(0.97);

    transform-origin: bottom right;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}

.chatbot-window.active {
    opacity: 1;
    visibility: visible;

    transform: translateY(0) scale(1);
}


/* =========================================
   HEADER
========================================= */

.chatbot-header {
    min-height: 76px;

    padding: 14px 16px;

    background: #0b3b63;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-logo {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;
}

.chatbot-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.chatbot-brand strong {
    display: block;

    font-size: 15px;
    font-weight: 700;

    margin-bottom: 4px;
}

.chatbot-brand span {
    display: flex;
    align-items: center;
    gap: 5px;

    font-size: 11px;
    opacity: 0.85;
}

.chatbot-brand span i {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #46d369;

    display: inline-block;
}

.chatbot-close {
    width: 32px;
    height: 32px;

    border: none;
    background: transparent;

    color: #ffffff;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    opacity: 0.85;
}

.chatbot-close:hover {
    opacity: 1;
}


/* =========================================
   MESSAGES
========================================= */

.chatbot-messages {
    flex: 1;

    padding: 20px 16px;

    overflow-y: auto;

    background: #f7fafc;

    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    gap: 9px;

    margin-bottom: 15px;
}

.message-avatar {
    flex-shrink: 0;

    width: 30px;
    height: 30px;

    border-radius: 50%;

    background: #0b3b63;
    color: #ffffff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 700;
}

.message-content {
    max-width: 82%;
}

.message-content p {
    margin: 0 0 7px;

    padding: 11px 13px;

    background: #ffffff;

    border-radius: 4px 14px 14px 14px;

    color: #34495e;

    font-size: 13px;
    line-height: 1.55;

    box-shadow: 0 2px 8px rgba(20, 45, 65, 0.05);
}

.message-content p:last-child {
    margin-bottom: 0;
}


/* USER MESSAGE */

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.user .message-avatar {
    display: none;
}

.chat-message.user .message-content {
    max-width: 82%;
}

.chat-message.user .message-content p {
    background: #0b3b63;
    color: #ffffff;

    border-radius: 14px 4px 14px 14px;
}


/* =========================================
   QUICK OPTIONS
========================================= */

.chatbot-options {
    display: flex;
    flex-wrap: wrap;

    gap: 8px;

    margin: 5px 0 18px 39px;
}

.chatbot-options button {
    padding: 9px 12px;

    border: 1px solid #d8e4ec;

    background: #ffffff;

    border-radius: 20px;

    color: #0b3b63;

    font-size: 11px;
    font-weight: 600;

    cursor: pointer;

    transition: all 0.2s ease;
}

.chatbot-options button:hover {
    background: #0b3b63;
    color: #ffffff;
    border-color: #0b3b63;
}


/* =========================================
   TYPING INDICATOR
========================================= */

.typing {
    display: flex;
    gap: 4px;

    padding: 12px 14px;

    background: #ffffff;

    border-radius: 4px 14px 14px 14px;

    width: fit-content;
}

.typing span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #8ca0b0;

    animation: chatbotTyping 1.2s infinite ease-in-out;
}

.typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes chatbotTyping {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}


/* =========================================
   INPUT
========================================= */

.chatbot-input-area {
    min-height: 64px;

    padding: 10px;

    background: #ffffff;

    border-top: 1px solid #e5edf2;

    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-input-area input {
    flex: 1;

    min-width: 0;

    height: 42px;

    padding: 0 14px;

    border: 1px solid #dce5eb;

    border-radius: 22px;

    outline: none;

    font-family: inherit;
    font-size: 13px;

    color: #1d3448;

    background: #f8fafb;
}

.chatbot-input-area input:focus {
    border-color: #0b3b63;
    background: #ffffff;
}

.chatbot-input-area button {
    width: 42px;
    height: 42px;

    flex-shrink: 0;

    border: none;
    border-radius: 50%;

    background: #f58220;
    color: #ffffff;

    font-size: 17px;

    cursor: pointer;

    transition: transform 0.2s ease;
}

.chatbot-input-area button:hover {
    transform: scale(1.05);
}


/* =========================================
   LINKS
========================================= */

.chatbot-link {
    color: #f58220;
    font-weight: 700;
    text-decoration: none;
}

.chatbot-link:hover {
    text-decoration: underline;
}


/* =========================================
   LEAD FORM
========================================= */

.chatbot-lead-form {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-top: 10px;
}

.chatbot-lead-form input {
    width: 100%;
    box-sizing: border-box;

    padding: 10px 11px;

    border: 1px solid #dce5eb;

    border-radius: 8px;

    outline: none;

    font-family: inherit;
    font-size: 12px;
}

.chatbot-lead-form input:focus {
    border-color: #0b3b63;
}

.chatbot-lead-form button {
    padding: 11px;

    border: none;
    border-radius: 8px;

    background: #f58220;
    color: #ffffff;

    font-family: inherit;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}

.chatbot-lead-form button:hover {
    opacity: 0.9;
}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

    .chatbot {
        right: 15px;
        bottom: 15px;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }

    .chatbot-window {
        position: fixed;

        left: 10px;
        right: 10px;
        bottom: 80px;

        width: auto;
        max-width: none;

        height: min(600px, calc(100vh - 105px));

        border-radius: 18px;
    }

    .chatbot-header {
        min-height: 68px;
    }

    .chatbot-messages {
        padding: 16px 12px;
    }

    .chatbot-options {
        margin-left: 0;
    }

    .chatbot-options button {
        font-size: 11px;
    }
}

/* =========================================
   CHATBOT CLICK FIX
========================================= */

.chatbot {
    position: fixed !important;
    z-index: 999999 !important;
    pointer-events: auto !important;
}

.chatbot-toggle {
    position: relative;
    z-index: 1000000 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

.chatbot-window {
    z-index: 1000001 !important;
    pointer-events: auto !important;
}

.chatbot-toggle,
.chatbot-close,
.chatbot-options button,
.chatbot-input-area button {
    pointer-events: auto !important;
}