/* ==========================================================================
   MINH ANH AI ASSISTANT - STYLING (Zalo / Messenger Realistic Experience)
   ========================================================================== */

/* 1. FLOATING ACTION BUTTON (TRIGGER) */
#minh-anh-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45), 0 2px 8px rgba(0, 0, 0, 0.15);
    background: #ffffff;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
}

#minh-anh-fab:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 12px 30px rgba(2, 132, 199, 0.55), 0 4px 10px rgba(0, 0, 0, 0.2);
}

#minh-anh-fab img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Online green blinking badge */
.minh-anh-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #22c55e;
    border: 2.5px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
    animation: minh-anh-pulse 2s infinite;
}

@keyframes minh-anh-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Floating tooltip badge */
.minh-anh-fab-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#minh-anh-fab:hover .minh-anh-fab-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(-4px);
}

/* 2. CHAT WINDOW (DRAGGABLE & RESIZABLE FEEL) */
#minh-anh-chat-box {
    position: fixed;
    bottom: 95px;
    right: 24px;
    width: 390px;
    height: 550px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 120px);
    z-index: 1000000;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.85);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    animation: minh-anh-slide-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes minh-anh-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header bar */
.minh-anh-header {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

.minh-anh-header-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.minh-anh-header-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.minh-anh-header-avatar .online-badge {
    position: absolute;
    bottom: 0px;
    right: 0px;
    width: 10px;
    height: 10px;
    background-color: #22c55e;
    border: 2px solid #ffffff;
    border-radius: 50%;
}

.minh-anh-header-titles {
    display: flex;
    flex-direction: column;
}

.minh-anh-header-name {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.minh-anh-header-status {
    font-size: 11px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.minh-anh-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.minh-anh-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s ease;
}

.minh-anh-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat body */
.minh-anh-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Suggestion chips bar: Single horizontal scrollable row right above input bar */
.minh-anh-chips-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-shrink: 0;
}

.minh-anh-chips-bar::-webkit-scrollbar {
    display: none;
}

.minh-anh-chips-label {
    font-size: 11px;
    font-weight: 600;
    color: #0284c7;
    white-space: nowrap;
    flex-shrink: 0;
}

.minh-anh-chip {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 4px 11px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.minh-anh-chip:hover {
    background: #e2e8f0;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* Message styling */
.minh-anh-msg {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 2px;
}

.minh-anh-msg.bot {
    align-self: flex-start;
    max-width: 88%;
}

.minh-anh-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 84%;
}

.minh-anh-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    margin-bottom: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.minh-anh-bubble {
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.55;
    word-break: break-word;
}

.minh-anh-msg.bot .minh-anh-bubble {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.minh-anh-msg.user .minh-anh-bubble {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

/* Typing Indicator */
.minh-anh-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.minh-anh-typing-dot {
    width: 6px;
    height: 6px;
    background: #0284c7;
    border-radius: 50%;
    animation: minh-anh-blink 1.4s infinite ease-in-out both;
}

.minh-anh-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.minh-anh-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes minh-anh-blink {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1.1); opacity: 1; }
}

/* Chat Footer / Input */
.minh-anh-footer {
    padding: 10px 12px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.minh-anh-input {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    background: #f8fafc;
}

.minh-anh-input:focus {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.minh-anh-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0284c7;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.minh-anh-send-btn:hover {
    background: #0369a1;
    transform: scale(1.05);
}

.minh-anh-send-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
}
