/* ===== NGT AI Chatbot Widget ===== */
.chatbot-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), #b8941f);
    border: none;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 20px rgba(201,168,76,0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fabPulse 3s ease-in-out infinite;
}
.chatbot-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(201,168,76,0.6);
}
.chatbot-fab .notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    background: #ff4444;
    border-radius: 50%;
    border: 2px solid #111;
    display: none;
}
@keyframes fabPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(201,168,76,0.4); }
    50% { box-shadow: 0 4px 30px rgba(201,168,76,0.7); }
}

/* Chat Panel */
.chatbot-panel {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    max-height: 560px;
    background: #111;
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 16px;
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 50px rgba(0,0,0,0.7);
    animation: chatSlideUp 0.3s ease;
}
.chatbot-panel.open {
    display: flex;
}
@keyframes chatSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 500px) {
    .chatbot-panel {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 80px;
        max-height: 70vh;
    }
}

/* Header */
.cb-header {
    background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(201,168,76,0.05));
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(201,168,76,0.15);
}
.cb-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cb-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), #8a7020);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.cb-header-text h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #fff;
}
.cb-header-text span {
    font-size: 0.72rem;
    color: var(--accent-gold);
}
.cb-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}
.cb-close:hover { color: #fff; }

/* Messages */
.cb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 350px;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,168,76,0.3) transparent;
}
.cb-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    animation: msgFade 0.3s ease;
}
@keyframes msgFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.cb-msg-bot {
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.12);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #ddd;
}
.cb-msg-user {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: #fff;
}
.cb-msg-system {
    background: rgba(85,255,85,0.06);
    border: 1px solid rgba(85,255,85,0.12);
    align-self: center;
    text-align: center;
    font-size: 0.78rem;
    color: #88cc88;
    max-width: 95%;
}

/* Typing indicator */
.cb-typing {
    display: none;
    align-self: flex-start;
    padding: 10px 18px;
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.12);
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}
.cb-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--accent-gold);
    border-radius: 50%;
    margin: 0 2px;
    animation: typingDot 1.4s infinite;
}
.cb-typing span:nth-child(2) { animation-delay: 0.2s; }
.cb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* Input */
.cb-input-area {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.3);
}
.cb-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}
.cb-input:focus {
    border-color: rgba(201,168,76,0.4);
}
.cb-send {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--accent-gold);
    color: #111;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cb-send:hover { background: #d4af37; }

/* Human support button */
.cb-human-btn {
    display: block;
    width: calc(100% - 28px);
    margin: 0 14px 12px;
    padding: 10px;
    border-radius: 8px;
    border: 1px dashed rgba(201,168,76,0.3);
    background: rgba(201,168,76,0.04);
    color: var(--accent-gold);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
}
.cb-human-btn:hover {
    background: rgba(201,168,76,0.1);
    border-color: var(--accent-gold);
}
