/* assets/style.css - WhatsApp-like Theme */
:root {
    --bg-page: #d1d7db;
    --bg-chat: #efeae2;
    --bg-header: #075e54;
    --bg-bot: #ffffff;
    --bg-user: #dcf8c6;
    --text-primary: #111b21;
    --text-secondary: #667781;
    --accent: #25d366;
    --danger: #ef4444;
    --border: #e9edef;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-page);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    color: var(--text-primary);
}

.app-container {
    width: 100%;
    max-width: 480px;
    background: var(--bg-chat);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Header */
.chat-header {
    background: var(--bg-header);
    color: #fff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 10;
}
.avatar {
    width: 38px; height: 38px;
    background: #fff;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 18px;
}
.info { flex: 1; }
.info .name { font-weight: 600; font-size: 16px; }
.info .status { font-size: 11px; opacity: 0.9; }
.menu-btn { font-size: 22px; padding: 8px; cursor: pointer; }

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scroll-behavior: smooth;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" viewBox="0 0 400 400"><rect fill="%23efeae2" width="400" height="400"/><path d="M0,0 L400,400 M400,0 L0,400" stroke="%23e6e0d9" stroke-width="1"/></svg>');
}

.message {
    max-width: 82%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; align-items: flex-end; }

.bubble {
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 14.5px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.bot .bubble {
    background: var(--bg-bot);
    border-top-left-radius: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.user .bubble {
    background: var(--bg-user);
    border-top-right-radius: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 3px;
    padding: 0 3px;
    text-align: right;
}

/* Input */
.chat-input {
    background: #f0f2f5;
    padding: 8px 10px;
    display: flex;
    gap: 6px;
    align-items: center;
    border-top: 1px solid var(--border);
}
.chat-input input {
    flex: 1;
    padding: 11px 14px;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    outline: none;
    background: #fff;
}
.chat-input button {
    background: var(--accent);
    color: #fff;
    border: none;
    width: 42px; height: 42px;
    border-radius: 50%;
    font-size: 17px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
}
.chat-input button:active { transform: scale(0.95); }
.chat-input button:disabled { opacity: 0.6; cursor: not-allowed; }

/* Utilities */
code {
    background: #f0f2f5;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 13px;
    font-family: monospace;
}
b { font-weight: 600; }
i { color: var(--text-secondary); }

/* Responsive */
@media (max-width: 480px) {
    .app-container { max-width: 100%; border-radius: 0; }
}