Files
Novault-Frontend-web/src/components/budget/BudgetCard/BudgetCard.css

283 lines
5.5 KiB
CSS
Raw Normal View History

2026-01-25 20:12:33 +08:00
/**
* BudgetCard Component - Premium Glassmorphism Style
*/
.budget-card {
display: flex;
flex-direction: column;
gap: 1.25rem;
2026-01-25 20:12:33 +08:00
padding: 1.5rem;
background: var(--glass-panel-bg);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
2026-01-25 20:12:33 +08:00
border: 1px solid var(--glass-border);
border-radius: 24px;
2026-01-25 20:12:33 +08:00
box-shadow: var(--shadow-sm);
transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
2026-01-25 20:12:33 +08:00
position: relative;
overflow: hidden;
}
/* Glass shine effect on hover */
.budget-card::after {
2026-01-25 20:12:33 +08:00
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(120deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 70%);
transform: translateX(-100%);
transition: transform 0.6s ease;
pointer-events: none;
}
.budget-card:hover::after {
transform: translateX(100%);
2026-01-25 20:12:33 +08:00
}
.budget-card--clickable {
cursor: pointer;
}
.budget-card--clickable:hover {
transform: translateY(-5px) scale(1.01);
box-shadow:
0 20px 40px -10px rgba(0, 0, 0, 0.1),
inset 0 0 0 1px rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.4);
background: rgba(255, 255, 255, 0.9);
}
[data-theme="dark"] .budget-card--clickable:hover {
background: rgba(40, 44, 52, 0.8);
border-color: rgba(255, 255, 255, 0.15);
2026-01-25 20:12:33 +08:00
}
/* Top accent line */
.budget-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 4px;
background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
opacity: 0.8;
2026-01-25 20:12:33 +08:00
}
/* Header */
.budget-card__header {
display: flex;
justify-content: space-between;
align-items: flex-start;
min-height: 48px;
2026-01-25 20:12:33 +08:00
}
.budget-card__title-section {
display: flex;
flex-direction: column;
gap: 4px;
2026-01-25 20:12:33 +08:00
flex: 1;
min-width: 0;
padding-right: 1rem;
2026-01-25 20:12:33 +08:00
}
.budget-card__name {
margin: 0;
font-family: 'Outfit', sans-serif;
2026-01-25 20:12:33 +08:00
font-size: 1.25rem;
font-weight: 700;
color: var(--text-primary);
2026-01-25 20:12:33 +08:00
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
letter-spacing: -0.01em;
}
.budget-card__meta {
display: flex;
align-items: center;
gap: 8px;
2026-01-25 20:12:33 +08:00
flex-wrap: wrap;
}
.budget-card__period {
font-size: 0.7rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
color: var(--text-tertiary);
background: rgba(0, 0, 0, 0.04);
padding: 2px 8px;
border-radius: 6px;
2026-01-25 20:12:33 +08:00
}
.budget-card__meta-item {
display: flex;
align-items: center;
gap: 4px;
font-size: 0.8rem;
color: var(--text-secondary);
2026-01-25 20:12:33 +08:00
}
.budget-card__separator {
color: var(--glass-border);
font-size: 0.6rem;
2026-01-25 20:12:33 +08:00
}
/* Amount Section */
2026-01-25 20:12:33 +08:00
.budget-card__amount-section {
text-align: right;
2026-01-25 20:12:33 +08:00
display: flex;
flex-direction: column;
align-items: flex-end;
}
.budget-card__amount {
font-family: 'Outfit', sans-serif;
2026-01-25 20:12:33 +08:00
font-size: 1.5rem;
font-weight: 800;
color: var(--text-primary);
line-height: 1.1;
2026-01-25 20:12:33 +08:00
letter-spacing: -0.02em;
}
/* Status Badges */
2026-01-25 20:12:33 +08:00
.budget-card__status {
margin-top: 4px;
font-size: 0.7rem;
2026-01-25 20:12:33 +08:00
font-weight: 700;
text-transform: uppercase;
padding: 2px 8px;
border-radius: 99px;
letter-spacing: 0.05em;
display: inline-block;
2026-01-25 20:12:33 +08:00
}
.budget-card__status--normal {
background: rgba(16, 185, 129, 0.1);
color: var(--color-success);
}
.budget-card__status--warning {
background: rgba(245, 158, 11, 0.1);
color: var(--color-warning);
}
.budget-card__status--over {
background: rgba(239, 68, 68, 0.1);
color: var(--color-error);
}
/* Footer Stats */
2026-01-25 20:12:33 +08:00
.budget-card__footer {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 0.25rem;
2026-01-25 20:12:33 +08:00
padding-top: 1rem;
border-top: 1px dashed var(--glass-border);
2026-01-25 20:12:33 +08:00
}
.budget-card__stats {
display: flex;
gap: 2rem;
2026-01-25 20:12:33 +08:00
}
.budget-card__stat {
display: flex;
flex-direction: column;
}
.budget-card__stat-label {
font-size: 0.7rem;
2026-01-25 20:12:33 +08:00
font-weight: 600;
text-transform: uppercase;
color: var(--text-tertiary);
letter-spacing: 0.05em;
margin-bottom: 2px;
2026-01-25 20:12:33 +08:00
}
.budget-card__stat-value {
font-family: 'Outfit', sans-serif;
font-weight: 700;
font-size: 1.1rem;
color: var(--text-secondary);
2026-01-25 20:12:33 +08:00
}
.budget-card__stat-value--negative {
color: var(--color-error);
}
/* Actions */
.budget-card__actions {
display: flex;
gap: 0.5rem;
opacity: 0;
transform: translateX(10px);
transition: all 0.3s ease;
2026-01-25 20:12:33 +08:00
}
.budget-card:hover .budget-card__actions {
opacity: 1;
transform: translateX(0);
2026-01-25 20:12:33 +08:00
}
.budget-card__action-btn {
width: 32px;
height: 32px;
2026-01-25 20:12:33 +08:00
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
border: 1px solid transparent;
background: rgba(0, 0, 0, 0.04);
color: var(--text-secondary);
cursor: pointer;
transition: all 0.2s ease;
2026-01-25 20:12:33 +08:00
}
.budget-card__action-btn:hover {
background: white;
color: var(--text-primary);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
transform: translateY(-2px);
2026-01-25 20:12:33 +08:00
}
.budget-card__action-btn--delete:hover {
background: #fef2f2;
2026-01-25 20:12:33 +08:00
color: var(--color-error);
box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}
/* Rolling Badge */
.budget-card__rolling-badge {
display: flex;
align-items: center;
gap: 4px;
font-size: 0.65rem;
font-weight: 700;
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
color: white;
padding: 2px 8px;
border-radius: 99px;
box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
2026-01-25 20:12:33 +08:00
}
/* Mobile */
@media (max-width: 600px) {
2026-01-25 20:12:33 +08:00
.budget-card {
padding: 1.25rem;
}
.budget-card__actions {
opacity: 1;
/* Always show actions on mobile */
transform: none;
2026-01-25 20:12:33 +08:00
}
.budget-card__amount {
font-size: 1.25rem;
}
}