/* Themes CSS */

/* Dark Theme */
[data-theme="dark"] {
    /* Dark theme colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-heavy: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    
    /* Sidebar in dark theme */
    --sidebar-bg: #020617;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f8fafc;
    --sidebar-hover: #1e293b;
}

/* Theme toggle button icon changes */
[data-theme="light"] #themeToggle .fas {
    content: "\f186"; /* moon icon */
}

[data-theme="dark"] #themeToggle .fas {
    content: "\f185"; /* sun icon */
}

[data-theme="dark"] #themeToggle .fas::before {
    content: "\f185"; /* sun icon */
}

/* Scrollbar styling for dark theme */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* Light theme scrollbar */
[data-theme="light"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="light"] ::-webkit-scrollbar-track {
    background: #f1f5f9;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Code blocks and syntax highlighting */
[data-theme="dark"] code {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

[data-theme="light"] code {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Selection colors */
[data-theme="dark"] ::selection {
    background: rgba(37, 99, 235, 0.3);
    color: var(--text-primary);
}

[data-theme="light"] ::selection {
    background: rgba(37, 99, 235, 0.2);
    color: var(--text-primary);
}

/* Focus styles for better accessibility */
[data-theme="dark"] *:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

[data-theme="light"] *:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Chart colors for different themes */
[data-theme="dark"] .chart-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

[data-theme="light"] .chart-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* Tooltip styling */
.tooltip {
    position: absolute;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    font-size: var(--font-size-sm);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tooltip.show {
    opacity: 1;
}

/* Print styles */
@media print {
    .sidebar,
    .header-actions,
    .notifications-panel {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .page-content {
        padding: 0 !important;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-muted: #333333;
    }
    
    [data-theme="dark"] {
        --border-color: #ffffff;
        --text-muted: #cccccc;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .preloader {
        display: none !important;
    }
}

/* System theme preference */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --border-color: #334155;
        --sidebar-bg: #020617;
        --sidebar-text: #94a3b8;
        --sidebar-text-active: #f8fafc;
        --sidebar-hover: #1e293b;
    }
}

/* Custom properties for theme transitions */
.theme-transition {
    transition: 
        background-color var(--transition-normal),
        color var(--transition-normal),
        border-color var(--transition-normal),
        box-shadow var(--transition-normal);
}

/* Apply theme transition to all elements */
* {
    transition: 
        background-color var(--transition-fast),
        color var(--transition-fast),
        border-color var(--transition-fast);
} 