/*
  Entity Chat — Easily Customizable
  Change the CSS variables below to restyle for any customer.
*/

:root {
    /* === CUSTOMIZE THESE === */
    --bg:            #0a0a12;
    --bg-card:       #1a1a2e;
    --accent:        #9333ea;       /* primary accent color */
    --accent-2:      #06b6d4;       /* secondary accent */
    --text:          #dde3f0;
    --text-dim:      #7e8da8;
    --text-bright:   #f0f4ff;
    --border:        rgba(255,255,255,0.07);
    --border-hover:  rgba(147,51,234,0.3);
    --radius:        12px;
    --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* ======================= */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 100%;
    max-width: 700px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.entity-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-bright);
}

.entity-status {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.msg {
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    line-height: 1.5;
    max-width: 80%;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.msg.user {
    background: var(--bg-card);
    margin-left: auto;
    border: 1px solid var(--border);
}

.msg.entity {
    background: linear-gradient(135deg, rgba(147,51,234,0.06), rgba(6,182,212,0.04));
    border: 1px solid var(--border-hover);
    margin-right: auto;
}

.msg.system {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
    max-width: 100%;
}

.input-row {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

#msg {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s;
}

#msg:focus { border-color: var(--accent); }

#send {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font);
    transition: opacity 0.15s;
}

#send:disabled { opacity: 0.5; cursor: not-allowed; }
#send:hover:not(:disabled) { opacity: 0.9; }

/* Typing dots */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-dim);
    animation: blink 1.4s infinite both;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100% { opacity: 0.3; } 40% { opacity: 1; } }

/* Scrollbar */
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Mobile */
@media (max-width: 600px) {
    .msg { max-width: 90%; }
    .chat-container { max-width: 100%; }
}
