YousifCreates's picture
Add Flask TinyLlama chatbot
dcd94b8
/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #0a0a0f;
--surface: #111118;
--surface2: #1a1a24;
--border: #2a2a3a;
--accent: #7c6aff;
--accent2: #ff6a9b;
--text: #e8e8f0;
--text-muted:#7a7a9a;
--ai-bg: #13131e;
--user-bg: #1e1630;
--radius: 14px;
--font-ui: 'Syne', sans-serif;
--font-mono: 'IBM Plex Mono', monospace;
}
html, body {
height: 100%;
background: var(--bg);
color: var(--text);
font-family: var(--font-ui);
overflow: hidden;
}
/* ── Background Grid ──────────────────────────── */
.bg-grid {
position: fixed;
inset: 0;
background-image:
linear-gradient(var(--border) 1px, transparent 1px),
linear-gradient(90deg, var(--border) 1px, transparent 1px);
background-size: 40px 40px;
opacity: 0.25;
pointer-events: none;
z-index: 0;
}
/* ── App Layout ───────────────────────────────── */
.app-wrapper {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
height: 100vh;
max-width: 780px;
margin: 0 auto;
}
/* ── Header ───────────────────────────────────── */
.header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 28px;
border-bottom: 1px solid var(--border);
background: rgba(10,10,15,0.85);
backdrop-filter: blur(12px);
}
.header-left {
display: flex;
align-items: center;
gap: 14px;
}
.logo-mark {
display: flex;
flex-direction: column;
gap: 4px;
}
.logo-dot {
display: block;
width: 20px;
height: 4px;
border-radius: 2px;
background: var(--accent);
}
.logo-dot:nth-child(2) { width: 14px; background: var(--accent2); }
.logo-dot:nth-child(3) { width: 8px; opacity: 0.5; }
.header-title {
font-size: 1.25rem;
font-weight: 800;
letter-spacing: -0.02em;
line-height: 1;
}
.header-sub {
font-family: var(--font-mono);
font-size: 0.65rem;
color: var(--text-muted);
margin-top: 3px;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.status-badge {
display: flex;
align-items: center;
gap: 7px;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: 100px;
padding: 6px 14px;
}
.status-dot {
width: 7px;
height: 7px;
border-radius: 50%;
background: #4ade80;
box-shadow: 0 0 8px #4ade80;
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.4; }
}
.status-text {
font-family: var(--font-mono);
font-size: 0.7rem;
color: var(--text-muted);
letter-spacing: 0.08em;
text-transform: uppercase;
}
/* ── Chat Container ───────────────────────────── */
.chat-container {
flex: 1;
overflow-y: auto;
padding: 28px 24px;
display: flex;
flex-direction: column;
gap: 18px;
scroll-behavior: smooth;
}
.chat-container::-webkit-scrollbar { width: 4px; }
.chat-container::-webkit-scrollbar-track { background: transparent; }
.chat-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
/* ── Messages ─────────────────────────────────── */
.message {
display: flex;
gap: 12px;
animation: fadeUp 0.3s ease forwards;
opacity: 0;
}
@keyframes fadeUp {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.msg-avatar {
flex-shrink: 0;
width: 34px;
height: 34px;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font-mono);
font-size: 0.6rem;
font-weight: 500;
letter-spacing: 0.05em;
text-transform: uppercase;
}
.ai-message .msg-avatar {
background: linear-gradient(135deg, var(--accent), var(--accent2));
color: #fff;
}
.user-message {
flex-direction: row-reverse;
}
.user-message .msg-avatar {
background: var(--surface2);
border: 1px solid var(--border);
color: var(--text-muted);
}
.msg-body {
max-width: 75%;
padding: 13px 17px;
border-radius: var(--radius);
font-size: 0.92rem;
line-height: 1.65;
}
.ai-message .msg-body {
background: var(--ai-bg);
border: 1px solid var(--border);
border-top-left-radius: 4px;
}
.user-message .msg-body {
background: var(--user-bg);
border: 1px solid rgba(124,106,255,0.25);
border-top-right-radius: 4px;
color: #ccc8f8;
}
/* ── Typing Indicator ─────────────────────────── */
.typing-indicator .msg-body {
padding: 14px 18px;
}
.dots {
display: flex;
gap: 5px;
align-items: center;
height: 18px;
}
.dots span {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent);
animation: bounce 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) { animation-delay: 0.2s; background: var(--accent2); }
.dots span:nth-child(3) { animation-delay: 0.4s; opacity: 0.6; }
@keyframes bounce {
0%, 60%, 100% { transform: translateY(0); }
30% { transform: translateY(-6px); }
}
/* ── Input Area ───────────────────────────────── */
.input-area {
padding: 16px 24px 20px;
border-top: 1px solid var(--border);
background: rgba(10,10,15,0.9);
backdrop-filter: blur(12px);
}
.input-wrapper {
display: flex;
align-items: flex-end;
gap: 10px;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 10px 10px 10px 16px;
transition: border-color 0.2s;
}
.input-wrapper:focus-within {
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(124,106,255,0.12);
}
.chat-input {
flex: 1;
background: transparent;
border: none;
outline: none;
color: var(--text);
font-family: var(--font-ui);
font-size: 0.93rem;
line-height: 1.5;
resize: none;
max-height: 140px;
overflow-y: auto;
}
.chat-input::placeholder { color: var(--text-muted); }
.send-btn {
flex-shrink: 0;
width: 38px;
height: 38px;
border-radius: 10px;
border: none;
background: var(--accent);
color: #fff;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s, transform 0.1s;
}
.send-btn:hover { background: #9180ff; }
.send-btn:active { transform: scale(0.93); }
.send-btn:disabled {
background: var(--border);
cursor: not-allowed;
opacity: 0.6;
}
.footer-note {
font-family: var(--font-mono);
font-size: 0.62rem;
color: var(--text-muted);
text-align: center;
margin-top: 10px;
letter-spacing: 0.03em;
}