Files
faq_chatbot_frontend/src/app/pages/settings/settings.page.css
T

748 lines
17 KiB
CSS

.settings-page {
min-height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
}
.settings-header {
animation: fadeInDown 0.4s ease-out;
}
.settings-card {
animation: fadeInUp 0.5s ease-out;
}
.settings-tabs {
position: relative;
display: flex;
}
.tab-divider {
position: relative;
z-index: 10;
flex-shrink: 0;
margin: 0.75rem 0;
}
.tab-btn {
position: relative;
cursor: pointer;
}
.tab-btn.tab-active {
color: var(--color-primary);
}
.tab-btn .tab-indicator {
animation: slideIn 0.3s ease-out;
}
.settings-content {
animation: fadeIn 0.3s ease-out;
}
.section-header {
animation: fadeInDown 0.3s ease-out;
}
.dropzone {
position: relative;
overflow: hidden;
}
.dropzone::before {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg, var(--color-primary)/5 0%, transparent 50%);
opacity: 0;
transition: opacity 0.3s ease;
}
.dropzone:hover::before,
.dropzone-active::before {
opacity: 1;
}
.dropzone-active {
border-color: var(--color-primary) !important;
background-color: var(--color-primary)/10 !important;
transform: scale(1.01);
box-shadow: 0 0 0 3px var(--color-primary)/20, 0 10px 40px var(--color-primary)/10;
}
.dropzone-icon-wrapper {
animation: bounce 2s infinite;
}
.dropzone-active .dropzone-icon-wrapper {
animation: pulse 1s infinite;
}
.file-list {
animation: slideUp 0.4s ease-out;
}
.file-item {
animation: slideInRight 0.3s ease-out;
}
.file-icon-wrapper {
transition: all 0.2s ease;
}
.file-item:hover .file-icon-wrapper {
background-color: var(--color-primary)/20;
transform: scale(1.05);
}
.file-remove-btn {
transition: all 0.2s ease;
}
.setting-item {
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 0.4s ease-out forwards;
}
.form-select {
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' 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: left 0.75rem center;
padding-left: 2.5rem;
}
.form-select:focus {
box-shadow: 0 0 0 3px var(--color-primary)/20;
}
.toggle-switch {
position: relative;
display: inline-flex;
height: 1.5rem;
width: 2.75rem;
flex-shrink: 0;
cursor: pointer;
align-items: center;
justify-content: flex-start;
padding: 0.125rem;
border-radius: 9999px;
border: 2px solid transparent;
transition: all 0.2s ease-in-out;
background-color: var(--toggle-bg);
box-sizing: border-box;
}
.toggle-switch input {
position: absolute;
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
pointer-events: none;
display: inline-block;
height: 1.25rem;
width: 1.25rem;
border-radius: 9999px;
background-color: var(--toggle-slider);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
}
.toggle-slider::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 0.5rem;
height: 0.5rem;
border-radius: 50%;
background-color: var(--toggle-slider);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
opacity: 1;
}
.toggle-switch input:checked + .toggle-slider {
transform: translateX(-1.25rem);
background-color: var(--toggle-slider);
box-shadow: 0 2px 8px var(--color-primary)/40, 0 0 0 2px var(--color-primary)/20;
}
.toggle-switch input:checked + .toggle-slider::after {
background-color: var(--toggle-slider);
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
.toggle-switch:has(input:checked) {
background-color: var(--color-primary);
border-color: var(--color-primary);
}
/* `.toggle-active` mirrors the checked state set by the host; keep it solid too
so it never wins over the neutral base with a transparent primary wash. */
.toggle-switch.toggle-active {
background-color: var(--color-primary);
border-color: var(--color-primary);
}
.toggle-switch:focus-within {
outline: none;
box-shadow: 0 0 0 3px var(--color-primary)/30;
}
/* Unchecked (off) hover: solid neutral, never transparent. */
.toggle-switch:hover:not(:has(input:checked)) {
background-color: color-mix(in srgb, var(--toggle-bg) 60%, #000);
}
/* Checked hover: solid, slightly darker primary. */
.toggle-switch:has(input:checked):hover {
background-color: color-mix(in srgb, var(--color-primary) 78%, #000);
}
.file-remove-btn:hover{
cursor: pointer;
}
@keyframes fadeInDown {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
from { opacity: 0; transform: translateX(20px); }
to { opacity: 1; transform: translateX(0); }
}
@keyframes slideIn {
from { width: 0; opacity: 0; }
to { width: 1.5rem; opacity: 1; }
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
40% { transform: translateY(-5px); }
60% { transform: translateY(-3px); }
}
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
@media (max-width: 640px) {
.settings-page {
padding: 1rem;
}
.settings-card {
border-radius: 1rem;
}
.settings-tabs {
flex-direction: column;
}
.tab-divider {
display: none;
}
.tab-btn {
justify-content: flex-start;
padding: 1rem;
}
.tab-btn span {
white-space: normal;
text-align: right;
}
.tab-btn .tab-indicator {
display: none;
}
.tab-btn.tab-active {
background-color: var(--color-primary)/10;
}
.dropzone {
padding: 2rem 1rem;
}
.setting-item {
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}
.setting-control {
width: 100%;
justify-content: flex-end;
}
.form-select {
width: 100%;
}
}
:host-context([data-bs-theme="dark"]) .dropzone-icon-wrapper svg,
:host-context([data-bs-theme="dark"]) .file-icon-wrapper svg,
:host-context([data-bs-theme="dark"]) .section-header svg {
stroke: var(--color-primary);
}
:host-context([data-bs-theme="dark"]) .form-select {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' 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");
}
:host-context([data-bs-theme="dark"]) .file-remove-btn:hover {
background-color: rgba(239, 68, 68, 0.15);
}
:host-context([data-bs-theme="dark"]) .toggle-switch input:checked + .toggle-slider {
box-shadow: 0 1px 3px var(--color-primary)/40, 0 0 0 2px var(--color-primary)/30;
}
:host-context([data-bs-theme="dark"]) .settings-card,
:host-context([data-bs-theme="dark"]) .file-item,
:host-context([data-bs-theme="dark"]) .setting-item {
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.2);
background-color: #111111;
}
:host-context([data-bs-theme="dark"]) .settings-content {
background-color: #171717;
}
:host-context([data-bs-theme="dark"]) .file-item:hover,
:host-context([data-bs-theme="dark"]) .setting-item:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
}
:host-context([data-bs-theme="dark"]) .btn--outline:hover:not(:disabled) {
background: color-mix(in srgb, var(--color-primary) 30%, #171717);
}
:host-context([data-bs-theme="dark"]) .toggle-switch:hover:not(:has(input:checked)) {
background-color: color-mix(in srgb, var(--toggle-bg) 50%, #000);
}
:host-context([data-bs-theme="dark"]) .toggle-switch:has(input:checked):hover {
background-color: color-mix(in srgb, var(--color-primary) 75%, #000);
}
/* ===== Dropzone disabled overlay ===== */
.dropzone-disabled {
opacity: 0.6;
pointer-events: none;
}
/* ===== Upload actions + queue ===== */
.upload-actions {
animation: fadeInUp 0.4s ease-out;
}
.upload-queue {
animation: fadeInUp 0.4s ease-out;
}
.upload-task {
animation: slideInRight 0.3s ease-out;
}
.upload-progress-bar {
background: var(--surface-border);
}
.upload-progress-bar > div {
background: var(--color-primary);
}
/* ===== Buttons ===== */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
border-radius: 0.5rem;
padding: 0.5rem 0.9rem;
font-size: 0.85rem;
font-weight: 500;
border: 1px solid transparent;
cursor: pointer;
transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.btn--primary {
background: var(--color-primary);
color: #ffffff;
}
.btn--primary:hover:not(:disabled) {
background: color-mix(in srgb, var(--color-primary) 80%, #000);
}
.btn--primary:active:not(:disabled) {
background: color-mix(in srgb, var(--color-primary) 70%, #000);
}
.btn--outline {
background: transparent;
border-color: var(--color-input-border);
color: var(--text-secondary);
}
.btn--outline:hover:not(:disabled) {
background: color-mix(in srgb, var(--color-primary) 22%, #ffffff);
border-color: var(--color-primary);
color: var(--color-primary);
}
/* ===== Documents table ===== */
.documents-section {
animation: fadeInUp 0.5s ease-out;
}
.documents-filters {
animation: fadeInUp 0.4s ease-out;
}
.documents-table-wrapper {
border: 1px solid var(--color-card-border);
/* Clip the table to the rounded corners on wide layouts. */
overflow: hidden;
}
/*
* md and below (Tailwind md = 48rem/768px).
*
* Six fixed-percentage columns stop being readable well before 768px: the date wraps,
* and the status column's error text overflows its column and bleeds into the
* neighbouring cells — which is what makes the row contents look mixed.
*
* Switching to `table-layout: auto` lets each column size to its own content, so no
* cell can overflow into the next one. The table then grows past the card and the
* wrapper scrolls horizontally instead of squeezing the columns.
*/
@media (max-width: 767.98px) {
.documents-table-wrapper {
overflow-x: auto;
/* Keep the scroll chain inside the card instead of leaking to the page. */
overscroll-behavior-x: contain;
-webkit-overflow-scrolling: touch;
}
.documents-table {
/* Auto layout ignores the <col> percentages, so columns follow their content. */
table-layout: auto;
min-width: 720px;
}
/* Short cells stay on one line so each column keeps a clean width. */
.documents-table th,
.documents-table td {
white-space: nowrap;
}
/* Title and status hold long text; let them wrap instead of widening the table. */
.documents-table td:nth-child(1),
.documents-table td:nth-child(2) {
white-space: normal;
}
.documents-table td:nth-child(1) {
max-width: 220px;
}
}
.documents-table {
border-collapse: separate;
border-spacing: 0;
}
.documents-table th,
.documents-table td {
padding: 0.6rem 0.75rem;
text-align: right;
vertical-align: top;
border-bottom: 1px solid var(--color-card-border);
/* Fixed layout fits the card; wrap long tokens so a cell never widens the table. */
overflow-wrap: anywhere;
}
.documents-table thead th {
background: var(--sidebar-hover);
}
.table-row-animate {
animation: fadeInUp 0.3s ease-out;
}
.documents-table tbody tr:last-child td {
border-bottom: none;
}
/*
* Row actions: the buttons must not be squeezed by the fixed column.
* Flex items shrink by default, which used to wrap «تلاش‌مجدد» / «بازبینی سند»
* mid-word (the cell's `overflow-wrap: anywhere` leaked into the button), so
* each button keeps its intrinsic width and the cell wraps to a new line only
* when there is genuinely no room.
*/
.documents-actions {
align-items: flex-start;
flex-wrap: wrap;
}
.documents-actions > .btn {
flex: 0 0 auto;
white-space: nowrap;
overflow-wrap: normal;
word-break: normal;
}
/* Status badges */
.status-queued {
background: var(--color-warning)/15;
color: var(--color-warning);
}
.status-processing {
background: var(--color-info)/15;
color: var(--color-info);
}
.status-ready {
background: var(--color-success)/15;
color: var(--color-success);
}
.status-failed {
background: var(--color-danger)/15;
color: var(--color-danger);
}
/* Plain text colours for the document active flag (no badge background). */
.doc-active {
color: var(--color-success);
}
.doc-inactive {
color: var(--text-muted);
}
.status-dot,
.dot-queued,
.dot-processing,
.dot-ready,
.dot-failed {
width: 0.4rem;
height: 0.4rem;
border-radius: 9999px;
flex-shrink: 0;
}
.dot-queued { background: var(--color-warning); }
.dot-processing { background: var(--color-info); animation: pulse-dot 1.5s ease-in-out infinite; }
.dot-ready { background: var(--color-success); }
.dot-failed { background: var(--color-danger); }
@keyframes pulse-dot {
0%, 100% { opacity: 1; }
50% { opacity: 0.4; }
}
/* Active toggle button */
.active-toggle {
display: inline-flex;
align-items: center;
gap: 0.35rem;
border-radius: 9999px;
padding: 0.25rem 0.7rem;
font-size: 0.78rem;
font-weight: 600;
border: 1px solid var(--color-input-border);
cursor: pointer;
transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.active-toggle--on {
background: var(--color-success)/15;
border-color: var(--color-success);
color: var(--color-success);
}
.active-toggle:not(.active-toggle--on) {
background: var(--color-input-border)/40;
color: var(--text-muted);
}
.active-toggle:hover {
opacity: 0.85;
}
.active-toggle:disabled {
cursor: default;
opacity: 0.6;
}
/* Documents empty / error / pagination */
.documents-loading,
.documents-empty,
.documents-error {
animation: fadeIn 0.3s ease-out;
}
/* ===== Review modal ===== */
.review-backdrop {
position: fixed;
inset: 0;
background: var(--overlay);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
padding: 1rem;
}
.review-modal {
background: var(--card-bg);
border: 1px solid var(--color-card-border);
border-radius: 1rem;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
width: 100%;
max-width: 56rem;
max-height: 85dvh;
overflow: hidden;
display: flex;
flex-direction: column;
}
.review-modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 1.25rem;
border-bottom: 1px solid var(--color-card-border);
}
/* Narrower variant for confirmations (e.g. remove document). */
.review-modal--sm {
max-width: 30rem;
}
.review-modal-body {
padding: 1.25rem;
overflow-y: auto;
flex: 1 1 auto;
min-height: 0;
}
.review-modal-footer {
border-top: 1px solid var(--color-card-border);
}
.review-loading {
animation: fadeIn 0.3s ease-out;
}
.review-items {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
gap: 1rem;
}
.review-item {
animation: fadeInUp 0.3s ease-out;
}
.review-item-header {
animation: fadeInDown 0.3s ease-out;
}
.review-item-body {
animation: fadeIn 0.3s ease-out;
}
.review-preview {
background: var(--sidebar-hover);
border: 1px dashed var(--color-card-border);
}
.review-preview img {
max-width: 100%;
height: auto;
display: block;
}
.review-item-actions {
animation: fadeInDown 0.3s ease-out;
}
/* ===== App settings: AI model cards grid ===== */
.ai-models-grid {
animation: fadeInUp 0.5s ease-out;
}
.ai-models-grid > app-ai-model-config-card {
animation: fadeInUp 0.4s ease-out;
}
/* Shared form utilities (also used by the review modal — page-scoped) */
.form-label {
font-size: 0.8rem;
font-weight: 500;
color: var(--text-secondary);
}
.form-input {
background: var(--color-input-bg);
color: var(--text-secondary);
border: 1px solid var(--color-input-border);
border-radius: 0.5rem;
padding: 0.5rem 0.75rem;
font-size: 0.875rem;
outline: none;
transition: border-color 0.2s, box-shadow 0.2s;
width: 100%;
box-sizing: border-box;
}
.form-input:focus {
border-color: var(--color-primary);
box-shadow: 0 0 0 3px var(--color-primary)/20;
}
.form-input:disabled {
background: var(--surface-bg);
cursor: default;
opacity: 0.7;
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
.dot-processing { animation: none; }
}
@media (max-width: 640px) {
.documents-table {
font-size: 0.75rem;
}
.documents-table th,
.documents-table td {
padding: 0.4rem 0.3rem;
}
.review-modal {
max-width: 100%;
max-height: 90dvh;
border-radius: 0.75rem;
}
.review-item-body {
grid-template-columns: 1fr;
}
.ai-models-grid {
grid-template-columns: 1fr;
}
}
@media (max-width: 480px) {
.documents-filters {
flex-wrap: wrap;
gap: 0.5rem;
}
}