Rekt-Chat / css /styles.css
likhonsheikh's picture
Create css/styles.css
24c4a1c verified
raw
history blame
5.95 kB
:root {
/* Light theme */
--background: #ffffff;
--foreground: #11181C;
--muted: #687076;
--accent: #0070f3;
--border: #E6E8EB;
--ring: #22222210;
--surface: #fff;
--surface-hover: #f3f4f6;
--message-user: #ecfdf5;
--message-bot: #f5f5f5;
--shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.dark {
/* Dark theme */
--background: #000000;
--foreground: #FFFFFF;
--muted: #A1A1AA;
--accent: #3b82f6;
--border: #27272A;
--ring: #ffffff10;
--surface: #18181B;
--surface-hover: #27272A;
--message-user: #064e3b;
--message-bot: #18181B;
--shadow: 0 1px 2px 0 rgb(0 0 0 / 0.1);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
body {
background-color: var(--background);
color: var(--foreground);
line-height: 1.5;
transition: background-color 0.3s ease;
}
.app-container {
min-height: 100vh;
display: flex;
flex-direction: column;
}
.app-header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 50;
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--border);
background-color: rgba(var(--background), 0.8);
}
.header-content {
max-width: 1200px;
margin: 0 auto;
padding: 1rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.header-content h1 {
font-size: 1.5rem;
font-weight: 600;
display: flex;
align-items: center;
gap: 0.5rem;
}
.header-actions {
display: flex;
gap: 0.5rem;
}
.icon-button {
background: none;
border: none;
color: var(--foreground);
padding: 0.5rem;
border-radius: 0.5rem;
cursor: pointer;
transition: background-color 0.2s ease;
}
.icon-button:hover {
background-color: var(--surface-hover);
}
.chat-container {
flex: 1;
max-width: 1200px;
margin: 0 auto;
width: 100%;
padding: 5rem 1rem 1rem;
display: flex;
flex-direction: column;
}
.messages-container {
flex: 1;
overflow-y: auto;
padding: 1rem;
display: flex;
flex-direction: column;
gap: 1rem;
}
.welcome-message {
text-align: center;
padding: 2rem;
}
.welcome-message h2 {
font-size: 2rem;
font-weight: 600;
margin-bottom: 1rem;
}
.welcome-message p {
color: var(--muted);
}
.message {
max-width: 80%;
padding: 1rem;
border-radius: 0.75rem;
animation: message-slide 0.3s ease;
}
@keyframes message-slide {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.user-message {
background-color: var(--message-user);
align-self: flex-end;
border-bottom-right-radius: 0.25rem;
}
.bot-message {
background-color: var(--message-bot);
align-self: flex-start;
border-bottom-left-radius: 0.25rem;
}
.typing-indicator {
padding: 1rem;
}
.typing-bubble {
background-color: var(--message-bot);
padding: 1rem;
border-radius: 0.75rem;
border-bottom-left-radius: 0.25rem;
width: fit-content;
}
.dots {
display: flex;
gap: 0.25rem;
}
.dots span {
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background-color: var(--muted);
animation: bounce 1.4s infinite ease-in-out;
}
.dots span:nth-child(1) { animation-delay: -0.32s; }
.dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
0%, 80%, 100% { transform: scale(0); }
40% { transform: scale(1); }
}
.chat-input-container {
position: sticky;
bottom: 0;
padding: 1rem;
background-color: var(--background);
border-top: 1px solid var(--border);
}
.input-wrapper {
position: relative;
background-color: var(--surface);
border: 1px solid var(--border);
border-radius: 0.75rem;
padding: 0.75rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-wrapper:focus-within {
border-color: var(--accent);
box-shadow: 0 0 0 2px var(--ring);
}
#user-input {
background: none;
border: none;
color: var(--foreground);
font-size: 1rem;
resize: none;
max-height: 200px;
width: 100%;
}
#user-input:focus {
outline: none;
}
.input-actions {
display: flex;
justify-content: space-between;
align-items: center;
}
.char-counter {
font-size: 0.875rem;
color: var(--muted);
}
.send-button {
background-color: var(--accent);
color: white;
border: none;
border-radius: 0.5rem;
padding: 0.5rem 1rem;
cursor: pointer;
transition: opacity 0.2s ease;
}
.send-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.toast-container {
position: fixed;
bottom: 1rem;
right: 1rem;
display: flex;
flex-direction: column;
gap: 1rem;
z-index: 100;
}
.toast {
background-color: var(--surface);
border: 1px solid var(--border);
border-radius: 0.5rem;
padding: 1rem;
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.1);
animation: toast-slide 0.3s ease;
}
@keyframes toast-slide {
from {
opacity: 0;
transform: translateX(100%);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.toast.error {
border-left: 4px solid #ef4444;
}
.toast.success {
border-left: 4px solid #10b981;
}
.hidden {
display: none;
}
/* Media Queries for Responsiveness */
@media (max-width: 768px) {
.header-content h1 {
font-size: 1.25rem;
}
.welcome-message h2 {
font-size: 1.5rem;
}
.message {
max-width: 90%;
}
}
@media (max-width: 480px) {
.chat-container {
padding-top: 4rem;
}
.input-wrapper {
padding: 0.5rem;
}
.send-button {
padding: 0.5rem;
}
}