/* ── Nations Optics Chatbot Widget ─────────────────────────────────────── */

/* Bubble */
#no-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.45);
    z-index: 99990;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#no-chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 26px rgba(37, 99, 235, 0.55);
}

/* Panel */
#no-chat-panel {
    position: fixed;
    bottom: 90px;
    right: 24px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 110px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    z-index: 99991;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
#no-chat-panel.no-chat-open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

/* Header */
#no-chat-header {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
#no-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
#no-chat-avatar {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
#no-chat-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
}
#no-chat-status {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
    color: #86efac;
}
#no-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
#no-chat-close,
#no-chat-expand {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 18px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
#no-chat-close:hover,
#no-chat-expand:hover { color: #fff; }

/* Messages area */
#no-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
    scroll-behavior: smooth;
}
#no-chat-messages::-webkit-scrollbar { width: 4px; }
#no-chat-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* Message rows */
.no-chat-msg {
    display: flex;
    max-width: 88%;
}
.no-chat-msg.no-chat-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.no-chat-msg.no-chat-bot {
    align-self: flex-start;
}

/* Bubbles */
.no-chat-bubble {
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    word-break: break-word;
}
.no-chat-user .no-chat-bubble {
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.no-chat-bot .no-chat-bubble {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

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

/* Input area */
#no-chat-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    flex-shrink: 0;
}
#no-chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 22px;
    padding: 9px 14px;
    font-size: 13.5px;
    outline: none;
    background: #f8fafc;
    transition: border-color 0.18s;
    color: #1e293b;
}
#no-chat-input:focus {
    border-color: #2563eb;
    background: #fff;
}
#no-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2563eb;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s, transform 0.15s;
}
#no-chat-send:hover  { background: #1d4ed8; transform: scale(1.05); }
#no-chat-send:active { transform: scale(0.96); }
#no-chat-send:disabled { background: #94a3b8; cursor: not-allowed; transform: none; }

/* Upload (paperclip) button */
#no-chat-upload-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: none;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #64748b;
    transition: background 0.18s, color 0.18s;
}
#no-chat-upload-btn:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}
#no-chat-upload-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Expanded state */
#no-chat-panel.no-chat-expanded {
    width: min(680px, calc(100vw - 32px));
    height: min(780px, calc(100vh - 110px));
    transition: width 0.25s ease, height 0.25s ease, opacity 0.22s ease, transform 0.22s ease;
}

/* Mobile */
@media (max-width: 480px) {
    #no-chat-panel {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 75vh;
        border-radius: 20px 20px 0 0;
    }
    #no-chat-bubble {
        bottom: 16px;
        right: 16px;
    }
}
