chahuadev's picture
Upload 40 files
8eeb77a verified
/**
* ============================================================================
* CHAHUA DATABASE MANAGER - COMPONENTS CSS
* ============================================================================
*
* @fileoverview UI component styles for database manager application
* @author Chahua Development Thailand
* @version 1.0.0
*
* @description
* This file contains styles for reusable UI components including:
* - Modal dialogs (z-index: 1000-2000)
* - Tooltips and popups (z-index: 2000-10000)
* - Loading overlays (z-index: 10000)
* - Form elements and buttons
* - Grid components and toolbars
*
* @dependencies
* - themes.css (CSS variables)
* - app.css (base styles)
*
* @z-index-hierarchy
* 1000 - Modal base layer
* 2000 - Tooltips, dropdowns
* 10000 - Loading overlays, critical popups
*
* @warning
* Be careful when modifying z-index values as they affect stacking order
* across the entire application. Test thoroughly after changes.
*/
/* ============================================================================
MODAL SYSTEM
============================================================================
@component Modal
@description Base modal dialog system for connection forms, settings, etc.
@related-js showConnectionModal(), hideConnectionModal() in app.js
@z-index 1000 (base modal layer)
@structure
.modal (container)
├── .modal-overlay (backdrop)
└── .modal-content (dialog box)
├── .modal-header
├── .modal-body
└── .modal-footer
@states
.modal.active - Shows the modal (display: flex)
@known-issues
- May conflict with AG Grid popups (z-index: 99999)
- Loading overlay (z-index: 10000) can block modal
============================================================================ */
.modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10001; /* @z-index MODAL FIX - Above loading overlay (10000) but below AG Grid (99999) */
display: none;
align-items: center;
justify-content: center;
}
.modal.active {
display: flex; /* @state Active modal becomes visible */
}
.modal-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.7); /* @backdrop Semi-transparent dark overlay */
backdrop-filter: blur(2px); /* @effect Modern blur effect for backdrop */
}
.modal-content {
/* @layout Modal dialog box container */
background-color: var(--bg-secondary); /* @theme-var Secondary background from themes.css */
border: 1px solid var(--border-color); /* @theme-var Border color from themes.css */
border-radius: var(--border-radius-lg); /* @theme-var Large border radius */
box-shadow: var(--shadow-lg); /* @theme-var Large shadow for depth */
width: 90%;
max-width: 500px; /* @responsive Default modal width */
max-height: 90vh; /* @responsive Prevent modal from being too tall */
overflow: hidden; /* @layout Hide scrollbars, content should scroll internally */
position: relative;
z-index: 1; /* @z-index Relative positioning above overlay */
}
/* @variant Import Data Modal - Larger size for data import forms */
.modal-content.import-data-modal {
max-width: 700px; /* @responsive Wider for import data forms */
width: 95%;
}
.modal-header {
padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-md);
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
justify-content: space-between;
}
.modal-header h2 {
font-size: 18px;
font-weight: 600;
color: var(--text-primary);
margin: 0;
}
.modal-close {
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
font-size: 24px;
line-height: 1;
padding: 0;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--border-radius);
transition: all 0.2s;
}
.modal-close:hover {
background-color: var(--bg-hover);
color: var(--text-primary);
}
.modal-body {
padding: var(--spacing-md) var(--spacing-lg);
max-height: calc(90vh - 200px);
overflow-y: auto;
}
.modal-footer {
padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
border-top: 1px solid var(--border-color);
display: flex;
gap: var(--spacing-sm);
justify-content: flex-end;
}
/* ============================================================================
TOAST NOTIFICATION SYSTEM
============================================================================
@component Toast Notifications
@description Toast notification system for user feedback messages
@purpose Display success, error, warning, and info messages to users
@related-js showToast(), hideToast() functions in ui.js
@z-index 2000 (above modals but below context menus)
@structure
.toast-container (fixed container)
└── .toast (individual notification)
├── .toast-icon (status icon)
├── .toast-content
│ ├── .toast-title
│ └── .toast-message
└── .toast-close (close button)
@variants
.toast-success - Green border for success messages
.toast-error - Red border for error messages
.toast-warning - Yellow border for warning messages
.toast-info - Blue border for info messages
@animations
slideInRight - Toast enters from right side
slideOutRight - Toast exits to right side
============================================================================ */
.toast-container {
position: fixed;
top: var(--spacing-lg);
right: var(--spacing-lg);
z-index: 2000;
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
max-width: 400px;
}
.toast {
background-color: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: var(--border-radius-lg);
box-shadow: var(--shadow-md);
padding: var(--spacing-md);
display: flex;
align-items: flex-start;
gap: var(--spacing-sm);
animation: slideInRight 0.3s ease-out;
position: relative;
overflow: hidden;
}
.toast.toast-success {
border-left: 4px solid var(--success-color);
}
.toast.toast-error {
border-left: 4px solid var(--error-color);
}
.toast.toast-warning {
border-left: 4px solid var(--warning-color);
}
.toast.toast-info {
border-left: 4px solid var(--info-color);
}
.toast-icon {
width: 20px;
height: 20px;
flex-shrink: 0;
margin-top: 2px;
}
.toast-content {
flex: 1;
}
.toast-title {
font-size: 14px;
font-weight: 600;
color: var(--text-primary);
margin-bottom: var(--spacing-xs);
}
.toast-message {
font-size: 13px;
color: var(--text-secondary);
line-height: 1.4;
}
.toast-close {
background: none;
border: none;
color: var(--text-muted);
cursor: pointer;
font-size: 18px;
line-height: 1;
padding: 0;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 2px;
flex-shrink: 0;
transition: all 0.2s;
}
.toast-close:hover {
background-color: var(--bg-hover);
color: var(--text-primary);
}
@keyframes slideInRight {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
.toast.removing {
animation: slideOutRight 0.3s ease-in forwards;
}
@keyframes slideOutRight {
from {
transform: translateX(0);
opacity: 1;
}
to {
transform: translateX(100%);
opacity: 0;
}
}
/* Enhanced DBeaver-style Context Menu */
/* ============================================================================
CONTEXT MENU SYSTEM
============================================================================
@component ContextMenu
@description Right-click context menus for tables, rows, etc.
@z-index 10000 (highest priority - above modals and tooltips)
@warning
This z-index is intentionally very high to ensure context menus
appear above ALL other elements including modals. This could
potentially block modal dialogs if context menu is open.
@related-js Context menu handlers in app.js
============================================================================ */
.context-menu {
position: fixed;
background-color: var(--bg-secondary); /* @theme-var Secondary background */
border: 1px solid var(--border-color); /* @theme-var Border color */
border-radius: var(--border-radius); /* @theme-var Standard border radius */
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); /* @shadow Custom shadow for depth */
padding: 4px 0;
min-width: 220px;
z-index: 10000; /* @z-index CRITICAL - Above everything including modals */
display: none; /* @state Hidden by default */
backdrop-filter: blur(10px); /* @effect Modern blur backdrop */
animation: contextMenuFadeIn 0.15s ease-out; /* @animation Smooth entrance */
}
@keyframes contextMenuFadeIn {
from {
opacity: 0;
transform: scale(0.95) translateY(-10px);
}
to {
opacity: 1;
transform: scale(1) translateY(0);
}
}
.context-menu.active {
display: block;
}
.context-menu-section {
padding: 2px 0;
}
.context-menu-item {
display: flex;
align-items: center;
gap: var(--spacing-sm);
padding: 8px 12px;
color: var(--text-secondary);
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: all 0.15s ease;
user-select: none;
white-space: nowrap;
justify-content: space-between;
}
.context-menu-item .shortcut {
font-size: 11px;
color: var(--text-muted);
background: var(--bg-tertiary);
padding: 2px 6px;
border-radius: 3px;
font-family: var(--font-mono);
}
.context-menu-item:hover {
background: linear-gradient(90deg, var(--accent-primary), var(--accent-primary-light, var(--accent-primary)));
color: var(--text-primary);
box-shadow: inset 3px 0 0 var(--accent-primary-dark, var(--accent-primary));
}
.context-menu-item.disabled {
opacity: 0.5;
cursor: not-allowed;
}
.context-menu-item.disabled:hover {
background-color: transparent;
color: var(--text-secondary);
box-shadow: none;
}
.context-menu-separator {
height: 1px;
background-color: var(--border-color);
margin: 4px 0;
opacity: 0.6;
}
.context-menu-item .menu-icon {
font-size: 14px;
width: 16px;
display: inline-block;
text-align: center;
}
/* Table Context Menu Specific Styles */
.table-context-menu {
min-width: 240px;
}
/* Specific action colors and styling */
.context-menu-item[data-action="openData"],
.context-menu-item[data-action="openStructure"] {
color: var(--primary-color, #007acc);
}
.context-menu-item[data-action="generateSelect"],
.context-menu-item[data-action="generateInsert"],
.context-menu-item[data-action="generateUpdate"],
.context-menu-item[data-action="generateDelete"] {
color: var(--info-color, #17a2b8);
}
.context-menu-item[data-action="showIndexes"],
.context-menu-item[data-action="showConstraints"],
.context-menu-item[data-action="showTriggers"] {
color: var(--secondary-color, #6c757d);
}
.context-menu-item[data-action="exportData"],
.context-menu-item[data-action="importData"] {
color: var(--success-color, #28a745);
}
.context-menu-item[data-action="duplicateTable"],
.context-menu-item[data-action="renameTable"],
.context-menu-item[data-action="analyzeTable"] {
color: var(--info-color, #17a2b8);
}
.context-menu-item[data-action="truncateTable"] {
color: var(--warning-color, #ffc107);
font-weight: 600;
}
.context-menu-item[data-action="dropTable"] {
color: var(--error-color, #dc3545);
font-weight: 700;
}
.context-menu-item[data-action="copyTableName"],
.context-menu-item[data-action="refreshTable"] {
color: var(--text-muted);
}
/* Enhanced hover effects for dangerous actions */
.context-menu-item[data-action="truncateTable"]:hover {
background: var(--warning-color, #ffc107) !important;
color: white !important;
box-shadow: inset 3px 0 0 #e0a800 !important;
}
.context-menu-item[data-action="dropTable"]:hover {
background: var(--error-color, #dc3545) !important;
color: white !important;
box-shadow: inset 3px 0 0 #c82333 !important;
}
/* ============================================================================
DROPDOWN COMPONENT SYSTEM
============================================================================
@component Dropdown
@description Custom dropdown menus for filtering, selection, etc.
@purpose Provide user-friendly selection interface with custom styling
@related-js Dropdown handlers in ui.js or app.js
@z-index Auto-positioned based on content flow
@structure
.dropdown (container)
├── .dropdown-toggle (clickable trigger button)
└── .dropdown-menu (popup menu content)
└── .dropdown-item (individual menu options)
@states
.dropdown-toggle.active - When dropdown is open
.dropdown-menu.show - When menu is visible
@usage
Used for table filtering, connection type selection, etc.
============================================================================ */
/* Dropdown */
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-toggle {
display: flex;
align-items: center;
gap: var(--spacing-xs);
background-color: var(--bg-tertiary);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
padding: var(--spacing-xs) var(--spacing-md);
color: var(--text-primary);
cursor: pointer;
font-size: 13px;
transition: all 0.2s;
}
.dropdown-toggle:hover {
background-color: var(--bg-hover);
}
.dropdown-toggle.active {
border-color: var(--accent-primary);
}
.dropdown-menu {
position: absolute;
top: 100%;
left: 0;
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;
max-height: 200px;
overflow-y: auto;
z-index: 1000;
display: none;
}
.dropdown.active .dropdown-menu {
display: block;
}
.dropdown-item {
display: block;
padding: var(--spacing-xs) var(--spacing-md);
color: var(--text-secondary);
text-decoration: none;
font-size: 13px;
cursor: pointer;
transition: all 0.2s;
}
.dropdown-item:hover {
background-color: var(--bg-hover);
color: var(--text-primary);
}
/* ============================================================================
TABLE VIEWER COMPONENTS
============================================================================
@component TableViewer
@description Database table viewing interface with AG Grid integration
@purpose Display and interact with database table data
@related-js Database table handlers in database.js, AG Grid in app.js
@integration Works with AG Grid Community Edition
@structure
.table-viewer (main container)
├── .table-toolbar (top toolbar with table name and actions)
│ ├── .table-name (table title)
│ └── .table-actions (action buttons)
├── .table-content (main content area)
│ └── .table-container (AG Grid container)
└── .table-pagination (bottom pagination controls)
@features
- Responsive table layout
- Integrated with AG Grid for data display
- Toolbar with save/refresh actions
- Pagination support
============================================================================ */
/* Table Viewer Components */
.table-viewer {
height: 100%;
display: flex;
flex-direction: column;
}
.table-toolbar {
background-color: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
padding: var(--spacing-sm) var(--spacing-md);
display: flex;
align-items: center;
justify-content: space-between;
}
.table-name {
font-size: 16px;
font-weight: 600;
color: var(--text-primary);
margin: 0;
}
.table-actions {
display: flex;
gap: var(--spacing-xs);
}
.table-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.table-container {
flex: 1;
overflow: auto;
position: relative;
}
.table-pagination {
background-color: var(--bg-secondary);
border-top: 1px solid var(--border-color);
padding: var(--spacing-sm) var(--spacing-md);
display: flex;
align-items: center;
justify-content: space-between;
font-size: 13px;
}
.pagination-info {
color: var(--text-secondary);
}
.pagination-controls {
display: flex;
align-items: center;
gap: var(--spacing-xs);
}
.page-numbers {
display: flex;
gap: var(--spacing-xs);
}
.page-number {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
background-color: var(--bg-tertiary);
color: var(--text-secondary);
cursor: pointer;
font-size: 12px;
transition: all 0.2s;
}
.page-number:hover {
background-color: var(--bg-hover);
color: var(--text-primary);
}
.page-number.active {
background-color: var(--accent-primary);
color: white;
border-color: var(--accent-primary);
}
.prev-page,
.next-page {
display: inline-flex;
align-items: center;
justify-content: center;
width: 24px;
height: 24px;
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
background-color: var(--bg-tertiary);
color: var(--text-secondary);
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
}
.prev-page:hover:not(:disabled),
.next-page:hover:not(:disabled) {
background-color: var(--bg-hover);
color: var(--text-primary);
}
.prev-page:disabled,
.next-page:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* ============================================================================
QUERY RESULTS VIEWER
============================================================================
@component QueryResults
@description SQL query results display interface
@purpose Show query execution results with metadata
@related-js Query execution handlers in query-editor.js
@integration Works with AG Grid for result data display
@structure
.query-results (main container)
├── .results-info (execution metadata bar)
└── .results-table-container (AG Grid results)
@features
- Query execution time display
- Row count information
- Scrollable results table
============================================================================ */
/* Query Results */
.query-results {
height: 100%;
display: flex;
flex-direction: column;
}
.results-info {
background-color: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
padding: var(--spacing-xs) var(--spacing-md);
font-size: 12px;
color: var(--text-muted);
display: flex;
justify-content: space-between;
}
.results-table-container {
flex: 1;
overflow: auto;
}
/* ============================================================================
CODE EDITOR COMPONENTS
============================================================================
@component CodeEditor
@description SQL code editor with syntax highlighting and line numbers
@purpose Provide enhanced SQL editing experience
@related-js Query editor functionality in query-editor.js
@features SQL syntax highlighting, line numbers, auto-complete
@structure
.code-editor (main container)
├── .editor-line-numbers (left gutter with line numbers)
└── .sql-editor.with-line-numbers (main editor area)
@syntax-highlighting
.sql-keyword - SQL keywords (SELECT, FROM, etc.)
.sql-string - String literals
.sql-comment - Comments
.sql-function - Built-in functions
============================================================================ */
/* Code Editor Enhancements */
.code-editor {
position: relative;
}
.editor-line-numbers {
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 50px;
background-color: var(--bg-secondary);
border-right: 1px solid var(--border-color);
padding: var(--spacing-md) var(--spacing-xs);
font-family: var(--font-mono);
font-size: 13px;
color: var(--text-muted);
line-height: 1.5;
user-select: none;
pointer-events: none;
overflow: hidden;
}
.sql-editor.with-line-numbers {
padding-left: 60px;
}
/* Syntax Highlighting (basic) */
.sql-keyword {
color: #569cd6;
font-weight: bold;
}
.sql-string {
color: #ce9178;
}
.sql-comment {
color: #6a9955;
font-style: italic;
}
.sql-number {
color: #b5cea8;
}
/* ============================================================================
RESIZE HANDLE COMPONENT
============================================================================
@component ResizeHandle
@description Draggable handles for resizing panels and splitters
@purpose Allow users to resize interface panels
@related-js Resize handlers in ui.js
@interaction Drag to resize adjacent panels
@variants
.resize-handle - Vertical resize (left-right)
.resize-handle.horizontal - Horizontal resize (up-down)
@states
:hover - Highlighted when mouse over
============================================================================ */
/* Resize Handle */
.resize-handle {
width: 4px;
background-color: var(--border-color);
cursor: col-resize;
transition: background-color 0.2s;
}
.resize-handle:hover {
background-color: var(--accent-primary);
}
.resize-handle.horizontal {
height: 4px;
width: 100%;
cursor: row-resize;
}
/* ============================================================================
STATUS BAR COMPONENT
============================================================================
@component StatusBar
@description Bottom status bar displaying app status and information
@purpose Show connection status, row counts, selection info, etc.
@related-js Status updates in app.js and ui.js
@position Fixed at bottom of application
@structure
.status-bar (main container)
├── .status-left (left-aligned status items)
└── .status-right (right-aligned status items)
└── .status-item (individual status indicators)
@content-types
- Connection status
- Selected rows count
- Query execution time
- Current table information
============================================================================ */
/* Status Bar */
.status-bar {
background-color: var(--bg-secondary);
border-top: 1px solid var(--border-color);
padding: var(--spacing-xs) var(--spacing-md);
font-size: 12px;
color: var(--text-muted);
display: flex;
align-items: center;
justify-content: space-between;
height: 24px;
}
.status-left,
.status-right {
display: flex;
align-items: center;
gap: var(--spacing-md);
}
.status-item {
display: flex;
align-items: center;
gap: var(--spacing-xs);
}
/* ============================================================================
PROGRESS & LOADING COMPONENTS
============================================================================
@component ProgressBar & LoadingStates
@description Progress indicators and loading states for user feedback
@purpose Show progress of operations and loading states
@related-js Loading states in app.js, progress updates in ui.js
@components
.progress-bar - Full-width progress bar
.progress-fill - Animated progress fill
.btn.loading - Button with loading spinner
@states
.btn.loading - Button disabled with spinner overlay
.progress-fill - Animated width change for progress
@animations
spin - Rotating spinner for loading buttons
============================================================================ */
/* Progress Bar */
.progress-bar {
width: 100%;
height: 4px;
background-color: var(--bg-tertiary);
border-radius: 2px;
overflow: hidden;
}
.progress-fill {
height: 100%;
background-color: var(--accent-primary);
border-radius: 2px;
transition: width 0.3s ease;
width: 0%;
}
/* Mini Progress (in buttons) */
.btn.loading {
position: relative;
pointer-events: none;
}
.btn.loading::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 16px;
height: 16px;
margin: -8px 0 0 -8px;
border: 2px solid transparent;
border-top: 2px solid currentColor;
border-radius: 50%;
animation: spin 1s linear infinite;
}
.btn.loading span {
opacity: 0;
}
/* Context Menu Styles (DBeaver-style) */
.context-menu {
position: fixed;
background-color: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
box-shadow: var(--shadow-lg);
padding: var(--spacing-xs) 0;
min-width: 200px;
z-index: 10000;
font-size: 13px;
user-select: none;
}
.context-menu-item {
display: flex;
align-items: center;
padding: var(--spacing-sm) var(--spacing-md);
cursor: pointer;
transition: background-color 0.15s ease;
white-space: nowrap;
}
.context-menu-item:hover {
background-color: var(--bg-hover);
}
.context-menu-item .menu-icon {
margin-right: var(--spacing-sm);
width: 16px;
text-align: center;
opacity: 0.8;
}
.context-menu-separator {
height: 1px;
background-color: var(--border-color);
margin: var(--spacing-xs) 0;
}
.context-menu-item[data-action="copyTableName"] {
font-family: var(--font-mono);
}
.context-menu-item[data-action="refreshTable"] {
border-top: 1px solid var(--border-color);
margin-top: var(--spacing-xs);
padding-top: var(--spacing-sm);
}
/* Tree Context Menu */
.table-context-menu .context-menu-item {
color: var(--text-primary);
}
.table-context-menu .context-menu-item:hover {
background-color: var(--primary-color);
color: var(--primary-contrast);
}
.table-context-menu .context-menu-item[data-action="generateSelect"] {
color: var(--success-color);
}
.table-context-menu .context-menu-item[data-action="generateInsert"] {
color: var(--info-color);
}
.table-context-menu .context-menu-item[data-action="generateUpdate"] {
color: var(--warning-color);
}
.table-context-menu .context-menu-item[data-action="generateDelete"] {
color: var(--danger-color);
}
/* ============================================================================
IMPORT DATA MODAL COMPONENTS
============================================================================
@component ImportDataModal
@description Modal interface for importing data from various sources
@purpose Allow users to import data from CSV, JSON, SQL files, etc.
@related-js Import handlers in database.js
@modal-type Large modal (.import-data-modal)
@structure
.import-options (grid layout for import types)
└── .option-card (individual import option)
├── .option-icon (file type icon)
├── h4 (option title)
└── p (option description)
@states
.option-card.active - Selected import type
.option-card:hover - Hover effect with lift animation
@import-types
- CSV files
- JSON data
- SQL scripts
- Excel files
============================================================================ */
/* Import Data Modal Styles */
.import-options {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
margin-top: 15px;
}
.option-card {
background: var(--bg-primary);
border: 2px solid var(--border-color);
border-radius: 8px;
padding: 20px;
text-align: center;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
}
.option-card:hover {
border-color: var(--accent-color);
background: var(--bg-hover);
transform: translateY(-2px);
}
.option-card.active {
border-color: var(--accent-color);
background: var(--bg-hover);
box-shadow: 0 0 0 1px var(--accent-color);
}
.option-card .option-icon {
font-size: 32px;
margin-bottom: 10px;
display: block;
}
.option-card h4 {
font-size: 14px;
font-weight: 600;
margin: 0 0 8px 0;
color: var(--text-primary);
}
.option-card p {
font-size: 12px;
color: var(--text-muted);
margin: 0;
line-height: 1.3;
}
/* Form group styles for import modal */
.import-data-modal .form-group {
margin-bottom: 20px;
}
.import-data-modal .form-group label {
display: block;
font-weight: 600;
margin-bottom: 8px;
color: var(--text-primary);
}
/* ============================================================================
SMART SYNC TOGGLE COMPONENT
============================================================================
@component SmartSyncToggle
@description Toggle control for enabling smart synchronization features
@purpose Allow users to enable/disable automatic sync between database and UI
@related-js Smart sync handlers in app.js
@feature Auto-refresh tables when database changes detected
@structure
.smart-sync-toggle (main toggle container)
├── .smart-sync-checkbox (checkbox input)
├── .smart-sync-label (descriptive label)
└── .smart-sync-tooltip (help icon/text)
@states
input:checked + .smart-sync-label - Active sync state
:hover - Hover effects for better UX
@integration
Works with database change detection and auto-refresh functionality
============================================================================ */
/* ============ Smart Sync Toggle Styles ============ */
.smart-sync-toggle {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 12px;
border: 1px solid var(--border-color);
border-radius: 6px;
background: var(--bg-primary);
transition: all 0.2s ease;
cursor: pointer;
user-select: none;
font-size: 13px;
}
.smart-sync-toggle:hover {
background: var(--bg-secondary);
border-color: var(--accent-color);
}
.smart-sync-checkbox {
width: 16px;
height: 16px;
cursor: pointer;
accent-color: var(--accent-color);
}
.smart-sync-label {
color: var(--text-primary);
font-weight: 500;
white-space: nowrap;
}
.smart-sync-tooltip {
opacity: 0.7;
font-size: 12px;
cursor: help;
}
.smart-sync-tooltip:hover {
opacity: 1;
}
.smart-sync-toggle input:checked + .smart-sync-label {
color: var(--accent-color);
font-weight: 600;
}
.toolbar-item {
display: flex;
align-items: center;
}
/* ============================================================================
SMART SYNC RESULTS DISPLAY
============================================================================
@component SmartSyncResults
@description Results panel showing smart sync operation outcomes
@purpose Display sync status, conflicts, and resolution options
@related-js Smart sync result processing in app.js
@parent-component Smart Sync system
@structure
.smart-sync-results (main results container)
├── .smart-sync-header (header with title and summary)
│ ├── h3 (results title)
│ └── .smart-sync-summary (operation summary)
└── [result content] (sync operation details)
@content-types
- Successful sync operations
- Conflict resolution needed
- Error reports
- Performance statistics
============================================================================ */
/* ============ Smart Sync Results Styles ============ */
.smart-sync-results {
padding: 20px;
background: var(--bg-secondary);
border-radius: 8px;
margin: 10px;
}
.smart-sync-header {
border-bottom: 1px solid var(--border-color);
padding-bottom: 16px;
margin-bottom: 20px;
}
.smart-sync-header h3 {
margin: 0 0 12px 0;
color: var(--accent-color);
font-size: 18px;
}
.smart-sync-summary {
display: flex;
gap: 16px;
margin: 12px 0;
flex-wrap: wrap;
}
.summary-stat {
display: flex;
flex-direction: column;
align-items: center;
padding: 12px 16px;
border-radius: 6px;
min-width: 80px;
border: 1px solid transparent;
}
.summary-stat.success {
background: rgba(34, 197, 94, 0.1);
border-color: rgba(34, 197, 94, 0.2);
}
.summary-stat.warning {
background: rgba(251, 191, 36, 0.1);
border-color: rgba(251, 191, 36, 0.2);
}
.summary-stat.error {
background: rgba(239, 68, 68, 0.1);
border-color: rgba(239, 68, 68, 0.2);
}
.summary-stat.info {
background: rgba(59, 130, 246, 0.1);
border-color: rgba(59, 130, 246, 0.2);
}
.stat-number {
font-size: 24px;
font-weight: 600;
color: var(--text-primary);
}
.stat-label {
font-size: 12px;
color: var(--text-muted);
margin-top: 4px;
}
.execution-info {
color: var(--text-muted);
font-size: 14px;
margin: 8px 0 0 0;
}
.smart-sync-logs h4,
.smart-sync-errors h4 {
margin: 0 0 12px 0;
font-size: 14px;
color: var(--text-primary);
}
.log-container,
.error-container {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 4px;
padding: 12px;
max-height: 300px;
overflow-y: auto;
font-family: 'Courier New', monospace;
font-size: 13px;
line-height: 1.4;
}
.log-entry {
padding: 2px 0;
color: var(--text-secondary);
border-left: 3px solid transparent;
padding-left: 8px;
margin: 2px 0;
}
.log-entry:hover {
background: rgba(255, 255, 255, 0.05);
border-radius: 3px;
}
.error-entry {
margin: 8px 0;
padding: 8px;
background: rgba(239, 68, 68, 0.1);
border-left: 3px solid rgba(239, 68, 68, 0.5);
border-radius: 4px;
}
.error-statement {
font-weight: 500;
color: var(--text-primary);
margin-bottom: 4px;
}
.error-message {
color: #ef4444;
font-size: 12px;
}
/* ============================================================================
ROW EDIT MODAL COMPONENT
============================================================================
@component RowEditModal
@description Modal dialog for editing individual database table rows
@purpose Allow users to edit row data with form validation
@related-js Row editing handlers in app.js, database.js
@modal-type Medium-sized modal for row editing
@structure
.modal-overlay (backdrop)
└── .modal-dialog (main modal container)
├── .modal-header (title and close button)
│ ├── h3 (modal title)
│ └── .btn-close (close button)
├── .modal-body (form content)
└── .modal-footer (action buttons)
@features
- Form validation
- Field-specific input types
- Save/cancel actions
- Error handling display
============================================================================ */
/* Row Edit Modal Styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(2px);
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
}
.modal-dialog {
background-color: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: var(--border-radius-lg);
box-shadow: var(--shadow-lg);
width: 90%;
max-width: 600px;
max-height: 90vh;
overflow: hidden;
position: relative;
}
.modal-header {
padding: var(--spacing-lg);
border-bottom: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
background-color: var(--bg-primary);
}
.modal-header h3 {
margin: 0;
color: var(--text-primary);
font-size: 18px;
font-weight: 600;
}
.btn-close {
background: none;
border: none;
font-size: 24px;
color: var(--text-secondary);
cursor: pointer;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: var(--border-radius);
transition: all 0.2s ease;
}
.btn-close:hover {
background-color: var(--bg-tertiary);
color: var(--text-primary);
}
.modal-body {
padding: var(--spacing-lg);
max-height: 60vh;
overflow-y: auto;
}
.modal-footer {
padding: var(--spacing-lg);
border-top: 1px solid var(--border-color);
display: flex;
justify-content: flex-end;
gap: var(--spacing-md);
background-color: var(--bg-primary);
}
.form-group {
margin-bottom: var(--spacing-lg);
}
.form-group label {
display: block;
margin-bottom: var(--spacing-sm);
color: var(--text-primary);
font-weight: 500;
font-size: 14px;
}
.form-control {
width: 100%;
padding: var(--spacing-md);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
background-color: var(--bg-primary);
color: var(--text-primary);
font-size: 14px;
transition: all 0.2s ease;
}
.form-control:focus {
outline: none;
border-color: var(--accent-color);
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.form-control:required {
border-left: 3px solid var(--accent-color);
}
/* ============================================================================
TABLE CRUD ACTION COMPONENTS
============================================================================
@component TableCRUDActions
@description Action buttons for Create, Read, Update, Delete operations on table data
@purpose Provide user interface for database table operations
@related-js CRUD handlers in app.js, database.js
@integration Works with AG Grid row selection and edit modes
@structure
.table-actions (toolbar container)
└── .btn-crud (action buttons)
├── .btn-add (create new row)
├── .btn-edit (edit selected row)
└── .btn-delete (delete selected row)
.row-actions (in-table row actions)
└── .btn-row-action (individual row buttons)
├── .btn-edit-row (edit this row)
├── .btn-delete-row (delete this row)
└── .btn-save-row (save row changes)
@states
:hover - Button hover effects with scaling
:disabled - Disabled state for unavailable actions
@color-coding
Add/Edit buttons - Blue theme
Delete buttons - Red theme (when implemented)
Save buttons - Green theme (when implemented)
============================================================================ */
/* Table CRUD Action Buttons */
.table-actions {
padding: var(--spacing-md);
border-bottom: 1px solid var(--border-color);
background-color: var(--bg-primary);
display: flex;
gap: var(--spacing-sm);
align-items: center;
}
.btn-crud {
padding: var(--spacing-sm) var(--spacing-md);
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
background-color: var(--bg-secondary);
color: var(--text-primary);
font-size: 12px;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
gap: 4px;
}
.btn-crud:hover {
background-color: var(--bg-tertiary);
border-color: var(--accent-color);
}
.btn-crud.btn-add {
background-color: #3b82f6;
color: white;
border-color: #3b82f6;
}
.btn-crud.btn-add:hover {
background-color: #1e40af;
}
.btn-crud.btn-edit {
background-color: #3b82f6;
color: white;
border-color: #3b82f6;
}
.btn-crud.btn-edit:hover {
background-color: #1e40af;
}
.btn-crud.btn-delete {
background-color: #3b82f6;
color: white;
border-color: #3b82f6;
}
.btn-crud.btn-delete:hover {
background-color: #1e40af;
}
/* Row Action Buttons in Table */
.row-actions {
display: flex;
gap: 4px;
}
.btn-row-action {
padding: 2px 6px;
border: none;
border-radius: 3px;
font-size: 10px;
cursor: pointer;
transition: all 0.2s ease;
min-width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.btn-edit-row {
background-color: #3b82f6;
color: white;
}
.btn-edit-row:hover {
background-color: #1e40af;
transform: scale(1.1);
}
.btn-delete-row {
background-color: #3b82f6;
color: white;
}
.btn-delete-row:hover {
background-color: #1e40af;
transform: scale(1.1);
}
.btn-save-row {
background-color: #3b82f6;
color: white;
}
.btn-save-row:hover {
background-color: #1e40af;
transform: scale(1.1);
}
/* Enhanced Row Actions with Tooltips */
.btn-row-action[title]:hover::after {
content: attr(title);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.8);
color: white;
padding: 4px 8px;
border-radius: 4px;
font-size: 10px;
white-space: nowrap;
z-index: 1000;
pointer-events: none;
}
.btn-row-action {
position: relative;
}
/* ============================================================================
DATABASE BROWSER SECTION COMPONENTS
============================================================================
@component DatabaseBrowserSections
@description Organized sections for database browser UI layout
@purpose Structure the main interface into logical groups (tools, tables, etc.)
@related-js Section management in app.js
@layout Main application content organization
@structure
.section-header (sticky header with gradient background)
├── .section-title (title with icon)
│ ├── .section-icon (section identifier icon)
│ └── [title text]
└── .section-content (main section content area)
@sections
.tools-section - Database tools and utilities
.tables-section - Database tables listing
.views-section - Database views
.procedures-section - Stored procedures
@styling
- Gradient backgrounds for visual distinction
- Sticky headers for navigation
- Blue theme consistency
- Border radius for modern appearance
============================================================================ */
/* =============================================
DATABASE BROWSER SECTION STYLING
============================================= */
/* Section Headers */
.section-header {
background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
border: 1px solid var(--border-color);
border-radius: var(--border-radius) var(--border-radius) 0 0;
padding: var(--spacing-md);
margin-bottom: 0;
position: sticky;
top: 0;
z-index: 10;
}
.section-title {
display: flex;
align-items: center;
gap: var(--spacing-sm);
font-weight: 600;
color: var(--text-primary);
}
.section-icon {
width: 16px;
height: 16px;
color: var(--accent-color);
}
/* Section Content */
.section-content {
background-color: var(--bg-primary);
border: 1px solid var(--border-color);
border-top: none;
border-radius: 0 0 var(--border-radius) var(--border-radius);
margin-bottom: var(--spacing-lg);
overflow: hidden;
}
/* Section Specific Styling - ใช้สีน้ำเงินเท่านั้น */
.tools-section .section-header {
background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
color: white;
}
.tools-section .section-title strong {
color: white;
}
.plugins-section .section-header {
background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
color: white;
}
.plugins-section .section-title strong {
color: white;
}
.tables-section .section-header {
background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
color: white;
}
.tables-section .section-title strong {
color: white;
}
/* Enhanced Tree Items - ลบแถบสีริม แต่เก็บแอนิเมชัน */
.tool-item {
transition: all 0.2s ease;
}
.tool-item:hover {
background-color: rgba(59, 130, 246, 0.1);
}
/* Plugin Item - New Layout */
.plugin-item {
transition: all 0.2s ease;
padding: var(--spacing-lg);
display: flex;
flex-direction: column;
gap: var(--spacing-md);
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 8px;
margin-bottom: var(--spacing-md);
}
.plugin-item:hover {
background-color: rgba(59, 130, 246, 0.05);
border-color: rgba(59, 130, 246, 0.2);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
/* Plugin Main Info */
.plugin-main-info {
display: flex;
align-items: flex-start;
gap: var(--spacing-md);
}
.plugin-info {
flex: 1;
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
}
.plugin-title {
display: flex;
align-items: center;
gap: var(--spacing-sm);
margin-bottom: 4px;
}
.plugin-title .tree-label {
font-size: 1.1em;
font-weight: 600;
color: var(--text-primary);
}
.plugin-author {
font-size: 0.9em;
color: var(--text-secondary);
font-style: italic;
}
.plugin-features {
display: flex;
flex-wrap: wrap;
gap: var(--spacing-sm);
margin-top: 4px;
}
/* Plugin Simple Actions (New Simple Design) */
.plugin-simple-actions {
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
margin-top: var(--spacing-sm);
}
/* Simple Plugin Buttons */
.simple-btn {
width: 100%;
padding: 12px 16px;
border: 1px solid var(--border-color);
border-radius: 6px;
background: var(--bg-secondary);
color: var(--text-primary);
cursor: pointer;
font-family: inherit;
font-size: 14px;
font-weight: 500;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.simple-btn:hover {
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.simple-btn.primary {
background: #3b82f6;
color: white;
border-color: #3b82f6;
}
.simple-btn.primary:hover {
background: #1d4ed8;
border-color: #1d4ed8;
}
.simple-btn.secondary {
background: #6b7280;
color: white;
border-color: #6b7280;
}
.simple-btn.secondary:hover {
background: #4b5563;
border-color: #4b5563;
}
.simple-btn.tertiary {
background: #f59e0b;
color: white;
border-color: #f59e0b;
}
.simple-btn.tertiary:hover {
background: #d97706;
border-color: #d97706;
}
/* Simple Drop Area */
.simple-drop-area {
border: 2px dashed var(--border-color);
border-radius: 6px;
padding: 12px;
text-align: center;
background: rgba(79, 172, 254, 0.05);
transition: all 0.2s ease;
color: var(--text-secondary);
font-size: 14px;
}
.simple-drop-area:hover {
border-color: #4facfe;
background: rgba(79, 172, 254, 0.1);
}
.simple-drop-area.drag-over {
border-color: #4facfe !important;
background: rgba(79, 172, 254, 0.2) !important;
transform: scale(1.02);
box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}
.simple-drop-area.drag-over::before {
content: '📁 วางไฟล์ที่นี่';
display: block;
font-weight: bold;
color: #4facfe;
}
/* Plugin Actions Vertical (Legacy - Hidden) */
.plugin-actions-vertical {
display: none; /* ซ่อนเพื่อใช้ simple actions แทน */
}
/* Big Plugin Buttons */
.plugin-big-btn {
width: 100%;
padding: var(--spacing-md) var(--spacing-lg);
border: 2px solid var(--border-color);
border-radius: 8px;
background: var(--bg-secondary);
color: var(--text-primary);
cursor: pointer;
display: flex;
align-items: center;
gap: var(--spacing-md);
transition: all 0.3s ease;
min-height: 60px;
font-family: inherit;
}
.plugin-big-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.plugin-big-btn .btn-icon {
font-size: 1.8em;
min-width: 40px;
text-align: center;
}
.plugin-big-btn .btn-text {
font-size: 1.1em;
font-weight: 600;
flex: 1;
}
.plugin-big-btn .btn-desc {
font-size: 0.9em;
color: var(--text-secondary);
margin-left: auto;
}
/* Setup Button Specific */
.plugin-big-btn.setup-btn {
border-color: #3b82f6;
}
.plugin-big-btn.setup-btn:hover {
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
color: white;
border-color: #1d4ed8;
}
.plugin-big-btn.setup-btn:hover .btn-desc {
color: rgba(255, 255, 255, 0.8);
}
/* Dump Button Specific */
.plugin-big-btn.dump-btn {
border-color: #f093fb;
}
.plugin-big-btn.dump-btn:hover {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
color: white;
border-color: #f5576c;
}
.plugin-big-btn.dump-btn:hover .btn-desc {
color: rgba(255, 255, 255, 0.8);
}
/* Plugin Drop Area */
.plugin-drop-area {
border: 2px dashed var(--border-color);
border-radius: 8px;
padding: var(--spacing-md);
text-align: center;
background: rgba(79, 172, 254, 0.05);
transition: all 0.2s ease;
}
.plugin-drop-area:hover {
border-color: #4facfe;
background: rgba(79, 172, 254, 0.1);
}
.drop-zone-text {
display: flex;
align-items: center;
justify-content: center;
gap: var(--spacing-sm);
color: var(--text-secondary);
font-size: 0.9em;
}
.drop-zone-text .drop-icon {
font-size: 1.2em;
}
.table-item {
transition: all 0.2s ease;
}
.table-item:hover {
background-color: rgba(59, 130, 246, 0.1);
}
/* Plugin Info Layout */
.plugin-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 4px;
}
.plugin-meta {
display: flex;
align-items: center;
gap: var(--spacing-sm);
}
.table-info {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
}
/* Badges and Meta Information */
.tree-badge {
padding: 2px 6px;
border-radius: 10px;
font-size: 10px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.tree-badge.version {
background-color: #3b82f6;
color: white;
}
.tree-badge.rows {
background-color: #3b82f6;
color: white;
}
.tree-badge:not(.version):not(.rows) {
background-color: var(--bg-tertiary);
color: var(--text-secondary);
}
.tree-meta.author {
font-size: 11px;
color: var(--text-tertiary);
font-style: italic;
}
/* Empty State */
.tree-section.empty .section-content {
padding: var(--spacing-xl);
text-align: center;
}
.tree-placeholder {
color: var(--text-tertiary);
font-style: italic;
}
/* Spacing between sections */
.tree-section + .tree-section {
margin-top: var(--spacing-lg);
}
/* Section animations */
.tree-section {
animation: slideInFromLeft 0.3s ease-out;
}
@keyframes slideInFromLeft {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
/* ============================================================================
AG GRID ROW STATE INDICATORS (DBeaver-style)
============================================================================
@component AGGridRowStates
@description Visual indicators for database row modification states
@purpose Show users which rows have been modified, added, or deleted
@related-js Row state management in app.js, database operations
@integration AG Grid Community Edition with custom row styling
@row-states
.ag-row-new - Newly added rows (green border/background)
.ag-row-modified - Modified existing rows (yellow border/background)
.ag-row-deleted - Deleted rows (red border/background + strikethrough)
@visual-indicators
- Color-coded left borders
- Background color changes on hover
- Cell-level emoji indicators (🆕📝🗑️)
- Status badges in pinned columns
@save-system
.changes-status - Displays change count and save availability
.save-changes - Save button with pulse animation when changes exist
@accessibility
- Color + icon combinations for color-blind users
- Clear visual distinction between states
- Animation feedback for user actions
============================================================================ */
/* AG Grid Row States for DBeaver-like functionality */
.ag-row.ag-row-new {
background-color: rgba(76, 175, 80, 0.1) !important;
border-left: 3px solid #4caf50 !important;
}
.ag-row.ag-row-new:hover {
background-color: rgba(76, 175, 80, 0.15) !important;
}
.ag-row.ag-row-modified {
background-color: rgba(255, 193, 7, 0.1) !important;
border-left: 3px solid #ffc107 !important;
}
.ag-row.ag-row-modified:hover {
background-color: rgba(255, 193, 7, 0.15) !important;
}
.ag-row.ag-row-deleted {
background-color: rgba(244, 67, 54, 0.1) !important;
border-left: 3px solid #f44336 !important;
text-decoration: line-through;
opacity: 0.7;
}
.ag-row.ag-row-deleted:hover {
background-color: rgba(244, 67, 54, 0.15) !important;
}
/* Row state indicators */
.ag-cell.ag-cell-new::before {
content: "🆕";
margin-right: 5px;
font-size: 0.8em;
}
.ag-cell.ag-cell-modified::before {
content: "📝";
margin-right: 5px;
font-size: 0.8em;
}
.ag-cell.ag-cell-deleted::before {
content: "🗑️";
margin-right: 5px;
font-size: 0.8em;
}
/* Changes status indicator */
.changes-status {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
background-color: var(--bg-tertiary);
border-radius: var(--border-radius);
font-size: 0.9em;
font-weight: 500;
}
.changes-status.has-changes {
background-color: rgba(255, 193, 7, 0.1);
color: #ffc107;
border: 1px solid rgba(255, 193, 7, 0.3);
}
.changes-status.no-changes {
color: var(--text-muted);
}
/* Save button enhanced states */
.btn.save-changes:disabled {
opacity: 0.5;
cursor: not-allowed;
background-color: var(--bg-secondary);
color: var(--text-muted);
}
.btn.save-changes:not(:disabled) {
background-color: #4caf50;
color: white;
border-color: #4caf50;
animation: pulse-save 2s infinite;
}
@keyframes pulse-save {
0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}
/* Table row number column with indicators */
.ag-pinned-left-cols-container .ag-row-new .ag-cell:first-child::after {
content: "NEW";
position: absolute;
right: 2px;
top: 50%;
transform: translateY(-50%);
background-color: #4caf50;
color: white;
font-size: 9px;
padding: 1px 3px;
border-radius: 2px;
font-weight: bold;
}
.ag-pinned-left-cols-container .ag-row-modified .ag-cell:first-child::after {
content: "MOD";
position: absolute;
right: 2px;
top: 50%;
transform: translateY(-50%);
background-color: #ffc107;
color: #333;
font-size: 9px;
padding: 1px 3px;
border-radius: 2px;
font-weight: bold;
}
/* ============================================================================
AG GRID ROW ACTION BUTTONS & DELETED ROWS
============================================================================
@component AG Grid Row Actions
@description Action buttons (edit, delete) and styling for deleted rows
@purpose Provide inline row actions and visual feedback for deleted rows
@related-js deleteRowFromGrid(), editRowFromGrid() in app.js
@structure
.row-actions (container)
├── .btn-action.btn-delete (delete button)
└── .btn-action.btn-edit (edit button)
@states
.ag-row-deleted - Styling for rows marked for deletion
@features
- Inline action buttons with hover effects
- Visual feedback for deleted rows (red background, strikethrough)
- Responsive button sizing
============================================================================ */
/* Action buttons container in AG Grid cells */
.row-actions {
display: flex;
gap: 4px;
align-items: center;
justify-content: center;
height: 100%;
}
/* Base styling for action buttons */
.btn-action {
background: none;
border: 1px solid transparent;
border-radius: 4px;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 12px;
transition: all 0.2s ease;
color: var(--text-secondary);
}
/* Delete button styling */
.btn-action.btn-delete {
color: var(--error-color);
}
.btn-action.btn-delete:hover {
background-color: var(--error-color);
color: white;
border-color: var(--error-color);
transform: scale(1.1);
}
/* Edit button styling */
.btn-action.btn-edit {
color: var(--info-color);
}
.btn-action.btn-edit:hover {
background-color: var(--info-color);
color: white;
border-color: var(--info-color);
transform: scale(1.1);
}
/* Actions cell styling */
.actions-cell {
padding: 0 !important;
}
/* Deleted row styling */
.ag-row-deleted {
background-color: rgba(244, 67, 54, 0.1) !important;
text-decoration: line-through;
opacity: 0.7;
}
.ag-row-deleted .ag-cell {
background-color: rgba(244, 67, 54, 0.1) !important;
color: var(--error-color) !important;
text-decoration: line-through;
}
.ag-row-deleted .row-actions .btn-action.btn-delete {
color: var(--error-color);
background-color: rgba(244, 67, 54, 0.2);
border-color: var(--error-color);
}
.ag-row-deleted .row-actions .btn-action.btn-edit {
opacity: 0.5;
cursor: not-allowed;
}
.ag-row-deleted .row-actions .btn-action.btn-edit:hover {
background: none;
color: var(--text-muted);
border-color: transparent;
transform: none;
}
/* Make sure deleted row styling overrides other row states */
.ag-row.ag-row-deleted {
background-color: rgba(244, 67, 54, 0.1) !important;
}
.ag-row.ag-row-deleted:hover {
background-color: rgba(244, 67, 54, 0.15) !important;
}
/* Context menu improvements for AG Grid */
.ag-menu {
border: 1px solid var(--border-color) !important;
background-color: var(--bg-secondary) !important;
box-shadow: var(--shadow-lg) !important;
}
.ag-menu-option {
color: var(--text-primary) !important;
background-color: transparent !important;
}
.ag-menu-option:hover {
background-color: var(--bg-hover) !important;
color: var(--text-primary) !important;
}
.ag-menu-separator {
border-color: var(--border-color) !important;
}
/* ============================================================================
CANCEL BUTTON & SAVE/CANCEL BUTTON STATES
============================================================================
@component Cancel Button
@description Styling for cancel changes button and button states
@purpose Provide visual feedback for save/cancel actions
@related-js cancelGridChanges(), markGridAsModified() in app.js
@states
.save-changes - Active save button with warning color
.cancel-changes - Active cancel button with danger color
@features
- Color-coded button states
- Hover effects for better UX
- Disabled state styling
============================================================================ */
/* Cancel button with danger color when active */
.btn.cancel-changes {
background-color: var(--error-color) !important;
border-color: var(--error-color) !important;
color: white !important;
}
.btn.cancel-changes:hover {
background-color: #d32f2f !important;
border-color: #d32f2f !important;
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}
/* Save button with warning color when active */
.btn.save-changes {
background-color: var(--warning-color) !important;
border-color: var(--warning-color) !important;
color: white !important;
}
.btn.save-changes:hover {
background-color: #f57c00 !important;
border-color: #f57c00 !important;
transform: translateY(-1px);
box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}
/* Disabled button state */
.btn:disabled {
opacity: 0.6 !important;
cursor: not-allowed !important;
transform: none !important;
box-shadow: none !important;
}
.btn:disabled:hover {
background-color: inherit !important;
border-color: inherit !important;
transform: none !important;
box-shadow: none !important;
}
/* ============================================================================
DRAG & DROP FUNCTIONALITY
============================================================================
@component Plugin Drag & Drop
@description Styles for drag and drop functionality in plugin items
@author Chahua Development Thailand
@version 1.2.0
@structure
.plugin-item
├── .plugin-info
│ ├── .tree-label
│ └── .plugin-meta
│ ├── .tree-badge.version
│ ├── .tree-meta.author
│ ├── .feature-badge.drag-drop
│ └── .feature-badge.direct-run
└── .plugin-drop-zone
└── .drop-indicator
├── .drop-icon
└── .drop-text
*/
/* Plugin item enhancements */
.plugin-item {
position: relative;
transition: all 0.3s ease;
}
.plugin-item.drag-over {
background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
border-left: 3px solid var(--primary-color);
transform: translateX(5px);
box-shadow: 0 4px 12px rgba(79, 172, 254, 0.2);
}
/* Plugin meta styling */
.plugin-meta {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
margin-top: 4px;
}
.plugin-meta .tree-meta.author {
font-size: 0.8em;
color: var(--text-muted);
font-style: italic;
}
/* Feature badges - Updated */
.feature-badge {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 8px;
border-radius: 16px;
font-size: 0.8em;
font-weight: 600;
text-align: center;
cursor: help;
transition: all 0.2s ease;
white-space: nowrap;
}
.feature-badge.drag-drop {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
color: white;
border: 1px solid transparent;
}
.feature-badge.drag-drop:hover {
background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
transform: scale(1.05);
}
.feature-badge.direct-run {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: 1px solid transparent;
}
.feature-badge.direct-run:hover {
background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
transform: scale(1.05);
}
.feature-badge.sql-dump {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
color: white;
border: 1px solid transparent;
}
.feature-badge.sql-dump:hover {
background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
transform: scale(1.05);
}
/* Plugin drop zone - Legacy (can be removed if not used) */
.plugin-drop-zone {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg, rgba(79, 172, 254, 0.9) 0%, rgba(0, 242, 254, 0.9) 100%);
border-radius: 8px;
z-index: 10;
-webkit-backdrop-filter: blur(5px);
backdrop-filter: blur(5px);
animation: dropZoneAppear 0.2s ease-out;
}
@keyframes dropZoneAppear {
from {
opacity: 0;
transform: scale(0.95);
}
to {
opacity: 1;
transform: scale(1);
}
}
/* Drop indicator */
.drop-indicator {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
color: white;
text-align: center;
padding: 10px;
}
.drop-icon {
font-size: 2em;
margin-bottom: 8px;
animation: bounce 2s infinite;
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-10px);
}
60% {
transform: translateY(-5px);
}
}
.drop-text {
font-size: 0.9em;
font-weight: 600;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
/* Version badge styling improvements */
.tree-badge.version {
background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
color: white;
font-weight: 700;
padding: 3px 8px;
border-radius: 12px;
font-size: 0.75em;
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* Plugin info layout improvements */
.plugin-info {
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
}
.plugin-info .tree-label {
font-weight: 600;
color: var(--text-primary);
margin-bottom: 2px;
}
/* Hover effects for plugin items */
.plugin-item:hover {
background: var(--hover-background);
border-radius: 6px;
}
.plugin-item:hover .feature-badge {
transform: scale(1.05);
}
.plugin-item:hover .tree-badge.version {
box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}
/* Responsive adjustments */
@media (max-width: 768px) {
.plugin-meta {
flex-direction: column;
align-items: flex-start;
gap: 4px;
}
.feature-badge {
font-size: 0.7em;
}
.drop-indicator {
padding: 8px;
}
.drop-icon {
font-size: 1.5em;
}
.drop-text {
font-size: 0.8em;
}
}
/* Dark theme adjustments */
.theme-dark .plugin-item.drag-over {
background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.2) 100%);
}
.theme-dark .feature-badge.drag-drop {
box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}
.theme-dark .feature-badge.direct-run {
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}
.theme-dark .tree-badge.version {
box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}