Chatty / static /css /style.css
findEthics
Add clear chat functionality with redesigned UX
410a397
Raw
History Blame Contribute Delete
16.7 kB
/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
height: 100%;
overflow: hidden;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background-color: white;
color: black;
line-height: 1.6;
height: 100%;
overflow: hidden;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Container */
.container {
width: 100%;
max-width: 100%;
margin: 0;
height: 100vh;
height: 100dvh;
/* Dynamic viewport height for mobile */
display: flex;
flex-direction: column;
background-color: white;
position: relative;
}
/* Desktop styles */
@media (min-width: 769px) {
.container {
max-width: 800px;
margin: 0 auto;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
height: 100vh;
}
}
/* Header */
.header {
background-color: black;
color: white;
padding: 0.75rem 1rem;
text-align: left;
border-bottom: 2px solid black;
flex-shrink: 0;
position: relative;
z-index: 10;
min-height: 50px; /* Ensure consistent height */
}
/* Removed hamburger menu and mobile navigation drawer - not needed */
.header-content {
max-width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
height: 100%;
white-space: nowrap;
}
/* Header title */
.header-title {
flex: 0 0 auto;
text-align: left;
}
.header-title h1 {
font-size: 1.25rem;
margin: 0;
font-weight: 600;
}
/* Header navigation */
.header-nav {
display: flex;
align-items: center;
gap: 0.25rem;
flex-shrink: 0;
}
/* Mobile/Desktop visibility helpers */
.desktop-only {
display: inline;
}
.mobile-only {
display: none;
}
@media (max-width: 768px) {
.desktop-only {
display: none;
}
.mobile-only {
display: inline;
}
}
/* Desktop header styles */
@media (min-width: 769px) {
.header {
padding: 1rem 2rem;
}
.header-title h1 {
font-size: 2rem;
}
}
/* Main content area from base template */
.main-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
}
/* Chat container */
.chat-container {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
min-height: 0;
/* Important for flex child to shrink */
}
/* Chat messages */
.chat-messages {
flex: 1;
padding: 0.75rem;
overflow-y: auto;
background-color: white;
-webkit-overflow-scrolling: touch;
/* Smooth scrolling on iOS */
overscroll-behavior: contain;
}
.message {
margin-bottom: 0.75rem;
display: flex;
align-items: flex-start;
}
.message.user {
justify-content: flex-end;
}
.message.assistant {
justify-content: flex-start;
}
.message-content {
max-width: 85%;
padding: 0.75rem 1rem;
border-radius: 1.5rem;
word-wrap: break-word;
word-break: break-word;
line-height: 1.4;
font-size: 0.9rem;
}
.message.user .message-content {
background-color: black;
color: white;
border-bottom-right-radius: 0.5rem;
}
.message.assistant .message-content {
background-color: white;
color: black;
border: 2px solid black;
border-bottom-left-radius: 0.5rem;
}
/* Animations removed for minimal design */
/* Desktop message styles */
@media (min-width: 769px) {
.chat-messages {
padding: 1rem 2rem;
}
.message {
margin-bottom: 1rem;
}
.message-content {
max-width: 70%;
padding: 0.75rem 1rem;
font-size: 1rem;
}
}
/* Chat input */
.chat-input-container {
padding: 0.75rem;
background-color: white;
border-top: 2px solid black;
flex-shrink: 0;
position: relative;
z-index: 10;
/* Handle safe area for devices with notches */
padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}
.chat-form {
width: 100%;
}
.input-group {
display: flex;
gap: 0.5rem;
align-items: flex-end;
}
#messageInput {
flex: 1;
padding: 0.75rem 1rem;
border: 2px solid black;
border-radius: 1.5rem;
font-size: 1rem;
outline: none;
background-color: white;
color: black;
resize: none;
min-height: 48px;
/* Minimum touch target size */
max-height: 120px;
line-height: 1.4;
font-family: inherit;
-webkit-appearance: none;
appearance: none;
overflow-y: auto;
vertical-align: top;
/* Prevent iOS zoom */
-webkit-text-size-adjust: 100%;
/* Smooth scrolling */
-webkit-overflow-scrolling: touch;
}
#messageInput:focus {
border-color: black;
}
#sendButton {
padding: 0.75rem 1.25rem;
background-color: black;
color: white;
border: 2px solid black;
border-radius: 2rem;
font-size: 0.9rem;
cursor: pointer;
white-space: nowrap;
min-height: 48px;
/* Minimum touch target size */
min-width: 48px;
display: flex;
align-items: center;
justify-content: center;
-webkit-tap-highlight-color: transparent;
}
#sendButton:hover {
background-color: white;
color: black;
}
#sendButton:disabled {
background-color: white;
color: black;
border: 1px solid black;
opacity: 0.5;
cursor: not-allowed;
}
/* Desktop input styles */
@media (min-width: 769px) {
.chat-input-container {
padding: 1rem 2rem;
padding-bottom: 1rem;
}
#messageInput {
border-radius: 1.5rem;
}
#sendButton {
padding: 0.75rem 1.5rem;
border-radius: 1.5rem;
font-size: 1rem;
}
}
/* Anonymous info banner */
.anonymous-info-banner {
background-color: rgb(245, 245, 245);
color: rgb(100, 100, 100);
padding: 0.75rem 1rem;
display: flex;
align-items: flex-start;
gap: 0.5rem;
font-size: 0.9rem;
border-bottom: 1px solid rgb(220, 220, 220);
}
.anonymous-info-banner .info-icon {
font-size: 1.1rem;
color: rgb(120, 120, 120);
margin-top: 0.125rem;
}
.anonymous-info-banner .info-content {
flex: 1;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.anonymous-info-banner .info-text {
line-height: 1.5;
}
.anonymous-info-banner strong {
color: rgb(80, 80, 80);
font-weight: 600;
}
.anonymous-info-banner .banner-link {
color: black;
text-decoration: underline;
font-weight: 500;
}
.anonymous-info-banner .banner-link:hover {
text-decoration: none;
}
.anonymous-info-banner .message-counter {
background-color: white;
padding: 0.25rem 0.75rem;
border-radius: 1rem;
border: 1px solid rgb(200, 200, 200);
font-size: 0.85rem;
white-space: nowrap;
width: fit-content;
}
.anonymous-info-banner #messagesUsed {
font-weight: 600;
color: black;
}
/* Mobile adjustments for info banner */
@media (max-width: 768px) {
.anonymous-info-banner {
font-size: 0.85rem;
padding: 0.5rem 0.75rem;
flex-direction: column;
gap: 0.25rem;
}
/* Hide full description and icon on mobile */
.anonymous-info-banner .info-icon,
.anonymous-info-banner .info-text {
display: none;
}
/* Show minimal content on mobile */
.anonymous-info-banner .info-content {
flex-direction: row;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
}
/* Add minimal login text for mobile */
.anonymous-info-banner .info-content::before {
content: "Login for higher limits";
font-size: 0.85rem;
color: rgb(100, 100, 100);
flex: 1;
}
.anonymous-info-banner .message-counter {
font-size: 0.8rem;
flex-shrink: 0;
}
}
/* Loading indicator */
.loading-indicator {
position: fixed;
bottom: calc(1rem + env(safe-area-inset-bottom));
left: 50%;
transform: translateX(-50%);
background-color: black;
color: white;
border: 2px solid black;
border-radius: 2rem;
padding: 0.75rem 1.5rem;
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
font-size: 0.9rem;
}
/* Spinner removed - using text instead */
/* Spin animation removed for minimal design */
/* Desktop loading indicator */
@media (min-width: 769px) {
.loading-indicator {
bottom: 2rem;
padding: 0.75rem 1.5rem;
font-size: 1rem;
}
}
/* Error message */
.error-message {
background-color: white;
color: black;
padding: 0.75rem 1rem;
border-radius: 1rem;
border: 2px solid black;
margin-bottom: 0.75rem;
font-size: 0.9rem;
}
/* Success message */
.success-message {
background-color: white;
color: black;
padding: 0.75rem 1rem;
border-radius: 1rem;
border: 2px solid black;
margin-bottom: 0.75rem;
font-size: 0.9rem;
text-align: center;
}
/* Clear chat button (inline with input) */
.clear-chat-button {
background-color: white;
color: black;
border: 2px solid black;
border-radius: 50%;
width: 48px;
height: 48px;
font-size: 1.2rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-family: inherit;
-webkit-tap-highlight-color: transparent;
transition: all 0.2s ease;
flex-shrink: 0;
font-weight: bold;
line-height: 1;
}
.clear-chat-button:hover {
background-color: black;
color: white;
}
.clear-chat-button:active {
transform: scale(0.95);
}
/* History loading */
.history-loading {
display: flex;
justify-content: center;
align-items: center;
padding: 2rem 1rem;
color: black;
font-size: 0.9rem;
}
.loading-text {
display: flex;
align-items: center;
gap: 0.5rem;
}
/* Loading spinner removed */
/* History error */
.history-error {
display: flex;
justify-content: center;
align-items: center;
padding: 1rem;
margin-bottom: 0.75rem;
}
.error-text {
background-color: white;
color: black;
padding: 0.75rem 1rem;
border-radius: 1rem;
border: 2px solid black;
font-size: 0.9rem;
text-align: center;
}
/* Desktop error message */
@media (min-width: 769px) {
.error-message {
border-radius: 0.5rem;
margin-bottom: 1rem;
font-size: 1rem;
}
.success-message {
border-radius: 0.5rem;
margin-bottom: 1rem;
font-size: 1rem;
}
.clear-chat-button {
width: 44px;
height: 44px;
font-size: 1.1rem;
}
.history-loading {
padding: 3rem 2rem;
font-size: 1rem;
}
.error-text {
border-radius: 0.5rem;
font-size: 1rem;
}
}
/* Mobile-specific optimizations */
@media (max-width: 768px) {
/* Header adjustments */
.header {
padding: 0.5rem 0.75rem;
}
.header-title h1 {
font-size: 1rem;
}
.header-content {
gap: 0.5rem;
flex-wrap: nowrap; /* Ensure no wrapping */
}
.header-nav {
gap: 0.25rem;
}
/* Chat messages mobile */
.chat-messages {
padding: 0.5rem;
}
.message {
margin-bottom: 0.5rem;
}
.message-content {
max-width: 90%;
padding: 0.625rem 0.875rem;
font-size: 0.95rem;
}
/* Chat input mobile */
.chat-input-container {
padding: 0.5rem;
padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
}
#messageInput {
min-height: 48px;
padding: 0.75rem 1rem;
font-size: 16px !important; /* Prevent zoom */
}
#sendButton {
min-width: 60px;
min-height: 48px;
padding: 0.75rem 1rem;
}
/* Info banner mobile */
.anonymous-info-banner {
padding: 0.5rem 0.75rem;
font-size: 0.85rem;
}
.anonymous-info-banner .message-counter {
padding: 0.25rem 0.5rem;
font-size: 0.8rem;
}
/* Prevent zoom on input focus */
input,
textarea,
select {
font-size: 16px !important;
}
/* Handle virtual keyboard */
@supports (height: 100dvh) {
.container {
height: 100dvh;
}
}
}
/* Small mobile devices */
@media (max-width: 480px) {
.header-title h1 {
font-size: 0.95rem;
}
.header {
padding: 0.4rem 0.5rem;
}
.message-content {
max-width: 95%;
font-size: 0.9rem;
}
#sendButton span {
display: none;
}
#sendButton::after {
content: "→";
font-size: 1.25rem;
}
/* Anonymous banner for very small mobile devices */
.anonymous-info-banner .info-content::before {
font-size: 0.8rem;
}
.anonymous-info-banner .message-counter {
font-size: 0.75rem;
padding: 0.2rem 0.4rem;
}
}
/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
.container {
max-width: 90%;
margin: 1rem auto;
border-radius: 0.5rem;
overflow: hidden;
}
.message-content {
max-width: 75%;
}
}
/* Large desktop styles */
@media (min-width: 1025px) {
.container {
max-width: 900px;
}
.message-content {
max-width: 65%;
}
}
/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
background: white;
}
.chat-messages::-webkit-scrollbar-thumb {
background: black;
border-radius: 3px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
background: black;
}
/* To
uch and interaction improvements */
@media (hover: none) and (pointer: coarse) {
/* Mobile-specific touch improvements */
#sendButton:hover {
background-color: #667eea;
transform: none;
}
#sendButton:active {
background-color: #5a6fd8;
transform: scale(0.98);
}
}
/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
.header {
background-color: black;
}
}
/* E-ink friendly design - no dark mode needed */
/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
.spinner {
animation: none;
}
}
/* Print styles */
@media print {
.header,
.chat-input-container,
.loading-indicator {
display: none;
}
.chat-messages {
padding: 0;
background: white;
}
.message-content {
max-width: 100%;
border: 1px solid #ccc;
page-break-inside: avoid;
}
}
/* Choice Page Styles */
.choose-container {
width: 100%;
min-height: calc(100vh - 60px);
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
background: white;
}
.choose-wrapper {
text-align: center;
}
.choose-title {
font-size: 2rem;
margin-bottom: 3rem;
color: black;
font-weight: normal;
}
.choose-options {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
}
.choose-button {
display: inline-block;
padding: 1rem 3rem;
background: black;
color: white;
text-decoration: none;
border: 2px solid black;
border-radius: 2rem;
font-weight: normal;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.9rem;
}
.choose-button:hover {
background: white;
color: black;
}
.auth-buttons {
display: flex;
gap: 1rem;
}
/* Anonymous User Styles */
.anonymous-user {
color: black;
font-style: normal;
}
.session-expiry-warning {
position: fixed;
top: 0;
left: 0;
right: 0;
background: black;
color: white;
padding: 1rem;
text-align: center;
z-index: 10000;
}
.session-expiry-warning button {
background: white;
color: black;
border: 2px solid white;
border-radius: 1rem;
padding: 0.5rem 1rem;
margin: 0 0.5rem;
cursor: pointer;
}
.session-expiry-warning button:hover {
background: black;
color: white;
}
/* System message styles */
.message.system .message-content {
background: white;
color: black;
border: 2px solid black;
border-radius: 1rem;
font-style: normal;
}
/* Mobile responsive for choice page */
@media (max-width: 768px) {
.choose-options {
grid-template-columns: 1fr;
}
.choose-title {
font-size: 2rem;
}
.auth-buttons {
flex-direction: column;
}
.choose-button {
width: 100%;
}
}