/* TankBot Chatbot v3.1.0 — #f3fa12 yellow + #0b975d green */

/* ===== WRAPPER ===== */
#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: 54px;
    height: 54px;
    border-radius: 50%;
    background: #0b975d;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(11,151,93,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 20px rgba(11,151,93,0.6); }
#tankbot-toggle:focus { outline: 2px solid #f3fa12; 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: 320px;
    height: 460px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(11,151,93,0.18);
    overflow: hidden;
    margin-bottom: 10px;
    border: 1.5px solid #0b975d;
}
#tankbot-wrapper.open #tankbot-window {
    display: flex;
    animation: tb-slide-up 0.2s ease;
}
@keyframes tb-slide-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== HEADER ===== */
#tankbot-header {
    background: #0b975d;
    color: #ffffff;
    padding: 11px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0;
}
#tankbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
#tankbot-avatar svg { width: 18px; height: 18px; fill: #fff; display: block; }
#tankbot-header-info { flex: 1; min-width: 0; }
#tankbot-header-name  { font-size: 13px; font-weight: 700; color: #f3fa12; line-height: 1.2; }
#tankbot-header-status {
    font-size: 10px;
    color: rgba(255,255,255,0.88);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}
#tankbot-header-status::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #f3fa12;
    display: inline-block;
    flex-shrink: 0;
}

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

/* ===== MESSAGE ROWS ===== */
.tankbot-msg {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    max-width: 90%;
    animation: tb-pop 0.15s ease;
}
@keyframes tb-pop {
    from { opacity: 0; transform: scale(0.96); }
    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: 8px 11px;
    border-radius: 14px;
    font-size: 12.5px;
    line-height: 1.55;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}
.tankbot-msg.bot .tankbot-bubble {
    background: #ffffff;
    color: #0b3d25;
    border-radius: 3px 14px 14px 14px;
    border: 1px solid #0b975d25;
    box-shadow: 0 1px 3px rgba(11,151,93,0.09);
}
.tankbot-msg.user .tankbot-bubble {
    background: #0b975d;
    color: #ffffff;
    border-radius: 14px 3px 14px 14px;
}

/* ===== MINI AVATAR ===== */
.tankbot-msg-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0b975d;
    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 #0b975d25;
    border-radius: 3px 14px 14px 14px;
    padding: 9px 13px;
    display: flex;
    gap: 4px;
    align-items: center;
}
.tankbot-typing-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #0b975d;
    display: inline-block;
    animation: tb-bounce 1.2s infinite ease-in-out;
}
.tankbot-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.tankbot-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes tb-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
}

/* ===== QUICK REPLY BUTTONS — SMALL ===== */
.tankbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}
.tankbot-quick-btn {
    background: #f3fa12;
    border: 1.5px solid #d4e000;
    border-radius: 30px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    color: #1a4a00;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    outline: none;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}
.tankbot-quick-btn:hover {
    background: #0b975d;
    color: #f3fa12;
    border-color: #0b975d;
    transform: scale(1.03);
}
.tankbot-quick-btn:focus { outline: 2px solid #0b975d; }

/* ===== INPUT AREA ===== */
#tankbot-input-area {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 10px;
    background: #ffffff;
    border-top: 1px solid #0b975d20;
    flex-shrink: 0;
}
#tankbot-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #0b975d50;
    border-radius: 20px;
    padding: 7px 13px;
    font-size: 12.5px;
    outline: none;
    background: #f4fdf8;
    color: #0b3d25;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
    -webkit-appearance: none;
}
#tankbot-input:focus { border-color: #0b975d; background: #fff; }
#tankbot-input::placeholder { color: #5aaa80; }

/* ===== SEND BUTTON ===== */
#tankbot-send {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #0b975d;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
    outline: none;
}
#tankbot-send:hover  { background: #097a4b; transform: scale(1.07); }
#tankbot-send:active { transform: scale(0.95); }
#tankbot-send:focus  { outline: 2px solid #f3fa12; }
#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 5px;
    font-size: 9.5px;
    color: #0b975d80;
    background: #ffffff;
    flex-shrink: 0;
}

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