Files
chat-proxy/frontend/src/App.css
T
Samuele E. Locatelli afddf8d0db Fix scrolling problem
2025-09-03 13:47:51 +00:00

211 lines
3.7 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* src/App.css */
/* =========================
RESET & BASE
========================= */
html, body, #root {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden; /* lo scroll è gestito dal main della chat */
}
body {
background-color: var(--bs-body-bg);
font-family: sans-serif;
}
/* =========================
SESSIONS WRAPPER & OFFCANVAS
========================= */
.sessions-wrapper {
transition: transform 300ms ease, filter 300ms ease;
will-change: transform, filter;
}
body.sessions-open .sessions-wrapper {
transform: translateX(280px) scale(0.985);
filter: saturate(0.95);
}
.sessions-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.4);
opacity: 0;
pointer-events: none;
transition: opacity 250ms ease;
z-index: 1030; /* sotto offcanvas (Bootstrap .offcanvas = 1045) */
}
.sessions-overlay.show {
opacity: 1;
pointer-events: auto;
}
.offcanvas-start {
width: 280px;
border-right: 1px solid #dee2e6;
}
.offcanvas.show {
box-shadow: 6px 0 20px rgba(0, 0, 0, 0.08);
}
.offcanvas-left {
position: fixed;
top: 0;
left: -280px;
width: 280px;
height: 100%;
background: var(--bs-body-bg, #fff);
box-shadow: 2px 0 5px rgba(0,0,0,0.3);
transition: left 0.3s ease;
z-index: 1050;
}
.offcanvas-left.show {
left: 0;
}
.session-table {
font-size: 0.85rem;
}
/* =========================
CHAT LAYOUT
========================= */
.chat-layout {
display: flex;
flex-direction: column;
height: 100vh;
}
.chat-layout > .flex-grow-1 {
flex: 1;
min-height: 0; /* fondamentale per Safari iOS */
overflow-y: auto;
}
.chat-layout footer {
flex-shrink: 0;
}
/* =========================
CHAT STYLES
========================= */
.chat-box {
flex: 1;
overflow-y: auto;
padding: 1rem;
background-color: #f8f9fa;
overflow-anchor: none;
}
.message {
margin: 0.5rem 0;
padding: 0.9rem 1rem;
border-radius: 12px;
width: auto;
max-width: 95%;
word-wrap: break-word;
}
.message:last-child {
overflow-anchor: auto;
}
@media (min-width: 768px) {
.message { max-width: 75%; }
}
.message.user {
background-color: #0d6efd;
color: #fff;
align-self: flex-end;
text-align: right;
border-top-right-radius: 0;
}
.message.assistant {
background-color: #e9ecef;
color: #212529;
align-self: flex-start;
text-align: left;
border-top-left-radius: 0;
}
/* =========================
INPUT BAR
========================= */
.input-bar {
display: flex;
padding: 1rem;
background-color: white;
border-top: 1px solid #ccc;
}
.chat-input {
flex: 1;
padding: 0.75rem;
border: 1px solid #ccc;
border-radius: 8px;
font-size: 1rem;
}
.send-button {
margin-left: 0.5rem;
padding: 0.75rem 1rem;
background-color: #0d6efd;
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
}
/* =========================
CODE BLOCKS
========================= */
pre {
background-color: #212529;
color: #f8f9fa;
padding: 0.75rem;
border-radius: 0.375rem;
overflow-x: auto;
}
code {
font-family: 'Fira Code', monospace;
font-size: 0.9rem;
}
.btn-copy {
font-size: 0.75rem;
}
/* =========================
THINKING BLOCK (limit growth)
========================= */
.message.thinking {
max-height: 40vh;
overflow-y: auto;
display: flex;
flex-direction: column;
}
.think-block {
opacity: 1;
transition: opacity 0.6s ease;
max-height: 40vh; /* non occupa più del 40% dell'altezza viewport */
overflow-y: auto; /* scroll interno se il contenuto è troppo */
padding: 0.5rem; /* un po di respiro interno */
box-sizing: border-box; /* padding incluso nel calcolo altezza */
background: rgba(0,0,0,0.03);
}
.think-block.fade-out {
opacity: 0;
}