/* COA Generator Web Interface Styles */

/* Enhanced Root Variables for Professional Design System */
:root {
    /* Science-Based Primary Color System - Research-Backed Blue for Optimal Trust & Engagement */
    --primary: #0071bc; /* Research blue - highest user trust, cognitive engagement */
    --primary-dark: #205493; /* Darker research blue - 7.1:1 contrast ratio */
    --primary-light: #4a9eff; /* Lighter variant for hover states */
    --primary-color: #0071bc; /* Legacy compatibility */
    
    /* Primary Blue Variations for Different Contexts */
    --primary-hover: #005a94;
    --primary-focus: #003d66;
    
    /* Grayscale System */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
    
    /* Strategic Accent Colors - Research-Based for Maximum Impact (10-15% usage) */
    --secondary: #64748b;
    --secondary-color: #64748b; /* Legacy compatibility */
    
    /* Success Green - Research-backed for positive reinforcement */
    --success: #00a6d2;
    --success-color: #00a6d2; /* Legacy compatibility */
    --success-dark: #007a9a;
    
    /* Warning Orange/Yellow - Non-critical alerts */
    --warning: #ff8c00;
    --warning-color: #ff8c00; /* Legacy compatibility */
    --warning-light: #ffb347;
    
    /* Critical Red - Research shows 31% action increase for CTAs */
    --danger: #e31c3d;
    --danger-color: #e31c3d; /* Legacy compatibility */
    --danger-dark: #b01530;
    
    /* Info - Maintain blue family consistency */
    --info-color: #0071bc;
    
    /* Professional Border System - Optimized for blue palette */
    --border-color: #e1e8ed;
    --border-light: #f0f4f7;
    --border-dark: #d1d9e0;
    
    /* Legacy Colors */
    --light-color: #f8fafc;
    --dark-color: #0f172a;
    
    /* Professional Design Tokens */
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.2s ease-in-out;
    
    /* Typography Scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    
    /* Dark Mode Color System - Research-Based Dark Gray vs Pure Black */
    --dark-bg: #323a45; /* Research dark gray - maintains visual hierarchy */
    --dark-bg-secondary: #2a323d;
    --dark-bg-tertiary: #1e262f;
    --dark-text: #ffffff; /* High contrast white text */
    --dark-text-secondary: #e2e8f0;
    --dark-text-muted: #a0aec0;
    
    /* Dark Mode Accent Colors - Desaturated for eye strain reduction */
    --dark-primary: #4a9eff;
    --dark-success: #4dd4ff;
    --dark-warning: #ffb84d;
    --dark-danger: #ff6b8a;
    
    /* Dark Mode Borders */
    --dark-border: #4a5568;
    --dark-border-light: #5a6478;
}

/* Professional Base Styles - Science-Based Color Psychology */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    font-size: 0.875rem;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode Implementation */
body.dark-mode {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

body.dark-mode .tab-content-area {
    background-color: var(--dark-bg-secondary);
}

body.dark-mode .card {
    background-color: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

body.dark-mode .professional-nav {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

body.dark-mode .professional-sidebar {
    background-color: var(--dark-bg-secondary);
    border-color: var(--dark-border);
}

/* Main Container Enhancement */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 0 1px var(--gray-200);
}

/* Enhanced Grid Layout System */
.grid-cols-1 { 
    display: grid; 
    grid-template-columns: repeat(1, minmax(0, 1fr)); 
    gap: 1.5rem; 
}
.grid-cols-2 { 
    display: grid; 
    grid-template-columns: repeat(2, minmax(0, 1fr)); 
    gap: 1.5rem; 
}
.grid-cols-3 { 
    display: grid; 
    grid-template-columns: repeat(3, minmax(0, 1fr)); 
    gap: 1.5rem; 
}
.grid-cols-4 { 
    display: grid; 
    grid-template-columns: repeat(4, minmax(0, 1fr)); 
    gap: 1.5rem; 
}

/* Professional Typography System */
.text-xs { font-size: var(--text-xs); line-height: 1.4; }
.text-sm { font-size: var(--text-sm); line-height: 1.4; }
.text-base { font-size: var(--text-base); line-height: 1.5; }
.text-lg { font-size: var(--text-lg); line-height: 1.6; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-gray-500 { color: var(--gray-500); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }

/* Professional Spacing */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }

/* Professional Navigation Styles */
.professional-nav {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    height: 60px;
    padding: 0 1.5rem;
}

/* Dark Mode Toggle Button */
.dark-mode-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.dark-mode-toggle:hover {
    background-color: var(--gray-50);
    color: var(--primary);
}

body.dark-mode .dark-mode-toggle {
    border-color: var(--dark-border);
    color: var(--dark-text-secondary);
}

body.dark-mode .dark-mode-toggle:hover {
    background-color: var(--dark-bg-tertiary);
    color: var(--dark-primary);
}

.professional-brand {
    color: var(--primary) !important;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
}

.professional-status {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.status-indicator {
    color: var(--success);
    font-size: 0.5rem;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

body.dark-mode .status-indicator {
    color: var(--dark-success);
}

.header-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
}

/* Professional Main Layout */
.main-content {
    display: flex;
    height: calc(100vh - 60px);
}

/* Professional Sidebar */
.professional-sidebar {
    width: 260px;
    background-color: white;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0.75rem;
    position: sticky;
    top: 0;
    height: 100%;
    overflow-y: auto;
}

.professional-sidebar .nav-pills .nav-link {
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    margin-bottom: 0.25rem;
    border: none;
}

.professional-sidebar .nav-pills .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.875rem;
}

.professional-sidebar .nav-pills .nav-link:hover {
    background-color: var(--gray-50);
    color: var(--primary);
    transform: translateX(2px);
}

.professional-sidebar .nav-pills .nav-link.active {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(0, 113, 188, 0.25);
}

body.dark-mode .professional-sidebar .nav-pills .nav-link.active {
    background-color: var(--dark-primary);
    color: var(--dark-bg);
    box-shadow: 0 2px 4px rgba(74, 158, 255, 0.25);
}

body.dark-mode .professional-sidebar .nav-pills .nav-link {
    color: var(--dark-text-secondary);
}

body.dark-mode .professional-sidebar .nav-pills .nav-link:hover {
    background-color: var(--dark-bg-tertiary);
    color: var(--dark-primary);
}

.professional-sidebar .nav-pills .nav-link.active:hover {
    transform: none;
}

/* Professional Content Area */
.tab-content-area {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background-color: var(--gray-50);
}

.tab-pane {
    min-height: calc(100vh - 120px);
}

@media (max-width: 992px) {
    .tab-content-area {
        padding: 1rem;
    }
}

/* Legacy Navigation Support */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
}

.navbar-brand i {
    color: #ffd700;
}

/* Compact Professional Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    margin-bottom: 1rem;
    background: white;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0 !important;
    border: none;
    padding: 0.875rem 1rem;
    font-size: var(--text-sm);
}

@media (min-width: 768px) {
    .card-header {
        padding: 1rem 1.25rem;
    }
}

/* Dark Mode Card Headers - Maintain Science-Based Blue Psychology */
body.dark-mode .card-header {
    background: linear-gradient(135deg, var(--dark-primary), var(--primary-dark));
    color: var(--dark-bg);
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

.card-body {
    padding: 1rem;
}

@media (min-width: 768px) {
    .card-body {
        padding: 1.25rem;
    }
}

/* Professional Compact Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 113, 188, 0.15);
    outline: none;
}

/* Dark Mode Form Controls - WCAG AAA Compliance */
body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: var(--dark-bg-tertiary);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    border-color: var(--dark-primary);
    box-shadow: 0 0 0 0.2rem rgba(74, 158, 255, 0.15);
    background-color: var(--dark-bg-secondary);
}

body.dark-mode .form-label {
    color: var(--dark-text-secondary);
}

body.dark-mode .form-text {
    color: var(--dark-text-muted);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
}

.form-text {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Professional Compact Buttons */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    transition: var(--transition);
    border: 1px solid transparent;
    font-size: 0.875rem;
    line-height: 1.4;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Science-Based Button Colors for Optimal Action Response */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 113, 188, 0.3);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
    border-color: var(--success-dark);
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 166, 210, 0.3);
}

/* Critical Action Red - Research shows 31% increase in immediate action */
.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.75rem rgba(227, 28, 61, 0.3);
}

/* Dark Mode Button Styles */
body.dark-mode .btn-primary {
    background: var(--dark-primary);
    border-color: var(--dark-primary);
}

body.dark-mode .btn-success {
    background: var(--dark-success);
    border-color: var(--dark-success);
    color: var(--dark-bg);
}

body.dark-mode .btn-danger {
    background: var(--dark-danger);
    border-color: var(--dark-danger);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #0aa2c0);
}

.btn-info:hover {
    background: linear-gradient(135deg, #0aa2c0, var(--info-color));
    transform: translateY(-2px);
}

/* Progress Bar Enhancements */
.progress {
    height: 1.5rem;
    border-radius: var(--border-radius);
    background-color: #e9ecef;
    box-shadow: inset 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.progress-bar {
    background: linear-gradient(135deg, var(--success-color), #20c997);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Log Container Styles */
.log-container {
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e9ecef;
}

.log-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.log-entry .timestamp {
    color: var(--secondary-color);
    font-weight: 600;
    margin-right: 0.5rem;
}

.log-entry .message {
    color: var(--dark-color);
}

.log-entry.error .timestamp,
.log-entry.error .message {
    color: var(--danger-color);
}

.log-entry.success .timestamp,
.log-entry.success .message {
    color: var(--success-color);
}

.log-entry.warning .timestamp,
.log-entry.warning .message {
    color: #f57c00;
}

.log-entry.info .timestamp,
.log-entry.info .message {
    color: var(--info-color);
}

/* Results Section Styles */
.result-item {
    background-color: white;
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.result-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.result-item.success {
    border-color: var(--success-color);
    background-color: #f0fff4;
}

.result-item.error {
    border-color: var(--danger-color);
    background-color: #fff5f5;
}

.result-item .sample-id {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--primary-color);
}

.result-item .status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-item .status-badge.success {
    background-color: var(--success-color);
    color: white;
}

.result-item .status-badge.error {
    background-color: var(--danger-color);
    color: white;
}

.result-item .file-info {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
}

.result-item .download-btn {
    background: linear-gradient(135deg, var(--primary-color), #0a58ca);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: var(--transition);
}

.result-item .download-btn:hover {
    background: linear-gradient(135deg, #0a58ca, var(--primary-color));
    transform: translateY(-1px);
}

/* Dual File Display Styles - Professional UX for PDF + CSV */
.dual-file-display {
    margin-top: 0.75rem;
}

.dual-file-display .files-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}

.dual-file-display .files-header .badge {
    font-size: 0.75rem;
    font-weight: 500;
}

.file-card {
    background: linear-gradient(135deg, var(--gray-50), #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    min-height: 4rem;
}

.file-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0, 113, 188, 0.1);
    transform: translateY(-1px);
}

.file-card.pdf-file:hover {
    border-color: #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.1);
}

.file-card.csv-file:hover {
    border-color: #198754;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.1);
}

.file-card .file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-card .file-details {
    flex-grow: 1;
    min-width: 0;
}

.file-card .file-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card .file-size {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.file-card .btn {
    flex-shrink: 0;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-actions {
    text-align: center;
}

.download-both-btn {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.download-both-btn:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
}

/* Single File Display Enhancement */
.single-file-display .file-info-details {
    flex-grow: 1;
}

.single-file-display .file-info-details .d-flex {
    align-items: center;
}

.single-file-display .text-muted.small {
    font-size: 0.8rem;
}

/* Dark Mode Support for File Cards */
.dark-mode .file-card {
    background: linear-gradient(135deg, var(--dark-card), #2d3748);
    border-color: var(--dark-border);
    color: var(--dark-text);
}

.dark-mode .file-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.2);
}

.dark-mode .file-card .file-name {
    color: var(--dark-text);
}

.dark-mode .file-card .file-size {
    color: var(--dark-text-muted);
}

.dark-mode .download-both-btn:hover {
    background-color: var(--dark-card);
    border-color: var(--dark-border);
}

/* Navigation Alert Styles - Enhanced UX for Success/Warning Toasts */
.success-message-content,
.warning-message-content {
    font-size: 0.9rem;
}

.navigation-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.view-results-btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-results-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.success-message-content .view-results-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.warning-message-content .view-results-btn:hover {
    background-color: rgba(33, 37, 41, 0.1);
    border-color: rgba(33, 37, 41, 0.2);
}

.text-light-emphasis,
.text-dark-emphasis {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Dark Mode Support for Navigation Alerts */
.dark-mode .warning-message-content .view-results-btn {
    border-color: var(--dark-text);
    color: var(--dark-text);
}

.dark-mode .warning-message-content .view-results-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
}

/* History Section Styles */
.history-item {
    background-color: white;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.history-item .timestamp {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.history-item .samples {
    font-weight: 600;
    color: var(--primary-color);
}

/* Configuration Modal Styles */
.config-section {
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.config-section h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.config-item:last-child {
    border-bottom: none;
}

.config-item .label {
    font-weight: 600;
    color: var(--dark-color);
}

.config-item .value {
    color: var(--secondary-color);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.config-item .value.configured {
    color: var(--success-color);
}

.config-item .value.missing {
    color: var(--danger-color);
}

/* Toast Enhancements */
.toast {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-lg);
}

/* Professional Mobile-First Responsive Design */
@media (max-width: 992px) {
    .professional-sidebar {
        position: fixed;
        top: 60px;
        left: -260px;
        z-index: 1000;
        transition: left 0.3s ease;
        height: calc(100vh - 60px);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }
    
    .professional-sidebar.show {
        left: 0;
    }
    
    .tab-content-area {
        width: 100%;
        padding: 1rem 0.75rem;
    }
    
    .main-content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    .professional-nav {
        padding: 0 1rem;
    }
    
    .professional-brand {
        font-size: 1.125rem;
    }
    
    .card-body {
        padding: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .log-container {
        max-height: 200px;
        font-size: 0.75rem;
    }
    
    .metric-card {
        padding: 0.875rem;
    }
    
    .metric-value {
        font-size: 1.375rem;
    }
    
    /* Enhanced mobile touch targets */
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .form-control, .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .nav-link {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 576px) {
    .tab-content-area {
        padding: 0.75rem 0.5rem;
    }
    
    .card {
        margin-bottom: 0.75rem;
    }
    
    .professional-nav {
        height: 56px;
        padding: 0 0.75rem;
    }
    
    .main-content {
        height: calc(100vh - 56px);
    }
    
    .professional-sidebar {
        top: 56px;
        height: calc(100vh - 56px);
    }
}

@media (max-width: 1024px) {
    .grid-cols-3, .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States */
.status-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.status-icon.success {
    background-color: var(--success-color);
    color: white;
}

.status-icon.error {
    background-color: var(--danger-color);
    color: white;
}

.status-icon.warning {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), #0a58ca);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(135deg, var(--primary-color), #0a58ca) 1;
}

/* Custom Scrollbar */
.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Enhanced Status Badges */
.badge {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-primary {
    background: rgba(0, 113, 188, 0.1);
    color: var(--primary);
}

body.dark-mode .badge-primary {
    background: rgba(74, 158, 255, 0.2);
    color: var(--dark-primary);
}

body.dark-mode .badge-success {
    background: rgba(77, 212, 255, 0.2);
    color: var(--dark-success);
}

body.dark-mode .badge-warning {
    background: rgba(255, 184, 77, 0.2);
    color: var(--dark-warning);
}

/* Enhanced Metric Cards */
.metric-card {
    text-align: center;
    padding: 1.5rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Enhanced Progress Bars */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Enhanced Tables */
.table {
    font-size: 0.875rem;
}

.table thead th {
    border-bottom: 2px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-700);
    background: var(--gray-50);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Professional Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-color);
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    line-height: 1.6;
}

/* Section Headers */
.section-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

/* Advanced Controls */
.advanced-section {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 1rem;
    background: var(--gray-50);
    margin-top: 1rem;
}

.advanced-section.hidden {
    display: none;
}

/* Focus States for Accessibility */
.form-control:focus,
.btn:focus,
.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Debug Log Component Styles */
.debug-log-container {
    background-color: #1e1e1e;
    color: #f8f8f2;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.debug-log-entry {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #44475a;
    display: flex;
    align-items: flex-start;
    font-size: 0.75rem;
    word-wrap: break-word;
    transition: background-color 0.2s ease;
}

.debug-log-entry:hover {
    background-color: #282a36;
}

.debug-log-entry:last-child {
    border-bottom: none;
}

.debug-timestamp {
    color: #6272a4;
    font-weight: 600;
    margin-right: 0.75rem;
    white-space: nowrap;
    min-width: 80px;
    font-size: 0.65rem;
}

.debug-level {
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6rem;
    margin-right: 0.5rem;
    min-width: 60px;
    text-align: center;
    text-transform: uppercase;
}

.debug-level.DEBUG {
    background-color: #6272a4;
    color: white;
}

.debug-level.INFO {
    background-color: #50fa7b;
    color: #282a36;
}

.debug-level.WARNING {
    background-color: #ffb86c;
    color: #282a36;
}

.debug-level.ERROR {
    background-color: #ff5555;
    color: white;
}

.debug-logger {
    color: #8be9fd;
    margin-right: 0.5rem;
    font-size: 0.65rem;
    min-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.debug-message {
    color: #f8f8f2;
    flex: 1;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.debug-location {
    color: #bd93f9;
    font-size: 0.6rem;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* Debug Log Controls */
.debug-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.debug-auto-refresh.active {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
}

/* Debug Log Custom Scrollbar */
.debug-log-container::-webkit-scrollbar {
    width: 8px;
}

.debug-log-container::-webkit-scrollbar-track {
    background: #44475a;
}

.debug-log-container::-webkit-scrollbar-thumb {
    background: #6272a4;
    border-radius: 4px;
}

.debug-log-container::-webkit-scrollbar-thumb:hover {
    background: #8be9fd;
}

/* Debug Mode Toggle Animation */
#debugLogCard {
    transition: all 0.3s ease;
}

#debugLogCard.show {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

/* Empty Debug Log State */
.debug-log-empty {
    padding: 2rem;
    text-align: center;
    color: #6272a4;
    background-color: #1e1e1e;
}

.debug-log-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Enhanced High Contrast Mode Support - WCAG AAA Compliance */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--primary-dark);
    }
    
    .btn {
        border: 2px solid currentColor;
        font-weight: 600;
    }
    
    .form-control {
        border: 2px solid var(--primary-dark);
    }
    
    .debug-log-container {
        border: 2px solid var(--primary-dark);
    }
    
    /* Enhanced contrast for critical elements */
    .btn-danger {
        background: #c41e3a;
        border: 2px solid #8b0000;
    }
    
    .status-indicator {
        box-shadow: 0 0 0 2px white;
    }
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
    
    .status-indicator {
        animation: none;
    }
}