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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
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
/**

 * ============================================================================

 * CHAHUA DATABASE MANAGER - THEME SYSTEM

 * ============================================================================

 * 

 * @fileoverview Theme-specific CSS variable overrides

 * @author Chahua Development Thailand

 * @version 1.0.0

 * 

 * @description

 * This file provides theme variations by overriding CSS custom properties.

 * Themes include:

 * - Light theme (.theme-light)

 * - Dark theme (.theme-dark) - default in app.css

 * - High contrast theme (.theme-high-contrast)

 * - Blue theme (.theme-blue)

 * 

 * @usage

 * Apply theme class to body element:

 * document.body.className = 'theme-light';

 * 

 * @dependencies

 * - app.css (base CSS variables defined in :root)

 * 

 * @note

 * Z-index values and layout properties remain consistent across themes.

 * Only colors, fonts, and visual appearance change.

 * 

 * @customization

 * To add new themes:

 * 1. Create new .theme-{name} class

 * 2. Override desired CSS custom properties

 * 3. Test with all components (especially modals, tooltips)

 * 4. Update theme selector in JavaScript

 */

/* ============================================================================

   LIGHT THEME

   ============================================================================

   

   @theme Light Theme

   @description Clean light theme for better visibility in bright environments

   @accessibility Higher contrast ratios for better readability

   ============================================================================ */

.theme-light {
    /* @colors Light theme color palette */
    --bg-primary: #ffffff;      /* Pure white background */
    --bg-secondary: #f8f9fa;    /* Light gray secondary background */
    --bg-tertiary: #e9ecef;     /* Medium gray tertiary background */
    --bg-hover: #dee2e6;        /* Light gray hover state */
    
    /* @colors Light theme text colors */
    --text-primary: #212529;    /* Dark gray primary text */
    --text-secondary: #495057;  /* Medium gray secondary text */
    --text-muted: #6c757d;      /* Light gray muted text */
    --border-color: #dee2e6;    /* Light gray borders */
}

/* ============================================================================

   DARK THEME (DEFAULT)

   ============================================================================

   

   @theme Dark Theme

   @description Default theme - variables already defined in app.css :root

   @note No overrides needed, inherits from :root

   @usage Body element without theme class uses dark theme by default

   ============================================================================ */

/* Dark theme is the default - no class needed, inherits from :root */

/* ============================================================================

   HIGH CONTRAST THEME

   ============================================================================

   

   @theme High Contrast Theme

   @description Maximum contrast for accessibility and low vision users

   @accessibility WCAG AA compliant contrast ratios

   ============================================================================ */

.theme-high-contrast {
    /* @colors High contrast color palette */
    --bg-primary: #000000;      /* Pure black background */
    --bg-secondary: #1a1a1a;    /* Very dark gray secondary */
    --bg-tertiary: #333333;     /* Dark gray tertiary */
    --bg-hover: #4d4d4d;        /* Medium gray hover state */
    
    /* @colors High contrast text colors */
    --text-primary: #ffffff;    /* Pure white text */
    --text-secondary: #cccccc;  /* Light gray secondary text */
    --text-muted: #999999;      /* Medium gray muted text */
    --border-color: #666666;    /* Medium gray borders */
    
    /* @colors High contrast accent colors */
    --accent-primary: #00ffff;  /* Bright cyan accent */
    --accent-hover: #00cccc;    /* Darker cyan hover */
}

/* Blue Theme */
.theme-blue {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --accent-primary: #58a6ff;
    --accent-hover: #4493f8;
}

/* Green Theme */
.theme-green {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border-color: #30363d;
    --accent-primary: #3fb950;
    --accent-hover: #2ea043;
    --success-color: #238636;
}

/* Purple Theme */
.theme-purple {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a0d1a;
    --bg-tertiary: #2d1a2d;
    --bg-hover: #3d2a3d;
    --text-primary: #e6d9e6;
    --text-secondary: #b399b3;
    --text-muted: #8c6b8c;
    --border-color: #3d2a3d;
    --accent-primary: #a855f7;
    --accent-hover: #9333ea;
}

/* Theme Switcher */
.theme-switcher {
    position: relative;
}

.theme-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xs) 0;
    min-width: 150px;
    z-index: 1000;
    display: none;
}

.theme-menu.active {
    display: block;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.theme-option:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.theme-option.active {
    background-color: var(--accent-primary);
    color: white;
}

.theme-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.theme-color.dark {
    background: linear-gradient(45deg, #1e1e1e, #2d2d30);
}

.theme-color.light {
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
}

.theme-color.blue {
    background: linear-gradient(45deg, #0d1117, #58a6ff);
}

.theme-color.green {
    background: linear-gradient(45deg, #0d1117, #3fb950);
}

.theme-color.purple {
    background: linear-gradient(45deg, #0d0d0d, #a855f7);
}

.theme-color.high-contrast {
    background: linear-gradient(45deg, #000000, #00ffff);
}

/* Database Type Icons */
.db-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.db-icon.postgresql {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzMzNjc5MSI+PHBhdGggZD0iTTIzLjc5MSA1LjI1M2MtMS4yNy0uOTU0LTMuNjM4LTEuMDE2LTUuNjYyLS4yMThsLS4zODEuMTUxYy0uODkzLS41NzctMS45MTEtLjg2Ni0yLjk4My0uODY2LS45MzYgMC0xLjg0NS4yNTUtMi42OTMuNzU3bC0uMzI4LS4xMTljLTIuMTU1LS43OTgtNC44Mi0uNzM2LTYuNDEuNzY3QzMuOTE3IDYuNjY5IDMuMTQ2IDkuNzUgNC40MzggMTIuMjc3Yy44NjcgMS42OTcgMi4xMzEgMi42MjggMy4zOTUgMi42MjguMjYgMCAuNTE5LS4wMzUuNzctLjEwNS4zMTcuNjM3LjczNSAxLjIyIDEuMjQzIDEuNzMzLjkwNi45MTUgMi4wODkgMS40MTkgMy4zMyAxLjQxOXMyLjQyNC0uNTA0IDMuMzMtMS40MTljLjUwOC0uNTEzLjkyNi0xLjA5NiAxLjI0My0xLjczMy4yNTEuMDcuNTEuMTA1Ljc3LjEwNSAxLjI2NCAwIDIuNTI4LS45MzEgMy4zOTUtMi42MjggMS4yOTItMi41MjcuNTIxLTUuNjA4LTEuOTk1LTcuNTUyeiIvPjwvc3ZnPg==');
}

.db-icon.mysql {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzAwNzU4ZiI+PHBhdGggZD0iTTEyIDJDNi40OSAyIDIgNi40OSAyIDEyczQuNDkgMTAgMTAgMTAgMTAtNC40OSAxMC0xMFMxNy41MSAyIDEyIDJ6bTMuNSAxMy4zOGMtLjU1IDAtMSAuNDUtMSAxczQ1IDEgMSAxIDEtLjQ1IDEtMXptLTcgMGMtLjU1IDAtMSAuNDUtMSAxczQ1IDEgMSAxIDEtLjQ1IDEtMXptMC03YzAtLjU1LjQ1LTEgMS0xaDFjLjU1IDAgMSAuNDUgMSAxdjJjMCAuNTUtLjQ1IDEtMSAxSDkuNWMtLjU1IDAtMS0uNDUtMS0xVjguMzh6Ii8+PC9zdmc+');
}

.db-icon.sqlite {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzAwNzU4ZiI+PHBhdGggZD0iTTEyIDJjNS41MiAwIDEwIDQuNDggMTAgMTBzLTQuNDggMTAtMTAgMTBTMiAxNy41MiAyIDEyIDYuNDggMiAxMiAyem0wIDE4YzQuNDEgMCA4LTMuNTkgOC04cy0zLjU5LTgtOC04LTggMy41OS04IDggMy41OSA4IDggOHptLTUtOUg5djEuNUg3VjEyaDJWMTBoMnYyek0xNSAxMGgydjEuNWgtMlYxMmgyVjEwaDJ2eiIvPjwvc3ZnPg==');
}

.db-icon.mongodb {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzQ3QTI0OCI+PHBhdGggZD0iTTEyIDEuMjkzYy0uNzYgMC0xLjUxMy4xODUtMi4yMDMuNTMzTDQuNzYgNi4zOTJjLS45NTUuNTQtMS41NiAxLjU1Ni0xLjU2IDIuNjY3djUuODgyYzAgMS4xMS42MDUgMi4xMjcgMS41NiAyLjY2N2w1LjAzNyA0LjU2NmMuNjkuMzQ4IDEuNDQzLjUzMyAyLjIwMy41MzNzMS41MTMtLjE4NSAyLjIwMy0uNTMzbDUuMDM3LTQuNTY2Yy45NTUtLjU0IDEuNTYtMS41NTcgMS41Ni0yLjY2N1Y5LjA1OWMwLTEuMTExLS42MDUtMi4xMjctMS41Ni0yLjY2N2wtNS4wMzctNC41NjZjLS42OS0uMzQ4LTEuNDQzLS41MzMtMi4yMDMtLjUzM3oiLz48L3N2Zz4=');
}

.db-icon.redis {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI0RDMzgyRCI+PHBhdGggZD0iTTEyIDJMMjAuNSA2djEybC04LjUgNEwzLjUgMThWNkwxMiAyeiIvPjwvc3ZnPg==');
}

/* Connection Status Colors */
.status-connected {
    color: var(--success-color);
}

.status-connecting {
    color: var(--warning-color);
}

.status-disconnected {
    color: var(--error-color);
}

.status-error {
    color: var(--error-color);
}

/* Syntax Highlighting Themes */
.theme-light .sql-keyword {
    color: #0000ff;
}

.theme-light .sql-string {
    color: #008000;
}

.theme-light .sql-comment {
    color: #808080;
}

.theme-light .sql-number {
    color: #ff8c00;
}

.theme-dark .sql-keyword {
    color: #569cd6;
}

.theme-dark .sql-string {
    color: #ce9178;
}

.theme-dark .sql-comment {
    color: #6a9955;
}

.theme-dark .sql-number {
    color: #b5cea8;
}

.theme-blue .sql-keyword {
    color: #58a6ff;
}

.theme-blue .sql-string {
    color: #79c0ff;
}

.theme-blue .sql-comment {
    color: #8b949e;
}

.theme-blue .sql-number {
    color: #79c0ff;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

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

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

.bounce {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Print Styles */
@media print {
    .app-header,
    .sidebar,
    .tab-bar,
    .editor-toolbar,
    .results-header,
    .modal,
    .toast-container {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .data-table {
        border-collapse: collapse;
        width: 100%;
    }
    
    .data-table th,
    .data-table td {
        border: 1px solid black;
        padding: 4px;
    }
}

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

@media (prefers-high-contrast: high) {
    :root {
        --border-color: #ffffff;
        --text-muted: #cccccc;
    }
}

/* Focus Indicators */
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.tree-item:focus-visible,
.tab-item:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: -2px;
}