/* ── LAUNCHER ─────────────────────────────────────────────────────────────── */
#ncb-launcher {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00c853, #009624);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99998;
    box-shadow: 0 4px 20px rgba(0,200,83,0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#ncb-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 26px rgba(0,200,83,0.55);
}
#ncb-launcher svg { pointer-events: none; }

.ncb-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #f44336;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    transition: transform 0.3s ease;
}
.ncb-badge.ncb-pulse {
    animation: ncb-pulse 1.2s infinite;
}
@keyframes ncb-pulse {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.3); }
}

/* ── WIDGET ───────────────────────────────────────────────────────────────── */
#ncb-widget {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 360px;
    max-height: 560px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 12px 50px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
#ncb-widget.ncb-open {
    opacity: 1;
    transform: translateY(0);
}
#ncb-widget.ncb-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
}

/* ── HEADER ───────────────────────────────────────────────────────────────── */
#ncb-header {
    background: linear-gradient(135deg, #00c853, #009624);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}
.ncb-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ncb-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
#ncb-header strong { display: block; font-size: 15px; }
.ncb-online { font-size: 11px; opacity: 0.9; }

#ncb-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: background 0.15s;
}
#ncb-close:hover { background: rgba(255,255,255,0.2); }

/* ── MESSAGES ─────────────────────────────────────────────────────────────── */
#ncb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#ncb-messages::-webkit-scrollbar { width: 4px; }
#ncb-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.ncb-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: ncb-fadein 0.2s ease;
}
@keyframes ncb-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ncb-bot {
    background: #fff;
    color: #222;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ncb-user {
    background: linear-gradient(135deg, #00c853, #009624);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

/* Typing indicator */
.ncb-typing {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    align-items: center;
}
.ncb-typing span {
    width: 7px;
    height: 7px;
    background: #aaa;
    border-radius: 50%;
    animation: ncb-bounce 1.2s infinite;
}
.ncb-typing span:nth-child(2) { animation-delay: 0.2s; }
.ncb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ncb-bounce {
    0%,80%,100% { transform: translateY(0); }
    40%          { transform: translateY(-6px); }
}

/* ── OPTIONS ──────────────────────────────────────────────────────────────── */
.ncb-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    align-self: flex-start;
    width: 100%;
}
.ncb-opt-btn {
    background: #fff;
    border: 1.5px solid #00c853;
    color: #00a846;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    display: inline-block;
}
.ncb-opt-btn:hover {
    background: #00c853;
    color: #fff;
}
.ncb-product-btn {
    background: #e8f5e9;
    border-color: #00c853;
    font-weight: 600;
    width: 100%;
    text-align: center;
}
.ncb-product-btn:hover {
    background: #00c853;
    color: #fff;
}
.ncb-wa-btn {
    background: #25D366;
    border-color: #25D366;
    color: #fff !important;
    font-weight: 700;
    width: 100%;
    text-align: center;
    font-size: 14px;
    padding: 10px 16px;
}
.ncb-wa-btn:hover {
    background: #1ebe5a;
    border-color: #1ebe5a;
}

/* ── INPUT AREA ───────────────────────────────────────────────────────────── */
#ncb-input-area {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid #eee;
    background: #fff;
    gap: 8px;
}
#ncb-input-area.ncb-hidden { display: none; }

#ncb-input {
    flex: 1;
    border: 1.5px solid #e0e0e0;
    border-radius: 22px;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
#ncb-input:focus { border-color: #00c853; }

#ncb-send {
    background: linear-gradient(135deg, #00c853, #009624);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
    flex-shrink: 0;
}
#ncb-send:hover { transform: scale(1.08); }

/* ── MOBILE ───────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    #ncb-widget {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 90px;
    }
    #ncb-launcher {
        right: 16px;
        bottom: 16px;
    }
}
