/* ── Ask Bud Widget ── */

#askbud-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
#askbud-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    border: none;
    border-radius: 50px;
    padding: 10px 18px 10px 6px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
#askbud-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.4);
}
.askbud-mascot-btn {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.askbud-toggle-label {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.3px;
}
.askbud-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #A8BD05;
    color: #1a2a00;
    font-size: 11px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Window */
#askbud-chat {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 360px;
    max-height: 540px;
    background: #0d1f0f;
    border: 1px solid rgba(168,189,5,0.25);
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#askbud-chat.askbud-closed {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
    pointer-events: none;
}
#askbud-chat.askbud-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.askbud-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.askbud-avatar {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.askbud-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.askbud-header-info strong {
    color: #A8BD05;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.2px;
}
.askbud-header-info span {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}
#askbud-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
#askbud-close:hover { background: rgba(255,255,255,0.2); }

/* Messages */
.askbud-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.askbud-messages::-webkit-scrollbar { width: 4px; }
.askbud-messages::-webkit-scrollbar-track { background: transparent; }
.askbud-messages::-webkit-scrollbar-thumb { background: rgba(168,189,5,0.3); border-radius: 2px; }

/* Message bubbles */
.askbud-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.askbud-msg-bud {
    background: rgba(46,125,50,0.25);
    border: 1px solid rgba(46,125,50,0.4);
    color: #e8f5e9;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.askbud-msg-user {
    background: #A8BD05;
    color: #1a2a00;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    font-weight: 600;
}

/* Typing indicator */
.askbud-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 14px;
    background: rgba(46,125,50,0.25);
    border: 1px solid rgba(46,125,50,0.4);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    width: fit-content;
}
.askbud-typing span {
    width: 7px;
    height: 7px;
    background: #A8BD05;
    border-radius: 50%;
    animation: askbud-bounce 1.2s infinite ease-in-out;
}
.askbud-typing span:nth-child(2) { animation-delay: 0.2s; }
.askbud-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes askbud-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40%            { transform: translateY(-6px); opacity: 1; }
}

/* Quick replies */
.askbud-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.2);
}
.askbud-qr {
    background: rgba(168,189,5,0.15);
    border: 1px solid rgba(168,189,5,0.4);
    color: #A8BD05;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.askbud-qr:hover {
    background: #A8BD05;
    color: #1a2a00;
}

/* Input row */
.askbud-input-row {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.25);
}
#askbud-input {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 8px 14px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
#askbud-input::placeholder { color: rgba(255,255,255,0.35); }
#askbud-input:focus { border-color: rgba(168,189,5,0.6); }
#askbud-send {
    background: #A8BD05;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #1a2a00;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
}
#askbud-send:hover {
    background: #c5d900;
    transform: scale(1.08);
}

/* Footer / Start Over */
.askbud-footer {
    text-align: center;
    padding: 6px 12px 8px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
}
#askbud-start-over {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
}
#askbud-start-over:hover {
    color: #A8BD05;
    background: rgba(168,189,5,0.1);
}

/* Thumbs feedback */
.askbud-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}
.askbud-thumb {
    cursor: pointer;
    font-size: 15px;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.15s;
}
.askbud-thumb:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Star rating screen */
.askbud-rating-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
}
.askbud-rating-avatar {
    font-size: 48px;
    margin-bottom: 12px;
}
.askbud-rating-title {
    font-size: 15px;
    color: #fff;
    margin-bottom: 20px;
    line-height: 1.5;
}
.askbud-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.askbud-star {
    font-size: 36px;
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
}
.askbud-star:hover,
.askbud-star-hover {
    color: #A8BD05;
    transform: scale(1.15);
}
.askbud-rating-skip a {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
}
.askbud-rating-skip a:hover {
    color: rgba(255,255,255,0.7);
}

/* Mobile */
@media (max-width: 480px) {
    #askbud-chat { width: calc(100vw - 32px); right: 0; }
    #askbud-widget { bottom: 16px; right: 16px; }
}
