Soma / frontend /src /components /ChatPanel.css
Komalpreet Kaur
UI: Add responsive layout and update Knowledge Graph aesthetic
4b3e76d unverified
/* ChatPanel.css - Final Refinements for Page 1 */
.chat-interface {
display: flex;
flex-direction: column;
height: 100%;
}
.chat-messages {
flex: 1;
overflow-y: auto;
padding-right: 12px;
display: flex;
flex-direction: column;
gap: 16px;
scrollbar-width: thin;
scrollbar-color: rgba(0,0,0,0.05) transparent;
}
/* ── Custom Scrollbar (Subtle) ── */
.chat-messages::-webkit-scrollbar {
width: 4px;
}
.chat-messages::-webkit-scrollbar-track {
background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.05);
border-radius: 10px;
transition: background-color 0.3s;
}
.chat-messages:hover::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.1);
}
.chat-bubble-group {
display: flex;
gap: 20px;
max-width: 85%;
align-items: flex-start;
}
.chat-bubble-group.user {
align-self: flex-end;
flex-direction: row-reverse;
}
.chat-bubble-group.soma {
align-self: flex-start;
}
.chat-bubble-group.user .bubble-body {
background-color: #fcfcfc;
border-bottom-right-radius: 4px;
text-align: right;
}
.chat-bubble-group.soma .bubble-body {
border-bottom-left-radius: 4px;
}
.avatar-wrap {
flex-shrink: 0;
}
.bubble-header {
display: none;
}
.chat-avatar {
width: 28px;
height: 28px;
flex-shrink: 0;
border-radius: 50%;
background-color: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.chat-avatar img {
width: 100%;
height: 100%;
object-fit: cover;
}
.chat-avatar .material-icons {
font-size: 16px;
color: #888;
}
.bubble-body {
background-color: white; /* Clearer white for premium look */
padding: 16px 20px;
border-radius: 24px;
position: relative;
box-shadow: 0 4px 20px rgba(0,0,0,0.02);
border: 1px solid rgba(255, 255, 255, 0.8);
}
.bubble-meta {
margin-bottom: 4px;
}
.bubble-meta strong {
font-size: 0.7rem;
font-weight: 700;
color: #1a1a1a;
letter-spacing: -0.01em;
}
.bubble-text {
font-size: 0.8rem;
line-height: 1.6;
color: #444;
white-space: pre-wrap;
}
.bubble-time {
margin-top: 6px;
font-size: 0.7rem;
color: #bbb;
font-weight: 500;
}
.chat-bubble-group.user .bubble-time {
text-align: right;
}
/* ── Input Row ── */
.chat-input-row {
display: flex;
gap: 10px;
align-items: center;
margin-top: 24px;
}
.input-field-wrap {
flex: 1;
background-color: white;
border: 1px solid rgba(0,0,0,0.04);
box-shadow: 0 4px 15px rgba(0,0,0,0.02);
border-radius: 14px;
padding: 0 16px;
display: flex;
align-items: center;
height: 48px;
transition: all 0.2s;
}
.input-field-wrap:focus-within {
border-color: rgba(255, 107, 53, 0.3);
box-shadow: 0 4px 20px rgba(255, 107, 53, 0.05);
}
.input-field-wrap input {
flex: 1;
background: transparent;
border: none;
outline: none;
font-size: 0.85rem;
color: #1a1a1a;
font-weight: 500;
}
.new-chat-btn {
background: white;
border: 1px solid rgba(0,0,0,0.05);
width: 48px;
height: 48px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: #666;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.new-chat-btn:hover {
background: #f8f8f8;
color: #ff6b35;
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.new-chat-btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
.input-field-wrap input::placeholder {
color: #aaa;
}
.send-btn {
width: 48px;
height: 48px;
background-color: #ff6b35;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
color: white;
transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
box-shadow: 0 10px 25px rgba(255, 107, 53, 0.2);
}
.send-btn:hover:not(:disabled) {
transform: translateY(-2px);
box-shadow: 0 14px 30px rgba(255, 107, 53, 0.3);
}
.send-btn:active:not(:disabled) {
transform: scale(0.95);
}
.send-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
filter: grayscale(0.5);
}
.send-btn .material-icons {
font-size: 24px;
}
/* ── Typing Indicator ── */
.typing-dots {
display: flex;
gap: 5px;
padding: 4px 0;
}
.typing-dots span {
width: 7px;
height: 7px;
background-color: #ccc;
border-radius: 50%;
animation: typing 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
0%, 100% { opacity: 0.3; transform: scale(0.8); }
50% { opacity: 1; transform: scale(1.1); }
}
/* ── Welcome State ── */
.welcome-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
text-align: center;
padding: 40px;
opacity: 0.6;
}
.welcome-icon {
width: 64px;
height: 64px;
background: white;
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 24px;
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.welcome-icon span {
font-size: 32px;
color: #1a1a1a;
}
.welcome-state h3 {
font-size: 1rem;
font-weight: 700;
color: #1a1a1a;
margin-bottom: 12px;
}
.welcome-state p {
font-size: 0.75rem;
color: #999;
max-width: 200px;
line-height: 1.5;
margin-bottom: 32px;
}
.suggested-starters {
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;
max-width: 240px;
}
.suggested-starters button {
background: white;
border: 1px solid rgba(0,0,0,0.05);
padding: 12px 16px;
border-radius: 12px;
font-size: 0.7rem;
color: #555;
text-align: left;
transition: all 0.2s;
cursor: pointer;
}
.suggested-starters button:hover {
background: #fdfdfd;
border-color: rgba(255, 107, 53, 0.2);
color: #ff6b35;
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
/* ── Responsive Overrides ── */
@media (max-width: 768px) {
.chat-bubble-group {
max-width: 95% !important;
gap: 12px !important;
}
.bubble-body {
padding: 12px 16px !important;
}
.chat-input-row {
margin-top: 16px !important;
}
.input-field-wrap {
padding: 0 12px !important;
height: 44px !important;
}
.new-chat-btn, .send-btn {
width: 44px !important;
height: 44px !important;
}
}