/* Support chat widget */
.chat-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #8b5cf6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    z-index: 1000;
    transition: transform 0.2s;
}
.chat-btn:active { transform: scale(0.92); }
.chat-btn svg { width: 24px; height: 24px; fill: #fff; }

.chat-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #0f172a;
    display: none;
}
.chat-btn .badge.visible { display: block; }

/* Chat panel */
.chat-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60vh;
    max-height: 480px;
    background: #0f172a;
    border-top: 1px solid #1e293b;
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.chat-panel.open { transform: translateY(0); }

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
}
.chat-header-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.chat-header-status {
    font-size: 11px;
    color: #94a3b8;
}
.chat-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-greeting {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    padding: 24px 16px;
    line-height: 1.6;
}

.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}
.chat-msg.visitor {
    align-self: flex-end;
    background: #8b5cf6;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg.support {
    align-self: flex-start;
    background: #1e293b;
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}

.chat-msg-time {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}
.chat-msg.support .chat-msg-time { color: #64748b; }

.chat-status-msg {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    padding: 4px 0;
}

.chat-waiting {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 8px 0;
    font-style: italic;
}

/* Input area */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #1e293b;
    flex-shrink: 0;
}
.chat-input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px 12px;
    color: #e2e8f0;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    max-height: 80px;
}
.chat-input::placeholder { color: #64748b; }
.chat-input:focus { border-color: #8b5cf6; }

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #8b5cf6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.chat-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-send-btn svg { width: 18px; height: 18px; fill: #fff; }

/* Overlay behind panel on mobile */
.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
}
.chat-overlay.visible { display: block; }
