← back to B Version 1
web-interface/chat.css
823 lines
:root {
/* Simple, clean colors */
--bg: #ffffff;
--bg-elevated: #f8f9fa;
--bg-input: #f1f3f5;
--border-subtle: #e9ecef;
--assistant-bubble: #f8f9fa;
--user-bubble: #d4a574;
--text-main: #212529;
--text-muted: #6c757d;
--accent: #d4a574; /* Warm challah color */
--accent-hover: #e0b585;
--bubbe-gradient: #d4a574;
--radius-lg: 18px;
--radius-xl: 999px;
--shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.05);
--header-height: 56px;
--input-height: 60px;
--safe-top: env(safe-area-inset-top, 0px);
--safe-bottom: env(safe-area-inset-bottom, 0px);
}
*,
*::before,
*::after {
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
height: 100%;
background: #ffffff;
color: var(--text-main);
font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
"Helvetica Neue", sans-serif;
}
/* Desktop background gradient */
@media (min-width: 600px) {
body {
background: linear-gradient(135deg, #fef9f3 0%, #fff5eb 50%, #fef3e8 100%);
}
}
body {
overscroll-behavior: none;
}
/* App shell */
.chat-app {
position: relative;
max-width: 480px;
margin: 0 auto;
height: 100vh;
background: #ffffff;
display: flex;
flex-direction: column;
color: var(--text-main);
}
/* Header */
.chat-header {
height: var(--header-height);
padding: 8px 12px;
padding-top: calc(8px + var(--safe-top));
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid var(--border-subtle);
background: #ffffff;
position: sticky;
top: 0;
z-index: 10;
}
.chat-header-left {
display: flex;
align-items: center;
gap: 10px;
}
.chat-avatar {
width: 28px;
height: 28px;
border-radius: 999px;
background: var(--bubbe-gradient);
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
}
.chat-title {
font-size: 14px;
font-weight: 600;
color: var(--text-main);
}
.chat-status {
display: flex;
align-items: center;
gap: 4px;
font-size: 11px;
color: var(--text-muted);
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 999px;
background: #d4a574;
box-shadow: 0 0 0 4px rgba(212, 165, 116, 0.18);
}
.chat-header-btn {
border: none;
background: transparent;
color: var(--text-muted);
font-size: 20px;
padding: 4px 6px;
border-radius: 999px;
cursor: pointer;
transition: background 0.2s;
}
.chat-header-btn:hover {
background: var(--bg-elevated);
}
/* Messages area */
.chat-main {
flex: 1;
overflow-y: auto;
padding: 12px 10px 12px;
padding-bottom: calc(12px + var(--input-height));
}
/* Hide scrollbars on mobile */
.chat-main::-webkit-scrollbar {
width: 6px;
}
.chat-main::-webkit-scrollbar-track {
background: transparent;
}
.chat-main::-webkit-scrollbar-thumb {
background: rgba(212, 165, 116, 0.2);
border-radius: 999px;
}
.chat-main::-webkit-scrollbar-thumb:hover {
background: rgba(212, 165, 116, 0.3);
}
/* Message rows */
.msg-row {
display: flex;
margin-bottom: 16px;
animation: slideIn 0.3s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.msg-avatar {
width: 26px;
height: 26px;
border-radius: 999px;
background: var(--bubbe-gradient);
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
margin-right: 6px;
flex-shrink: 0;
}
.msg-bubble {
max-width: 80%;
padding: 10px 13px;
border-radius: var(--radius-lg);
font-size: 14px;
line-height: 1.5;
box-shadow: var(--shadow-soft);
}
/* Assistant messages - Bubbe's warm wisdom */
.msg-assistant .msg-bubble {
background: var(--assistant-bubble);
border-bottom-left-radius: 4px;
border: 1px solid var(--border-subtle);
}
.msg-assistant .msg-bubble strong {
color: var(--accent);
}
/* User messages */
.msg-user {
justify-content: flex-end;
}
.msg-user .msg-bubble {
background: var(--user-bubble);
border-bottom-right-radius: 4px;
margin-left: 40px;
color: #ffffff;
}
.msg-user .msg-avatar {
display: none;
}
/* Message text and meta */
.msg-bubble p {
margin: 0 0 6px;
}
.msg-bubble p:last-of-type {
margin-bottom: 8px;
}
.msg-meta {
display: block;
font-size: 10px;
color: var(--text-muted);
opacity: 0.7;
}
/* Typing indicator */
.typing {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 8px 12px;
}
.typing-dot {
width: 6px;
height: 6px;
border-radius: 999px;
background: var(--accent);
opacity: 0.6;
animation: typing 1s infinite ease-in-out;
}
.typing-dot:nth-child(2) {
animation-delay: 0.15s;
}
.typing-dot:nth-child(3) {
animation-delay: 0.3s;
}
@keyframes typing {
0%,
80%,
100% {
transform: translateY(0);
opacity: 0.4;
}
40% {
transform: translateY(-3px);
opacity: 1;
}
}
/* Input bar */
.chat-input-bar {
position: fixed;
left: 50%;
bottom: 0;
transform: translateX(-50%);
max-width: 480px;
width: 100%;
padding: 8px 10px;
padding-bottom: calc(8px + var(--safe-bottom));
background: #ffffff;
border-top: 1px solid var(--border-subtle);
display: flex;
align-items: flex-end;
gap: 6px;
}
.icon-btn {
width: 44px;
height: 44px;
border-radius: var(--radius-xl);
border: none;
background: transparent;
color: var(--text-muted);
font-size: 18px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: background 0.2s;
}
.icon-btn:hover:not([style*="cursor: not-allowed"]) {
background: var(--bg-elevated);
}
.input-wrapper {
flex: 1;
background: var(--bg-input);
border-radius: 999px;
padding: 8px 12px;
border: 1px solid var(--border-subtle);
display: flex;
align-items: center;
transition: border-color 0.2s;
}
.input-wrapper:focus-within {
border-color: var(--accent);
}
.input-wrapper textarea {
width: 100%;
resize: none;
border: none;
outline: none;
background: transparent;
color: var(--text-main);
font-size: 16px;
max-height: 80px;
font-family: inherit;
-webkit-appearance: none;
appearance: none;
}
.input-wrapper textarea::placeholder {
color: var(--text-muted);
}
.send-btn {
width: 44px;
height: 44px;
border-radius: 999px;
border: none;
background: var(--accent);
display: flex;
align-items: center;
justify-content: center;
color: #ffffff;
font-size: 18px;
margin-left: 2px;
cursor: pointer;
transition: all 0.2s;
}
.send-btn:hover {
background: var(--accent-hover);
transform: scale(1.05);
}
.send-btn:active {
transform: scale(0.95);
}
.send-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
box-shadow: none;
}
/* Desktop & Tablet Improvements */
@media (min-width: 600px) {
.chat-app {
max-width: 900px;
border-radius: 24px;
margin: 20px auto;
overflow: hidden;
height: calc(100vh - 40px);
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
border: 1px solid var(--border-subtle);
}
.chat-header {
height: 72px;
padding: 16px 24px;
border-bottom: 1px solid var(--border-subtle);
}
.chat-avatar {
width: 40px;
height: 40px;
font-size: 24px;
}
.chat-title {
font-size: 18px;
font-weight: 700;
}
.chat-status {
font-size: 13px;
}
.chat-main {
padding: 24px 32px;
padding-bottom: calc(24px + var(--input-height) + 20px);
}
.chat-main::-webkit-scrollbar {
width: 8px;
}
.msg-row {
margin-bottom: 24px;
}
.msg-avatar {
width: 36px;
height: 36px;
font-size: 18px;
margin-right: 12px;
}
.msg-bubble {
max-width: 65%;
padding: 14px 18px;
font-size: 15px;
line-height: 1.6;
border-radius: 20px;
}
.msg-assistant .msg-bubble {
border-bottom-left-radius: 6px;
}
.msg-user .msg-bubble {
border-bottom-right-radius: 6px;
margin-left: 80px;
}
.msg-meta {
font-size: 11px;
}
.chat-input-bar {
max-width: 900px;
padding: 16px 24px;
padding-bottom: calc(16px + var(--safe-bottom));
border-radius: 0 0 24px 24px;
gap: 12px;
}
.icon-btn {
width: 36px;
height: 36px;
font-size: 18px;
}
.input-wrapper {
padding: 12px 18px;
border-radius: 24px;
}
.input-wrapper textarea {
font-size: 15px;
max-height: 120px;
}
.send-btn {
width: 40px;
height: 40px;
font-size: 18px;
}
.mode-selector {
max-width: 500px;
border-radius: 20px;
padding: 12px;
bottom: 95px;
}
.mode-option {
padding: 16px;
border-radius: 14px;
}
.mode-option-icon {
width: 48px;
height: 48px;
font-size: 28px;
border-radius: 12px;
}
.mode-option-title {
font-size: 15px;
}
.mode-option-desc {
font-size: 13px;
}
.breaking-news-banner {
padding: 16px 24px;
}
.breaking-news-header {
font-size: 13px;
margin-bottom: 10px;
}
.breaking-news-item {
font-size: 14px;
padding: 8px 12px;
}
}
/* Large Desktop */
@media (min-width: 1200px) {
.chat-app {
max-width: 1100px;
}
.chat-input-bar {
max-width: 1100px;
}
.msg-bubble {
max-width: 60%;
font-size: 16px;
}
.chat-main {
padding: 28px 48px;
}
.mode-selector {
max-width: 600px;
}
}
/* Error state */
.msg-error {
background: #fee2e2 !important;
border: 1px solid #fecaca !important;
}
.msg-error p {
color: #991b1b !important;
}
/* Mode Selector Popup */
.mode-selector {
position: fixed;
bottom: 75px;
left: 50%;
transform: translateX(-50%);
max-width: 440px;
width: calc(100% - 40px);
background: #ffffff;
border: 1px solid var(--border-subtle);
border-radius: 16px;
padding: 8px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
z-index: 100;
animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateX(-50%) translateY(10px);
}
to {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
}
.mode-option {
display: flex;
align-items: center;
gap: 12px;
padding: 12px;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
margin-bottom: 4px;
}
.mode-option:last-child {
margin-bottom: 0;
}
.mode-option:hover {
background: var(--bg-elevated);
}
.mode-option:active {
transform: scale(0.98);
}
.mode-option-icon {
width: 40px;
height: 40px;
font-size: 24px;
display: flex;
align-items: center;
justify-content: center;
background: var(--bg-elevated);
border-radius: 10px;
flex-shrink: 0;
}
.mode-option-info {
flex: 1;
}
.mode-option-title {
font-size: 14px;
font-weight: 600;
color: var(--text-main);
margin-bottom: 2px;
}
.mode-option-desc {
font-size: 12px;
color: var(--text-muted);
}
/* Mode Indicator */
.mode-indicator {
display: none;
}
.mode-badge {
display: inline-block;
padding: 3px 8px;
font-size: 10px;
font-weight: 600;
color: #000;
background: var(--accent);
border-radius: 999px;
box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Mode button styling */
.mode-btn {
font-size: 18px !important;
opacity: 1 !important;
cursor: pointer !important;
}
.mode-btn:hover {
background: var(--bg-elevated) !important;
}
.mode-btn:active {
transform: scale(0.95);
}
/* System messages */
.msg-system {
justify-content: center;
margin: 8px 0;
}
.msg-system-bubble {
background: rgba(212, 165, 116, 0.1) !important;
border: 1px solid rgba(212, 165, 116, 0.2);
padding: 8px 12px !important;
text-align: center;
font-size: 12px;
color: var(--accent);
max-width: 90%;
box-shadow: none !important;
}
.msg-system-bubble p {
margin: 0 !important;
}
/* Input wrapper positioning for mode indicator */
.input-wrapper {
position: relative;
}
/* Mobile adjustments */
@media (max-width: 480px) {
.mode-selector {
width: calc(100% - 20px);
bottom: 70px;
}
.mode-option {
padding: 10px;
}
.mode-option-icon {
width: 36px;
height: 36px;
font-size: 20px;
}
}
/* Share button */
.share-btn {
background: transparent;
border: none;
font-size: 14px;
cursor: pointer;
padding: 2px 6px;
margin-left: 8px;
border-radius: 4px;
transition: all 0.2s;
vertical-align: middle;
}
.share-btn:hover {
background: rgba(0, 0, 0, 0.05);
transform: scale(1.1);
}
.share-btn:active {
transform: scale(0.95);
}
@media (max-width: 768px) {
.share-btn {
font-size: 16px;
padding: 4px 8px;
}
}
/* Breaking News Banner */
.breaking-news-banner {
background: linear-gradient(135deg, #c41e3a 0%, #8b0000 100%);
color: white;
padding: 12px 16px;
border-bottom: 2px solid #8b0000;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.breaking-news-header {
display: flex;
align-items: center;
gap: 8px;
font-weight: bold;
font-size: 12px;
letter-spacing: 0.5px;
margin-bottom: 8px;
}
.breaking-news-icon {
font-size: 16px;
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
.breaking-news-items {
display: flex;
flex-direction: column;
gap: 6px;
}
.breaking-news-item {
font-size: 13px;
line-height: 1.4;
padding: 6px 8px;
background: rgba(255, 255, 255, 0.1);
border-radius: 4px;
border-left: 3px solid white;
cursor: pointer;
transition: background 0.2s ease;
}
.breaking-news-item:hover {
background: rgba(255, 255, 255, 0.2);
}
.breaking-news-loading {
font-size: 13px;
opacity: 0.8;
font-style: italic;
}
/* Adjust chat main to account for breaking news */
.chat-main {
padding-top: 12px;
}