/* ================================================================
   Tezeon Chatbot — bottom-left, site theme (navy + gold)
   ================================================================ */

/* ── Floating toggle button ── */
#tez-chatbot-toggler {
    position: fixed;
    bottom: 28px;
    left: 28px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #030f27 0%, #0a1e3d 100%);
    box-shadow: 0 4px 24px rgba(3, 15, 39, 0.5), 0 0 0 0 rgba(253, 190, 51, 0);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    overflow: hidden;
}

#tez-chatbot-toggler::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 38%, rgba(253, 190, 51, 0.18) 0%, transparent 58%);
    pointer-events: none;
}

#tez-chatbot-toggler:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 32px rgba(3, 15, 39, 0.55), 0 0 0 6px rgba(253, 190, 51, 0.15);
}

#tez-chatbot-toggler img.tez-toggler-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    position: absolute;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

#tez-chatbot-toggler .tez-chat-x {
    position: absolute;
    font-size: 1.65rem;
    line-height: 1;
    color: #fdbe33;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

body.show-tez-chatbot #tez-chatbot-toggler img.tez-toggler-icon {
    opacity: 0;
    transform: scale(0.5) rotate(45deg);
}

body.show-tez-chatbot #tez-chatbot-toggler .tez-chat-x {
    opacity: 1;
}

/* ── Chat popup ── */
.tez-chatbot-popup {
    position: fixed;
    bottom: 98px;
    left: 28px;
    z-index: 9998;
    width: 360px;
    max-width: calc(100vw - 44px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow:
        0 12px 60px rgba(3, 15, 39, 0.22),
        0 2px 16px rgba(3, 15, 39, 0.1),
        0 0 0 1px rgba(3, 15, 39, 0.06);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.82) translateY(24px);
    transform-origin: bottom left;
    transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.show-tez-chatbot .tez-chatbot-popup {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

/* ── Header ── */
.tez-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #030f27 0%, #0a1e3d 100%);
}

.tez-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tez-chat-header-info .tez-hdr-logo {
    width: 38px;
    height: 38px;
    padding: 7px;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    flex-shrink: 0;
}

.tez-chat-header-info h3 {
    color: #fdbe33;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1px;
    font-family: 'Poppins', sans-serif;
}

.tez-chat-header-info span {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.03em;
    font-family: 'Poppins', sans-serif;
}

.tez-chat-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.tez-chat-close-btn:hover {
    color: #fdbe33;
    background: rgba(255, 255, 255, 0.08);
}

/* ── Message list ── */
.tez-chat-body {
    height: 340px;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafd;
    scrollbar-width: thin;
    scrollbar-color: rgba(3, 15, 39, 0.12) transparent;
}

.tez-chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.tez-chat-msg.bot  { align-self: flex-start; max-width: 88%; }
.tez-chat-msg.user { align-self: flex-end;   flex-direction: row-reverse; max-width: 82%; }

.tez-chat-msg .tez-bot-av {
    width: 28px;
    height: 28px;
    padding: 5px;
    background: #030f27;
    border-radius: 50%;
    flex-shrink: 0;
    margin-bottom: 2px;
}

.tez-chat-bubble {
    padding: 10px 14px;
    font-size: 0.855rem;
    line-height: 1.55;
    word-break: break-word;
    font-family: 'Poppins', sans-serif;
}

.tez-chat-msg.bot .tez-chat-bubble {
    background: #ffffff;
    color: #1a2637;
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 1px 6px rgba(3, 15, 39, 0.08);
}

.tez-chat-msg.user .tez-chat-bubble {
    background: linear-gradient(135deg, #030f27 0%, #0c2247 100%);
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
}

/* Thinking animation */
.tez-thinking-dots {
    display: flex;
    gap: 4px;
    padding: 5px 2px;
}

.tez-thinking-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #030f27;
    opacity: 0.4;
    animation: tez-dot-bounce 1.4s ease-in-out infinite;
}

.tez-thinking-dots span:nth-child(2) { animation-delay: 0.18s; }
.tez-thinking-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes tez-dot-bounce {
    0%, 60%, 100% { transform: translateY(0);    opacity: 0.4; }
    30%            { transform: translateY(-6px); opacity: 0.9; }
}

/* ── Input area ── */
.tez-chat-footer {
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(3, 15, 39, 0.07);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #ffffff;
}

.tez-chat-input {
    flex: 1;
    border: 1.5px solid rgba(3, 15, 39, 0.14);
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 0.855rem;
    font-family: 'Poppins', sans-serif;
    line-height: 1.45;
    outline: none;
    resize: none;
    max-height: 96px;
    overflow-y: auto;
    scrollbar-width: none;
    transition: border-color 0.2s;
    background: #f8fafd;
}

.tez-chat-input:focus {
    border-color: #030f27;
    background: #ffffff;
}

.tez-chat-send {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #fdbe33 0%, #ffc94d 100%);
    color: #030f27;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tez-chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 14px rgba(253, 190, 51, 0.45);
}

/* ── Powered-by footer ── */
.tez-chat-powered {
    text-align: center;
    font-size: 0.62rem;
    color: rgba(3, 15, 39, 0.3);
    padding: 5px 0 7px;
    background: #ffffff;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.04em;
}

/* ── Mobile ── */
@media (max-width: 480px) {
    #tez-chatbot-toggler { bottom: 18px; left: 18px; }

    .tez-chatbot-popup {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        transform-origin: bottom center;
    }

    .tez-chat-body { height: calc(55vh - 55px); }
}
