webProjet2 / frontend /style.css
Soltane777's picture
Update frontend/style.css
7b87004 verified
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");
body {
font-family: "Poppins", Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f7fa;
transition: background-color 0.3s ease;
}
/* Dark mode styles */
html.dark body {
background-color: #111827;
color: #f3f4f6;
}
html.dark .app-content {
border-left: 1px solid #374151;
border-right: 1px solid #374151;
}
html.dark main,
html.dark #chat-messages,
html.dark .feature-btn:not(.active),
html.dark .user-message,
html.dark textarea,
html.dark select {
background-color: #1f2937;
color: #f3f4f6;
}
html.dark .feature-btn:not(.active) {
border-color: #374151;
color: #d1d5db;
}
html.dark .feature-btn:hover:not(.active) {
background-color: #374151;
}
html.dark .assistant-message {
background-color: #1f2937;
border-color: #374151;
border-left: 3px solid #7c3aed;
}
html.dark .user-message {
border-color: #374151;
}
html.dark .border-gray-100,
html.dark .border-gray-200,
html.dark .border-gray-300 {
border-color: #374151;
}
html.dark .text-gray-700,
html.dark .text-gray-800,
html.dark .text-gray-900 {
color: #e5e7eb;
}
html.dark .text-gray-500,
html.dark .text-gray-600 {
color: #9ca3af;
}
html.dark .bg-white {
background-color: #1f2937;
}
html.dark .bg-gray-100 {
background-color: #374151;
}
html.dark .code-content {
background-color: #111827;
border-color: #374151;
color: #e5e7eb;
}
html.dark .message-action-btn {
background-color: #374151;
color: #9ca3af;
border-color: #4b5563;
}
html.dark .message-action-btn:hover {
background-color: #4b5563;
color: #e5e7eb;
}
html.dark #historyPanel {
background-color: #1f2937;
}
html.dark #historyItems .bg-gray-100 {
background-color: #374151;
border-color: #4b5563;
}
html.dark .file-preview {
background-color: #374151;
border-color: #4b5563;
}
/* App container with borders */
.app-container {
display: flex;
flex-direction: column;
height: 100vh;
padding: 20px;
}
.app-content {
max-width: 1200px;
width: 100%;
margin: 0 auto;
display: flex;
flex-direction: column;
height: 100%;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
border-left: 1px solid #e5e7eb;
border-right: 1px solid #e5e7eb;
}
/* Feature buttons styling */
.feature-buttons {
-ms-overflow-style: none; /* Hide scrollbar in IE and Edge */
scrollbar-width: none; /* Hide scrollbar in Firefox */
}
.feature-buttons::-webkit-scrollbar {
display: none; /* Hide scrollbar in Chrome, Safari and Opera */
}
.feature-btn {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
font-size: 0.875rem;
font-weight: 500;
color: #4b5563;
background-color: #f9fafb;
transition: all 0.2s ease;
white-space: nowrap;
border: 1px solid #f0f0f0;
}
.feature-btn:hover {
background-color: #f3f4f6;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.feature-btn.active {
color: #ffffff;
background-color: #7c3aed;
border: 1px solid #7c3aed;
}
/* Chat message styling */
.user-message {
background-color: #f9fafb;
border-radius: 0.75rem 0.75rem 0 0.75rem;
border: 1px solid #f0f0f0;
}
.assistant-message {
background-color: #ffffff;
border-radius: 0.75rem 0.75rem 0.75rem 0;
border-left: 3px solid #7c3aed;
border-top: 1px solid #f0f0f0;
border-right: 1px solid #f0f0f0;
border-bottom: 1px solid #f0f0f0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
/* Auto-resize textarea */
textarea {
overflow-y: hidden;
min-height: 44px;
max-height: 200px;
background-color: #ffffff;
}
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: #ffffff;
}
::-webkit-scrollbar-thumb {
background: #c4b5fd;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: #a78bfa;
}
/* Animation for notifications */
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.notification {
animation: fadeIn 0.3s ease-out forwards;
}
/* Language selection styles */
.language-selector {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.75rem;
}
select {
appearance: none;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
background-repeat: no-repeat;
background-position: right 0.7rem center;
background-size: 1em;
padding-right: 2.5rem;
background-color: #ffffff;
}
/* Formatted output styles */
.formatted-output {
display: flex;
flex-direction: column;
gap: 16px;
width: 100%;
}
.result-header {
margin-bottom: 8px;
}
.result-header h3 {
font-size: 18px;
font-weight: 600;
color: #4b5563;
margin: 0;
padding-bottom: 8px;
border-bottom: 1px solid #f0f0f0;
}
.text-box {
background-color: white;
border-radius: 8px;
border: 1px solid #f0f0f0;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.text-box-header {
background-color: #f9fafb;
padding: 8px 12px;
font-weight: 500;
color: #4b5563;
border-bottom: 1px solid #f0f0f0;
font-size: 14px;
display: flex;
justify-content: space-between;
align-items: center;
}
.text-content {
padding: 12px 16px;
line-height: 1.6;
color: #1f2937;
background-color: #ffffff;
}
.code-content {
padding: 12px 16px;
font-family: monospace;
white-space: pre-wrap;
background-color: #f9fafb;
color: #334155;
line-height: 1.5;
font-size: 14px;
overflow-x: auto;
border: 1px solid #f0f0f0;
border-radius: 6px;
}
.error-message {
color: #b91c1c;
padding: 12px;
background-color: #fee2e2;
border-radius: 6px;
font-weight: 500;
}
/* File upload preview */
.file-preview {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem;
background-color: #f9fafb;
border-radius: 0.5rem;
margin-top: 0.5rem;
border: 1px solid #f0f0f0;
}
.file-preview-name {
font-size: 0.875rem;
color: #4b5563;
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.file-preview-remove {
color: #ef4444;
cursor: pointer;
}
/* Loading spinner */
.spinner {
border: 3px solid rgba(124, 58, 237, 0.3);
border-radius: 50%;
border-top: 3px solid #7c3aed;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Message actions */
.message-actions {
display: flex;
gap: 0.5rem;
margin-top: 0.5rem;
}
.message-action-btn {
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
color: #6b7280;
background-color: #f9fafb;
border-radius: 0.25rem;
transition: all 0.2s ease;
border: 1px solid #f0f0f0;
}
.message-action-btn:hover {
background-color: #f3f4f6;
color: #4b5563;
}
/* History panel */
#historyPanel {
background-color: #ffffff;
box-shadow: -2px 0 10px rgba(0, 0, 0, 0.05);
}
#historyItems .bg-gray-100 {
background-color: #f9fafb;
border: 1px solid #f0f0f0;
}
/* Theme toggle animation */
#theme-toggle {
transition: transform 0.3s ease;
}
#theme-toggle:hover {
transform: rotate(15deg);
}
/* Responsive adjustments */
@media (max-width: 1024px) {
.app-container {
padding: 15px;
}
}
@media (max-width: 768px) {
.app-container {
padding: 10px;
}
.feature-btn {
padding: 0.4rem 0.8rem;
font-size: 0.8rem;
}
}
@media (max-width: 640px) {
.app-container {
padding: 5px;
}
.feature-btn {
padding: 0.375rem 0.75rem;
font-size: 0.75rem;
}
.text-box-header {
padding: 6px 10px;
font-size: 13px;
}
.text-content {
padding: 10px 12px;
font-size: 14px;
}
/* Make sure the chat form is properly sized on mobile */
#chat-form {
flex-direction: column;
gap: 10px;
}
#chat-form button {
align-self: flex-end;
}
}
/* Fix for very small screens */
@media (max-width: 380px) {
.app-container {
padding: 0;
}
.app-content {
border-radius: 0;
}
.feature-btn {
padding: 0.25rem 0.5rem;
font-size: 0.7rem;
}
.feature-btn svg {
width: 16px;
height: 16px;
}
}