/* EvoBot Chatbot v3.0.0 — Evolved Contracting */
/* Colors: Blue #32aee2 | Red #e83439 | Yellow #fab833 | Green #aacf47 */

#tankbot-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    box-sizing: border-box;
}
#tankbot-wrapper *, #tankbot-wrapper *::before, #tankbot-wrapper *::after {
    box-sizing: border-box;
}

/* ===== TOGGLE BUTTON ===== */
#tankbot-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #32aee2 0%, #e83439 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(50,174,226,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-left: auto;
    padding: 0;
    outline: none;
}
#tankbot-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(50,174,226,0.65); }
#tankbot-toggle:focus { outline: 2px solid #fab833; outline-offset: 2px; }
#tankbot-toggle .icon-chat,
#tankbot-toggle .icon-close { width: 24px; height: 24px; display: block; pointer-events: none; }
#tankbot-toggle .icon-close { display: none; }
#tankbot-wrapper.open #tankbot-toggle .icon-chat  { display: none; }
#tankbot-wrapper.open #tankbot-toggle .icon-close { display: block; }

/* ===== CHAT WINDOW ===== */
#tankbot-window {
    display: none;
    flex-direction: column;
    width: 330px;
    height: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 36px rgba(50,174,226,0.22);
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid #32aee2;
}
#tankbot-wrapper.open #tankbot-window {
    display: flex;
    animation: tb-slide-up 0.2s ease;
}
@keyframes tb-slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== HEADER ===== */
#tankbot-header {
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    border-bottom: 3px solid #32aee2;
}
#tankbot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #32aee2, #e83439);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(50,174,226,0.4);
}
#tankbot-avatar svg { width: 20px; height: 20px; fill: #fff; display: block; }
#tankbot-header-info { flex: 1; min-width: 0; }
#tankbot-header-name  { font-size: 14px; font-weight: 800; color: #32aee2; line-height: 1.2; letter-spacing: 0.3px; }
#tankbot-header-status {
    font-size: 10px;
    color: rgba(255,255,255,0.82);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}
#tankbot-header-status::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #aacf47;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 0 5px #aacf47;
}

/* ===== MESSAGES ===== */
#tankbot-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f4f8fd;
    scroll-behavior: smooth;
}
#tankbot-messages::-webkit-scrollbar { width: 3px; }
#tankbot-messages::-webkit-scrollbar-thumb { background: #32aee255; border-radius: 3px; }

/* ===== MESSAGE ROWS ===== */
.tankbot-msg {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 92%;
    animation: tb-pop 0.15s ease;
}
@keyframes tb-pop {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
.tankbot-msg.bot  { align-self: flex-start; }
.tankbot-msg.user { align-self: flex-end; flex-direction: row-reverse; }

/* ===== BUBBLES ===== */
.tankbot-bubble {
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.tankbot-msg.bot .tankbot-bubble {
    background: #ffffff;
    color: #1a1a2e;
    border-radius: 3px 14px 14px 14px;
    border: 1px solid #32aee230;
    box-shadow: 0 1px 4px rgba(50,174,226,0.1);
}
.tankbot-msg.user .tankbot-bubble {
    background: linear-gradient(135deg, #32aee2, #1a8fc2);
    color: #ffffff;
    border-radius: 14px 3px 14px 14px;
}

/* ===== MINI AVATAR ===== */
.tankbot-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #32aee2, #e83439);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}
.tankbot-msg-avatar svg { width: 13px; height: 13px; display: block; fill: #fff; }
.tankbot-msg.user .tankbot-msg-avatar { display: none; }

/* ===== TYPING ===== */
#tankbot-typing { display: none; align-self: flex-start; }
#tankbot-typing.show { display: flex; }
.tankbot-typing-dots {
    background: #fff;
    border: 1px solid #32aee230;
    border-radius: 3px 14px 14px 14px;
    padding: 10px 14px;
    display: flex;
    gap: 4px;
    align-items: center;
}
.tankbot-typing-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
    animation: tb-bounce 1.2s infinite ease-in-out;
}
.tankbot-typing-dots span:nth-child(1) { background: #32aee2; }
.tankbot-typing-dots span:nth-child(2) { background: #e83439; animation-delay: 0.2s; }
.tankbot-typing-dots span:nth-child(3) { background: #fab833; animation-delay: 0.4s; }
@keyframes tb-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
}

/* ===== QUICK REPLY BUTTONS ===== */
.tankbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.tankbot-quick-btn {
    background: #ffffff;
    border: 1.5px solid #32aee2;
    border-radius: 30px;
    padding: 5px 11px;
    font-size: 11px;
    font-weight: 700;
    color: #32aee2;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.1s, border-color 0.15s;
    outline: none;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}
.tankbot-quick-btn:nth-child(2) { border-color: #e83439; color: #e83439; }
.tankbot-quick-btn:nth-child(3) { border-color: #fab833; color: #c48a00; }
.tankbot-quick-btn:nth-child(4) { border-color: #aacf47; color: #6a8a20; }
.tankbot-quick-btn:hover { transform: scale(1.04); opacity: 0.88; }
.tankbot-quick-btn:nth-child(1):hover { background: #32aee2; color: #fff; }
.tankbot-quick-btn:nth-child(2):hover { background: #e83439; color: #fff; }
.tankbot-quick-btn:nth-child(3):hover { background: #fab833; color: #fff; }
.tankbot-quick-btn:nth-child(4):hover { background: #aacf47; color: #fff; }
.tankbot-quick-btn:focus { outline: 2px solid #fab833; }

/* ===== INPUT AREA ===== */
#tankbot-input-area {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 10px;
    background: #ffffff;
    border-top: 1px solid #32aee220;
    flex-shrink: 0;
}
#tankbot-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #32aee250;
    border-radius: 20px;
    padding: 8px 13px;
    font-size: 12.5px;
    outline: none;
    background: #f4f8fd;
    color: #1a1a2e;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
    -webkit-appearance: none;
}
#tankbot-input:focus { border-color: #32aee2; background: #fff; }
#tankbot-input::placeholder { color: #aaaaaa; }

/* ===== SEND BUTTON ===== */
#tankbot-send {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #32aee2, #1a8fc2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    padding: 0;
    outline: none;
    box-shadow: 0 2px 8px rgba(50,174,226,0.4);
}
#tankbot-send:hover  { transform: scale(1.08); box-shadow: 0 4px 12px rgba(50,174,226,0.6); }
#tankbot-send:active { transform: scale(0.95); }
#tankbot-send:focus  { outline: 2px solid #fab833; }
#tankbot-send svg { width: 14px; height: 14px; fill: #fff; display: block; margin-left: 2px; pointer-events: none; }

/* ===== FOOTER ===== */
#tankbot-footer {
    text-align: center;
    padding: 3px 0 6px;
    font-size: 9.5px;
    color: #00000050;
    background: #ffffff;
    flex-shrink: 0;
}
#tankbot-footer a { color: #32aee2; text-decoration: none; font-weight: 600; }
#tankbot-footer a:hover { color: #e83439; }

/* ===== MOBILE ===== */
@media (max-width: 480px) {
    #tankbot-wrapper { bottom: 12px; right: 12px; }
    #tankbot-window  { width: calc(100vw - 24px); height: 72vh; border-radius: 12px; }
}
