Welcome to AI Chat
+Ask me anything and I'll help you find answers
+Come si calcola la massa magra? dammi una spiegazione dettagliata
+diff --git a/static/css/main.css b/static/css/main.css index 3734cc2..4d95093 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,37 +1,532 @@ -textarea { - width: 100%; - height: 80px; +/* ===== CSS Variables ===== */ +:root { + --primary-color: #6366f1; + --primary-hover: #4f46e5; + --primary-light: #818cf8; + --secondary-color: #8b5cf6; + --accent-color: #06b6d4; + --success-color: #10b981; + --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + --glass-bg: rgba(255, 255, 255, 0.95); + --glass-border: rgba(255, 255, 255, 0.2); + --text-primary: #1f2937; + --text-secondary: #6b7280; + --text-light: #9ca3af; + --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05); + --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); + --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); + --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); + --border-radius-sm: 8px; + --border-radius-md: 12px; + --border-radius-lg: 16px; + --border-radius-xl: 24px; + --transition-fast: 0.15s ease; + --transition-normal: 0.3s ease; + --transition-slow: 0.5s ease; } -#messages { +/* ===== Reset & Base Styles ===== */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; + background: var(--background-gradient); + min-height: 100vh; + display: flex; + justify-content: center; + align-items: center; + padding: 20px; + color: var(--text-primary); + line-height: 1.6; +} + +/* ===== App Container ===== */ +.app-container { + width: 100%; + max-width: 900px; + height: 90vh; + max-height: 800px; + background: var(--glass-bg); + backdrop-filter: blur(20px); + border-radius: var(--border-radius-xl); + box-shadow: var(--shadow-xl); display: flex; flex-direction: column; - gap: 10px; - padding: 20px; + overflow: hidden; + border: 1px solid var(--glass-border); + animation: fadeInUp 0.6s ease-out; } +@keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(30px); + } + + to { + opacity: 1; + transform: translateY(0); + } +} + +/* ===== Header ===== */ +.chat-header { + background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); + padding: 20px 24px; + display: flex; + justify-content: space-between; + align-items: center; + box-shadow: var(--shadow-md); + z-index: 10; +} + +.header-content { + display: flex; + align-items: center; + gap: 12px; +} + +.logo-icon { + width: 40px; + height: 40px; + background: rgba(255, 255, 255, 0.2); + border-radius: var(--border-radius-md); + display: flex; + align-items: center; + justify-content: center; + color: white; + animation: pulse 2s infinite; +} + +@keyframes pulse { + + 0%, + 100% { + transform: scale(1); + } + + 50% { + transform: scale(1.05); + } +} + +.header-title { + font-size: 1.5rem; + font-weight: 700; + color: white; + letter-spacing: -0.5px; +} + +.header-status { + display: flex; + align-items: center; + gap: 8px; + background: rgba(255, 255, 255, 0.15); + padding: 6px 12px; + border-radius: 20px; +} + +.status-dot { + width: 8px; + height: 8px; + background: var(--success-color); + border-radius: 50%; + animation: blink 1.5s infinite; +} + +@keyframes blink { + + 0%, + 100% { + opacity: 1; + } + + 50% { + opacity: 0.5; + } +} + +.status-text { + color: white; + font-size: 0.875rem; + font-weight: 500; +} + +/* ===== Main Content ===== */ +.chat-main { + flex: 1; + display: flex; + flex-direction: column; + overflow: hidden; + background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%); +} + +/* ===== Welcome Section ===== */ +.welcome-section { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 40px 20px; + text-align: center; + animation: fadeIn 0.8s ease-out; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +.welcome-icon { + width: 80px; + height: 80px; + background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: white; + margin-bottom: 24px; + box-shadow: var(--shadow-lg); + animation: float 3s ease-in-out infinite; +} + +@keyframes float { + + 0%, + 100% { + transform: translateY(0); + } + + 50% { + transform: translateY(-10px); + } +} + +.welcome-title { + font-size: 2rem; + font-weight: 700; + color: var(--text-primary); + margin-bottom: 8px; + background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + background-clip: text; +} + +.welcome-subtitle { + font-size: 1.125rem; + color: var(--text-secondary); + margin-bottom: 32px; + max-width: 500px; +} + +.sample-question { + background: white; + padding: 20px 24px; + border-radius: var(--border-radius-lg); + box-shadow: var(--shadow-md); + max-width: 600px; + border-left: 4px solid var(--primary-color); + transition: transform var(--transition-normal), box-shadow var(--transition-normal); +} + +.sample-question:hover { + transform: translateY(-2px); + box-shadow: var(--shadow-lg); +} + +.sample-label { + display: block; + font-size: 0.75rem; + font-weight: 600; + color: var(--primary-color); + text-transform: uppercase; + letter-spacing: 0.5px; + margin-bottom: 8px; +} + +.sample-text { + font-size: 1rem; + color: var(--text-primary); + font-style: italic; +} + +/* ===== Messages Container ===== */ +.messages-container { + flex: 1; + display: flex; + flex-direction: column; + gap: 16px; + padding: 24px; + overflow-y: auto; + scroll-behavior: smooth; +} + +.messages-container::-webkit-scrollbar { + width: 6px; +} + +.messages-container::-webkit-scrollbar-track { + background: transparent; +} + +.messages-container::-webkit-scrollbar-thumb { + background: var(--text-light); + border-radius: 3px; +} + +.messages-container::-webkit-scrollbar-thumb:hover { + background: var(--text-secondary); +} + +/* ===== Message Styles ===== */ .message { - max-width: 70%; - padding: 10px 15px; - border-radius: 15px; - font-family: sans-serif; - line-height: 1.4; + max-width: 75%; + padding: 14px 18px; + border-radius: var(--border-radius-lg); + font-size: 0.95rem; + line-height: 1.6; + animation: messageSlide 0.3s ease-out; + word-wrap: break-word; +} + +@keyframes messageSlide { + from { + opacity: 0; + transform: translateY(10px); + } + + to { + opacity: 1; + transform: translateY(0); + } } .sent { - max-width: 70%; - background-color: lightgreen; - padding: 10px 15px; - border-radius: 15px; - font-family: sans-serif; - line-height: 1.4; align-self: flex-end; - border-bottom-right-radius: 2px; + background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); + color: white; + border-bottom-right-radius: 4px; + box-shadow: var(--shadow-md); +} + +.sent a { + color: white; + text-decoration: underline; } .received { align-self: flex-start; - background-color: #e5e5ea; - color: black; - border-bottom-left-radius: 2px; + background: white; + color: var(--text-primary); + border-bottom-left-radius: 4px; + box-shadow: var(--shadow-sm); + border: 1px solid rgba(0, 0, 0, 0.05); +} + +.received a { + color: var(--primary-color); + text-decoration: none; +} + +.received a:hover { + text-decoration: underline; +} + +/* ===== Footer ===== */ +.chat-footer { + background: white; + padding: 20px 24px; + border-top: 1px solid rgba(0, 0, 0, 0.05); + box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.05); +} + +.input-wrapper { + display: flex; + gap: 12px; + align-items: flex-end; + background: var(--background-gradient); + padding: 6px; + border-radius: var(--border-radius-lg); + box-shadow: var(--shadow-md); + transition: box-shadow var(--transition-normal); +} + +.input-wrapper:focus-within { + box-shadow: var(--shadow-lg); +} + +.message-input { + flex: 1; + background: white; + border: none; + border-radius: var(--border-radius-md); + padding: 14px 16px; + font-size: 1rem; + font-family: inherit; + color: var(--text-primary); + resize: none; + outline: none; + min-height: 50px; + max-height: 150px; + transition: box-shadow var(--transition-fast); +} + +.message-input::placeholder { + color: var(--text-light); +} + +.message-input:focus { + box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); +} + +.send-button { + width: 50px; + height: 50px; + background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); + border: none; + border-radius: var(--border-radius-md); + color: white; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + transition: all var(--transition-normal); + box-shadow: var(--shadow-md); + flex-shrink: 0; +} + +.send-button:hover { + transform: scale(1.05); + box-shadow: var(--shadow-lg); +} + +.send-button:active { + transform: scale(0.95); +} + +.send-button:disabled { + opacity: 0.5; + cursor: not-allowed; + transform: none; +} + +.footer-hint { + text-align: center; + font-size: 0.75rem; + color: var(--text-light); + margin-top: 12px; +} + +/* ===== Responsive Design ===== */ +@media (max-width: 768px) { + body { + padding: 10px; + } + + .app-container { + height: 95vh; + max-height: none; + border-radius: var(--border-radius-lg); + } + + .chat-header { + padding: 16px 20px; + } + + .header-title { + font-size: 1.25rem; + } + + .welcome-section { + padding: 30px 16px; + } + + .welcome-icon { + width: 64px; + height: 64px; + } + + .welcome-title { + font-size: 1.5rem; + } + + .welcome-subtitle { + font-size: 1rem; + } + + .sample-question { + padding: 16px 20px; + } + + .messages-container { + padding: 16px; + gap: 12px; + } + + .message { + max-width: 85%; + padding: 12px 14px; + font-size: 0.9rem; + } + + .chat-footer { + padding: 16px 20px; + } + + .message-input { + padding: 12px 14px; + font-size: 0.95rem; + } + + .send-button { + width: 46px; + height: 46px; + } +} + +@media (max-width: 480px) { + .header-status { + display: none; + } + + .message { + max-width: 90%; + } + + .sample-question { + padding: 14px 16px; + } + + .sample-text { + font-size: 0.9rem; + } +} + +/* ===== Loading Animation ===== */ +@keyframes shimmer { + 0% { + background-position: -200% 0; + } + + 100% { + background-position: 200% 0; + } +} + +.loading-message { + background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); + background-size: 200% 100%; + animation: shimmer 1.5s infinite; } \ No newline at end of file diff --git a/static/templates/index.html b/static/templates/index.html index dcd5279..7d42093 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -4,19 +4,56 @@ -
Come si calcola la massa magra? dammi una spiegazione dettagliata
+Ask me anything and I'll help you find answers
+Come si calcola la massa magra? dammi una spiegazione dettagliata
+