mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
791 lines
15 KiB
791 lines
15 KiB
// ---------------------------------------------------------------------------
|
|
// Floating Action Button
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-fab {
|
|
position: fixed;
|
|
// Positioned high enough to clear Ghostfolio's own bottom FABs
|
|
// (Add Account / Add Transaction sit at ~1.5rem).
|
|
bottom: 5.5rem;
|
|
right: 1.25rem;
|
|
z-index: 1200;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.4rem;
|
|
padding: 0.55rem 0.9rem;
|
|
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 2rem;
|
|
box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
|
|
cursor: pointer;
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
transition:
|
|
transform 0.2s ease,
|
|
box-shadow 0.2s ease;
|
|
white-space: nowrap;
|
|
|
|
&:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 20px rgba(99, 102, 241, 0.55);
|
|
}
|
|
|
|
&:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
&--open {
|
|
border-radius: 50%;
|
|
padding: 0.7rem;
|
|
background: #6366f1;
|
|
|
|
.ai-fab__label {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
&__icon {
|
|
font-size: 1rem;
|
|
line-height: 1;
|
|
}
|
|
|
|
&__label--hidden {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Panel
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-panel {
|
|
position: fixed;
|
|
top: 0;
|
|
right: 0;
|
|
width: 420px;
|
|
height: 100vh;
|
|
max-width: 100vw;
|
|
z-index: 1100;
|
|
display: flex;
|
|
flex-direction: column;
|
|
background: var(--light-background, #ffffff);
|
|
box-shadow: -4px 0 32px rgba(0, 0, 0, 0.15);
|
|
border-left: 1px solid rgba(0, 0, 0, 0.08);
|
|
transform: translateX(100%);
|
|
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: #1e1e2e;
|
|
border-left-color: rgba(255, 255, 255, 0.08);
|
|
box-shadow: -4px 0 32px rgba(0, 0, 0, 0.5);
|
|
}
|
|
|
|
&--visible {
|
|
transform: translateX(0);
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Header
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-panel__header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 1rem 1.25rem;
|
|
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
|
|
color: #fff;
|
|
flex-shrink: 0;
|
|
|
|
&-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
}
|
|
}
|
|
|
|
.ai-panel__avatar {
|
|
font-size: 1.5rem;
|
|
line-height: 1;
|
|
}
|
|
|
|
.ai-panel__title {
|
|
display: block;
|
|
font-size: 1rem;
|
|
font-weight: 700;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.ai-panel__subtitle {
|
|
display: block;
|
|
font-size: 0.7rem;
|
|
opacity: 0.8;
|
|
letter-spacing: 0.03em;
|
|
}
|
|
|
|
.ai-panel__header-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.4rem;
|
|
}
|
|
|
|
.ai-clear-btn {
|
|
background: rgba(255, 255, 255, 0.12);
|
|
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
border-radius: 0.4rem;
|
|
color: rgba(255, 255, 255, 0.85);
|
|
cursor: pointer;
|
|
font-size: 0.7rem;
|
|
font-weight: 500;
|
|
padding: 0.25rem 0.55rem;
|
|
letter-spacing: 0.02em;
|
|
transition:
|
|
background 0.15s ease,
|
|
color 0.15s ease;
|
|
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.22);
|
|
color: #fff;
|
|
}
|
|
}
|
|
|
|
.ai-panel__close {
|
|
background: rgba(255, 255, 255, 0.15);
|
|
border: none;
|
|
border-radius: 50%;
|
|
color: #fff;
|
|
cursor: pointer;
|
|
width: 2rem;
|
|
height: 2rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 0.9rem;
|
|
transition: background 0.15s ease;
|
|
|
|
&:hover {
|
|
background: rgba(255, 255, 255, 0.25);
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Banner
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-banner {
|
|
padding: 0.6rem 1.25rem;
|
|
font-size: 0.85rem;
|
|
font-weight: 600;
|
|
flex-shrink: 0;
|
|
animation: slideDown 0.2s ease;
|
|
|
|
&--success {
|
|
background: #d1fae5;
|
|
color: #065f46;
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: #064e3b;
|
|
color: #a7f3d0;
|
|
}
|
|
}
|
|
|
|
&--seed {
|
|
background: #eff6ff;
|
|
color: #1e40af;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
gap: 0.5rem;
|
|
font-weight: 500;
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: #1e3a5f;
|
|
color: #bfdbfe;
|
|
}
|
|
}
|
|
|
|
&__actions {
|
|
display: flex;
|
|
gap: 0.4rem;
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
&__btn {
|
|
border: none;
|
|
border-radius: 6px;
|
|
padding: 0.25rem 0.65rem;
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: opacity 0.15s;
|
|
|
|
&:hover {
|
|
opacity: 0.85;
|
|
}
|
|
|
|
&--primary {
|
|
background: #2563eb;
|
|
color: #fff;
|
|
}
|
|
|
|
&--dismiss {
|
|
background: transparent;
|
|
color: inherit;
|
|
opacity: 0.6;
|
|
}
|
|
}
|
|
}
|
|
|
|
@keyframes slideDown {
|
|
from {
|
|
opacity: 0;
|
|
transform: translateY(-8px);
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
transform: translateY(0);
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Messages
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-messages {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 1rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.75rem;
|
|
scroll-behavior: smooth;
|
|
|
|
&::-webkit-scrollbar {
|
|
width: 4px;
|
|
}
|
|
|
|
&::-webkit-scrollbar-track {
|
|
background: transparent;
|
|
}
|
|
|
|
&::-webkit-scrollbar-thumb {
|
|
background: rgba(0, 0, 0, 0.15);
|
|
border-radius: 2px;
|
|
}
|
|
}
|
|
|
|
.ai-message {
|
|
display: flex;
|
|
flex-direction: column;
|
|
max-width: 88%;
|
|
|
|
&--user {
|
|
align-self: flex-end;
|
|
align-items: flex-end;
|
|
}
|
|
|
|
&--assistant {
|
|
align-self: flex-start;
|
|
align-items: flex-start;
|
|
}
|
|
}
|
|
|
|
.ai-bubble {
|
|
padding: 0.65rem 0.9rem;
|
|
border-radius: 1rem;
|
|
font-size: 0.875rem;
|
|
line-height: 1.5;
|
|
word-wrap: break-word;
|
|
|
|
.ai-message--user & {
|
|
background: linear-gradient(135deg, #6366f1, #8b5cf6);
|
|
color: #fff;
|
|
border-bottom-right-radius: 0.25rem;
|
|
}
|
|
|
|
.ai-message--assistant & {
|
|
background: #f3f4f6;
|
|
color: #111827;
|
|
border-bottom-left-radius: 0.25rem;
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: #2d2d3d;
|
|
color: #e2e8f0;
|
|
}
|
|
}
|
|
|
|
// Typing indicator
|
|
&--typing {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 0.75rem 1rem;
|
|
min-width: 3.5rem;
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Typing dots
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-dot {
|
|
width: 7px;
|
|
height: 7px;
|
|
border-radius: 50%;
|
|
background: #9ca3af;
|
|
animation: typingBounce 1.2s ease-in-out infinite;
|
|
|
|
&:nth-child(1) {
|
|
animation-delay: 0s;
|
|
}
|
|
|
|
&:nth-child(2) {
|
|
animation-delay: 0.2s;
|
|
}
|
|
|
|
&:nth-child(3) {
|
|
animation-delay: 0.4s;
|
|
}
|
|
}
|
|
|
|
@keyframes typingBounce {
|
|
0%,
|
|
60%,
|
|
100% {
|
|
transform: translateY(0);
|
|
opacity: 0.4;
|
|
}
|
|
30% {
|
|
transform: translateY(-6px);
|
|
opacity: 1;
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Meta row (tools, confidence, latency, feedback)
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-meta {
|
|
margin-top: 0.35rem;
|
|
font-size: 0.72rem;
|
|
|
|
&__warning {
|
|
background: #fef3c7;
|
|
color: #92400e;
|
|
border-radius: 0.4rem;
|
|
padding: 0.3rem 0.6rem;
|
|
margin-bottom: 0.4rem;
|
|
font-weight: 500;
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: #451a03;
|
|
color: #fcd34d;
|
|
}
|
|
}
|
|
|
|
&__row {
|
|
display: flex;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
gap: 0.3rem;
|
|
}
|
|
|
|
&__latency {
|
|
color: #9ca3af;
|
|
margin-left: auto;
|
|
font-size: 0.68rem;
|
|
}
|
|
}
|
|
|
|
.ai-badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 0.15rem 0.5rem;
|
|
border-radius: 0.75rem;
|
|
font-size: 0.68rem;
|
|
font-weight: 600;
|
|
letter-spacing: 0.02em;
|
|
|
|
&.confidence-high {
|
|
background: #d1fae5;
|
|
color: #065f46;
|
|
}
|
|
|
|
&.confidence-medium {
|
|
background: #fef3c7;
|
|
color: #92400e;
|
|
}
|
|
|
|
&.confidence-low {
|
|
background: #fee2e2;
|
|
color: #991b1b;
|
|
}
|
|
}
|
|
|
|
.ai-chip {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 0.15rem 0.45rem;
|
|
border-radius: 0.75rem;
|
|
font-size: 0.65rem;
|
|
font-weight: 500;
|
|
background: rgba(99, 102, 241, 0.1);
|
|
color: #6366f1;
|
|
border: 1px solid rgba(99, 102, 241, 0.2);
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: rgba(99, 102, 241, 0.2);
|
|
color: #a5b4fc;
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Feedback
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-feedback {
|
|
display: flex;
|
|
gap: 0.2rem;
|
|
margin-left: 0.25rem;
|
|
|
|
&__btn {
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
font-size: 0.85rem;
|
|
padding: 0.1rem;
|
|
border-radius: 0.25rem;
|
|
opacity: 0.5;
|
|
transition:
|
|
opacity 0.15s ease,
|
|
background 0.15s ease;
|
|
|
|
&:hover:not([disabled]) {
|
|
opacity: 1;
|
|
background: rgba(0, 0, 0, 0.05);
|
|
}
|
|
|
|
&[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
&--active-up {
|
|
opacity: 1;
|
|
filter: sepia(1) saturate(3) hue-rotate(90deg);
|
|
}
|
|
|
|
&--active-down {
|
|
opacity: 1;
|
|
filter: sepia(1) saturate(3) hue-rotate(320deg);
|
|
}
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Confirmation bar
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-confirm-bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
padding: 0.75rem 1rem;
|
|
background: #eff6ff;
|
|
border-top: 1px solid #bfdbfe;
|
|
flex-shrink: 0;
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: #1e3a5f;
|
|
border-top-color: #1d4ed8;
|
|
}
|
|
|
|
&__label {
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
color: #1e40af;
|
|
flex: 1;
|
|
|
|
:host-context(.theme-dark) & {
|
|
color: #93c5fd;
|
|
}
|
|
}
|
|
|
|
&__btn {
|
|
padding: 0.5rem 1rem;
|
|
border: none;
|
|
border-radius: 0.5rem;
|
|
cursor: pointer;
|
|
font-size: 0.8rem;
|
|
font-weight: 600;
|
|
transition:
|
|
transform 0.15s ease,
|
|
opacity 0.15s ease;
|
|
|
|
&:hover {
|
|
transform: translateY(-1px);
|
|
opacity: 0.9;
|
|
}
|
|
|
|
&:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
&--yes {
|
|
background: #10b981;
|
|
color: #fff;
|
|
}
|
|
|
|
&--no {
|
|
background: #ef4444;
|
|
color: #fff;
|
|
}
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Suggestion chips
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-suggestions {
|
|
padding: 0.5rem 0.75rem 0.25rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0.35rem;
|
|
flex-shrink: 0;
|
|
border-top: 1px solid rgba(0, 0, 0, 0.06);
|
|
|
|
:host-context(.theme-dark) & {
|
|
border-top-color: rgba(255, 255, 255, 0.06);
|
|
}
|
|
|
|
&__row {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.35rem;
|
|
|
|
&--realestate {
|
|
padding-top: 0.1rem;
|
|
}
|
|
}
|
|
}
|
|
|
|
.ai-suggestion-chip {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 0.3rem 0.65rem;
|
|
border-radius: 1.5rem;
|
|
font-size: 0.75rem;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition:
|
|
background 0.15s ease,
|
|
transform 0.1s ease,
|
|
opacity 0.15s ease;
|
|
border: 1px solid rgba(99, 102, 241, 0.3);
|
|
background: rgba(99, 102, 241, 0.08);
|
|
color: #4f46e5;
|
|
white-space: nowrap;
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: rgba(99, 102, 241, 0.15);
|
|
color: #a5b4fc;
|
|
border-color: rgba(99, 102, 241, 0.35);
|
|
}
|
|
|
|
&:hover {
|
|
background: rgba(99, 102, 241, 0.16);
|
|
transform: translateY(-1px);
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: rgba(99, 102, 241, 0.28);
|
|
}
|
|
}
|
|
|
|
&:active {
|
|
transform: translateY(0);
|
|
opacity: 0.85;
|
|
}
|
|
|
|
// Real estate row chips — slightly warmer tint to distinguish from portfolio
|
|
&--re {
|
|
border-color: rgba(16, 185, 129, 0.3);
|
|
background: rgba(16, 185, 129, 0.07);
|
|
color: #047857;
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: rgba(16, 185, 129, 0.15);
|
|
color: #6ee7b7;
|
|
border-color: rgba(16, 185, 129, 0.35);
|
|
}
|
|
|
|
&:hover {
|
|
background: rgba(16, 185, 129, 0.15);
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: rgba(16, 185, 129, 0.25);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Input area
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-input-area {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
gap: 0.5rem;
|
|
padding: 0.75rem 1rem;
|
|
border-top: 1px solid rgba(0, 0, 0, 0.08);
|
|
flex-shrink: 0;
|
|
background: var(--light-background, #fff);
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: #1e1e2e;
|
|
border-top-color: rgba(255, 255, 255, 0.08);
|
|
}
|
|
}
|
|
|
|
.ai-input {
|
|
flex: 1;
|
|
resize: none;
|
|
border: 1.5px solid #e5e7eb;
|
|
border-radius: 0.75rem;
|
|
padding: 0.6rem 0.9rem;
|
|
font-size: 0.875rem;
|
|
font-family: inherit;
|
|
background: #f9fafb;
|
|
color: inherit;
|
|
outline: none;
|
|
transition: border-color 0.15s ease;
|
|
max-height: 120px;
|
|
overflow-y: auto;
|
|
line-height: 1.5;
|
|
|
|
&:focus {
|
|
border-color: #6366f1;
|
|
background: #fff;
|
|
}
|
|
|
|
&:disabled {
|
|
opacity: 0.6;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
:host-context(.theme-dark) & {
|
|
background: #2d2d3d;
|
|
border-color: rgba(255, 255, 255, 0.12);
|
|
color: #e2e8f0;
|
|
|
|
&:focus {
|
|
border-color: #818cf8;
|
|
background: #2d2d3d;
|
|
}
|
|
}
|
|
}
|
|
|
|
.ai-send {
|
|
width: 2.5rem;
|
|
height: 2.5rem;
|
|
border: none;
|
|
border-radius: 50%;
|
|
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
|
|
color: #fff;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
flex-shrink: 0;
|
|
transition:
|
|
transform 0.15s ease,
|
|
opacity 0.15s ease;
|
|
|
|
&:hover:not([disabled]) {
|
|
transform: scale(1.05);
|
|
}
|
|
|
|
&[disabled] {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
}
|
|
|
|
&__spinner {
|
|
width: 14px;
|
|
height: 14px;
|
|
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
border-top-color: #fff;
|
|
border-radius: 50%;
|
|
animation: spin 0.6s linear infinite;
|
|
}
|
|
}
|
|
|
|
@keyframes spin {
|
|
to {
|
|
transform: rotate(360deg);
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Backdrop (mobile)
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-backdrop {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 1050;
|
|
background: rgba(0, 0, 0, 0.3);
|
|
|
|
@media (min-width: 600px) {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
// Markdown rendering inside bubbles
|
|
// ---------------------------------------------------------------------------
|
|
|
|
.ai-bubble {
|
|
::ng-deep {
|
|
p {
|
|
margin: 0 0 0.4em;
|
|
|
|
&:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
|
|
strong,
|
|
b {
|
|
font-weight: 700;
|
|
}
|
|
|
|
code {
|
|
background: rgba(0, 0, 0, 0.08);
|
|
border-radius: 3px;
|
|
padding: 0.1em 0.35em;
|
|
font-size: 0.85em;
|
|
font-family: 'JetBrains Mono', 'Fira Mono', monospace;
|
|
}
|
|
|
|
ul,
|
|
ol {
|
|
margin: 0.25em 0;
|
|
padding-left: 1.4em;
|
|
}
|
|
|
|
li {
|
|
margin-bottom: 0.15em;
|
|
}
|
|
|
|
hr {
|
|
border: none;
|
|
border-top: 1px solid rgba(0, 0, 0, 0.12);
|
|
margin: 0.5em 0;
|
|
}
|
|
}
|
|
}
|
|
|