/**
 * BizCity WebChat Widget Styles
 * ChatGPT-like Refresh – Modern & Clean
 */

/* === Font & base === */
.bizcity-chat-embedded,
.bizcity-chat-embedded * {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    box-sizing: border-box;
}

/* === EMBEDDED CHAT CONTAINER === */
.bizcity-chat-embedded {
    position: relative !important;
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    height: 70vh !important;
    max-height: 90vh !important;
    margin: 16px auto;
    padding: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

.bizcity-chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
}

/* === CHAT HEADER === */
.bizcity-chat-header {
    background: #343541;
    color: #fff;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border: none;
    width: 100%;
}

.bizcity-chat-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.bizcity-chat-info h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.bizcity-chat-status {
    font-size: 11px;
    opacity: 0.8;
    color: #fff;
}

/* === MESSAGES AREA === */
.bizcity-chat-messages {
    flex: 1 1 auto;
    background: #f7f7f8;
    padding: 20px 16px;
    overflow-y: auto;
    scroll-behavior: smooth;
    width: 100%;
    text-align: left;
}

/* Scrollbar tinh gọn */
.bizcity-chat-messages::-webkit-scrollbar { width: 8px; }
.bizcity-chat-messages::-webkit-scrollbar-thumb { 
    background: rgba(0,0,0,0.15); 
    border-radius: 8px; 
}
.bizcity-chat-messages::-webkit-scrollbar-track { background: transparent; }

/* Message container */
.bizcity-message {
    margin: 8px 0;
    display: flex;
    width: 100%;
    animation: messageSlideIn 0.28s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* User messages - aligned right */
.bizcity-message-user {
    justify-content: flex-end;
}

/* Bot messages - aligned left */
.bizcity-message-bot {
    justify-content: flex-start;
}

/* Message bubbles */
.bizcity-message-content {
    display: inline-block;
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    line-height: 1.6;
    font-size: 14px;
    white-space: pre-wrap;
}

/* User bubble - ChatGPT green */
.bizcity-message-user .bizcity-message-content {
    background: #10a37f;
    color: #fff;
    border-radius: 14px 14px 2px 14px;
    box-shadow: 0 2px 12px rgba(16,163,127,0.22);
}

/* Bot bubble - White with border */
.bizcity-message-bot .bizcity-message-content {
    background: #ffffff;
    color: #111827;
    border-radius: 14px 14px 14px 2px;
    border: 1px solid #eef2f7;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

/* Typing indicator */
.bizcity-typing .bizcity-message-content {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 14px 14px 14px 2px;
    background: #ffffff;
    border: 1px solid #eef2f7;
}

.bizcity-typing .bizcity-message-content::after {
    content: '';
    display: flex;
    gap: 4px;
}

/* Typing dots animation */
.bizcity-typing-dot {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    display: inline-block;
    animation: typingBlink 1s infinite;
}

.bizcity-typing-dot:nth-child(2) { animation-delay: .15s; }
.bizcity-typing-dot:nth-child(3) { animation-delay: .3s; }

@keyframes typingBlink {
    0%, 80%, 100% { 
        opacity: .2; 
        transform: translateY(0); 
    }
    40% { 
        opacity: 1; 
        transform: translateY(-2px); 
    }
}

/* Error messages */
.bizcity-message-error .bizcity-message-content {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

/* Markdown/code styling in bot messages */
.bizcity-message-bot .bizcity-message-content pre,
.bizcity-message-bot .bizcity-message-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    background: rgba(11, 16, 33, 0.1);
    color: #0b1021;
    padding: 2px 6px;
    border-radius: 6px;
}

.bizcity-message-bot .bizcity-message-content pre {
    display: block;
    padding: 10px;
    overflow-x: auto;
}

/* === INPUT AREA === */
.bizcity-chat-input-area {
    position: relative;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* Attach button */
.bizcity-chat-attach-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111827;
    height: 38px;
    min-width: 38px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.04s ease-in-out;
}

.bizcity-chat-attach-btn:hover {
    background: #e9eef1;
    border-color: #dbe3ea;
}

.bizcity-chat-attach-btn:active {
    transform: translateY(1px);
}

.bizcity-chat-attach-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Textarea */
#bizcity-chat-input {
    width: 100%;
    min-height: 44px;
    max-height: 160px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    color: #111827;
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

#bizcity-chat-input:focus {
    background: #fff;
    border-color: #10a37f;
    box-shadow: 0 0 0 3px rgba(16,163,127,0.2);
}

/* Send button */
.bizcity-chat-send-btn {
    background: #10a37f;
    border: 1px solid #10a37f;
    color: #fff;
    height: 38px;
    min-width: 38px;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s, transform 0.04s ease-in-out;
}

.bizcity-chat-send-btn:hover {
    background: #0d8a6b;
    border-color: #0d8a6b;
}

.bizcity-chat-send-btn:active {
    transform: translateY(1px);
}

.bizcity-chat-send-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* === IMAGE PREVIEW === */
.bizcity-chat-preview {
    padding: 12px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.bizcity-image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bizcity-image-preview img {
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.bizcity-remove-image {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.bizcity-remove-image:hover {
    background: #dc2626;
}

/* === Mobile Responsive === */
@media (max-width: 640px) {
    .bizcity-chat-embedded {
        height: 75vh !important;
        border-radius: 12px;
    }
    
    .bizcity-chat-messages {
        padding: 14px 12px;
    }
    
    .bizcity-message-content {
        max-width: 100%;
    }
}

/* === Floating Chat (Coming soon) === */
.bizcity-chat-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    height: 500px;
    z-index: 9999;
}

/* === Popup Chat (Coming soon) === */
.bizcity-chat-popup {
    /* Popup styles */
}

