File size: 8,327 Bytes
a50a45d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
/**
 * Animation Fixes - Eliminate Flickering and Improve Performance
 * Addresses: smooth animations, hardware acceleration, layout stability
 */

/* =============================================================================
   GLOBAL ANIMATION SETTINGS - Prevent Flickering
   ============================================================================= */

* {
  /* Force hardware acceleration for smooth animations */
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-perspective: 1000;
  perspective: 1000;
  
  /* Prevent text flickering during animations */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  
  /* Optimize rendering */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* Disable perspective for specific elements that don't need it */
input, textarea, select, button {
  -webkit-perspective: none;
  perspective: none;
}

/* =============================================================================
   SMOOTH TRANSITIONS - Consistent Timing
   ============================================================================= */

/* Standard transition for interactive elements */
.btn, button, a, .card, .service-card, .metric-card,
.nav-item, .sidebar-item, [class*="btn-"] {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, opacity, background-color, border-color;
}

/* Faster transitions for hover effects */
.btn:hover, button:hover, a:hover,
.card:hover, .service-card:hover {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================================================
   LOADING ANIMATIONS - Smooth and No Flicker
   ============================================================================= */

.loading-spinner, .spinner, [class*="loading"] {
  animation: spin 1s linear infinite;
  will-change: transform;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Pulse animation for status indicators */
.status-dot, .pulse, [class*="pulse"] {
  animation: pulse-smooth 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  will-change: opacity;
}

@keyframes pulse-smooth {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Fade in animation */
.fade-in, [class*="fade-in"] {
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: opacity;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide up animation */
.slide-up, [class*="slide-up"] {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================================================
   LAYOUT STABILITY - Prevent Layout Shifts
   ============================================================================= */

/* Reserve space for images to prevent layout shift */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent content jump during loading */
.loading-state, .error-state, .empty-state {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* =============================================================================
   SCROLLING PERFORMANCE
   ============================================================================= */

/* Smooth scrolling with performance optimization */
html {
  scroll-behavior: smooth;
}

/* Reduce paint overhead on scroll */
.page-content, .main-content, [class*="container"] {
  contain: layout style paint;
}

/* =============================================================================
   MODAL & OVERLAY ANIMATIONS - No Flash
   ============================================================================= */

.modal, .overlay, [class*="modal"], [class*="overlay"] {
  animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: opacity;
}

.modal-content, [class*="modal-content"] {
  animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* =============================================================================
   TOAST NOTIFICATIONS - Smooth Entry/Exit
   ============================================================================= */

.toast, [class*="toast"] {
  animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  will-change: transform, opacity;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.removing, [class*="toast"].removing {
  animation: toastSlideOut 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* =============================================================================
   CHART ANIMATIONS - Prevent Flicker During Updates
   ============================================================================= */

#tradingview-chart, [id*="chart"], .chart-container {
  /* Optimize chart rendering */
  will-change: auto;
  contain: layout size paint;
}

/* =============================================================================
   HOVER EFFECTS - Smooth and Responsive
   ============================================================================= */

/* Card hover effects */
.card:hover, .service-card:hover, .metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Button hover effects */
.btn:hover, button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Remove transform for disabled buttons */
.btn:disabled, button:disabled,
.btn[disabled], button[disabled] {
  transform: none !important;
  opacity: 0.5;
  cursor: not-allowed;
}

/* =============================================================================
   REDUCED MOTION - Accessibility
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================================================
   FIX SPECIFIC COMPONENTS
   ============================================================================= */

/* Service Health Monitor - No flicker */
.health-stat-card, .service-card {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Dashboard cards - Stable layout */
.stat-card, .market-card, .news-card {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Sidebar - Smooth transitions */
.sidebar, #sidebar-container {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Header - Stable positioning */
.header, #header-container {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Tables - Prevent flicker on update */
table, .table, [class*="table"] {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Status badges - Smooth color transitions */
.badge, .status-badge, [class*="badge"] {
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* =============================================================================
   PERFORMANCE OPTIMIZATIONS
   ============================================================================= */

/* Contain repaints to specific elements */
.card, .modal, .sidebar, .header,
.chart-container, .table-container {
  contain: layout style paint;
}

/* Optimize transform and opacity changes */
[class*="animate-"], [class*="transition-"] {
  will-change: transform, opacity;
}

/* Clean up will-change after animation completes */
.card:not(:hover), .btn:not(:hover),
.service-card:not(:hover) {
  will-change: auto;
}