/* =================================
   dat_analysis.css
   Standalone file with built-in
   light/dark mode support.
   ================================= */

/* =================================
    CSS VARIABLES (Light & Dark Mode)
    Copied from omniscope.css
    ================================= */
:root {
    /* Light Mode */
    --body-background: #f8f8f8;
    --main-text-color: #333;
    --sidebar-border-color: #ccc;
    --sidebar-header-color: #333;
    --sidebar-link-color: #0066cc;
    --sidebar-link-hover-color: #005fa3;
    --sidebar-link-hover-background: #f0f8ff;
    --sidebar-link-selected-color: #004c87;
    --sidebar-link-selected-background: #e6f3ff;
    --collapsible-header-background: #f7f7f7;
    --collapsible-header-hover-background: #eee;
    --table-background: #fff;
    --table-text-color: #333;
    --table-border-color: #ddd;
    --table-header-background: #f2f2f2;
    --table-row-even-background: #fafafa;
    --table-row-hover-background: #f1f1f1;
    --status-not-started-background: #f8d7da;
    --status-in-progress-background: #fff3cd;
    --status-complete-background: #d4edda;
    --button-bg-color: #3498db;
    --button-text-color: white;
    --button-hover-bg-color: #2980b9;
    --button-hover-text-color: white;
}

/* Dark Mode - Activated by System Preference or Manual Toggle */
@media (prefers-color-scheme: dark) {
    :root {
        --body-background: #1a1a1a;
        --main-text-color: #e0e0e0;
        --sidebar-border-color: #444;
        --sidebar-header-color: #e0e0e0;
        --sidebar-link-color: #79a1d1;
        --sidebar-link-hover-color: #62707D;
        --sidebar-link-hover-background: #2a2a2a;
        --sidebar-link-selected-color: #79a1d1;
        --sidebar-link-selected-background: #333;
        --collapsible-header-background: #222;
        --collapsible-header-hover-background: #333;
        --table-background: #2a2a2a;
        --table-text-color: #e0e0e0;
        --table-border-color: #444;
        --table-header-background: #333;
        --table-row-even-background: #2a2a2a;
        --table-row-hover-background: #3a3a3a;
        --status-not-started-background: #5f3e41;
        --status-in-progress-background: #6a6344;
        --status-complete-background: #405744;
        --dark-mode-button-bg: #44687d;
        --dark-mode-button-text: #e0e0e0;
        --dark-mode-button-hover-bg: #5f8093;
        --dark-mode-button-hover-text: #fff;
    }
}

body[data-theme='dark'] {
    --body-background: #1a1a1a;
    --main-text-color: #e0e0e0;
    --sidebar-border-color: #444;
    --sidebar-header-color: #e0e0e0;
    --sidebar-link-color: #79a1d1;
    --sidebar-link-hover-color: #62707D;
    --sidebar-link-hover-background: #2a2a2a;
    --sidebar-link-selected-color: #79a1d1;
    --sidebar-link-selected-background: #333;
    --collapsible-header-background: #222;
    --collapsible-header-hover-background: #333;
    --table-background: #2a2a2a;
    --table-text-color: #e0e0e0;
    --table-border-color: #444;
    --table-header-background: #333;
    --table-row-even-background: #2a2a2a;
    --table-row-hover-background: #3a3a3a;
    --status-not-started-background: #5f3e41;
    --status-in-progress-background: #6a6344;
    --status-complete-background: #405744;
    --dark-mode-button-bg: #44687d;
    --dark-mode-button-text: #e0e0e0;
    --dark-mode-button-hover-bg: #5f8093;
    --dark-mode-button-hover-text: #fff;
}
.header-spacer {
  height: 80px; /* Must match the header's height */
}
/* =================================
   Core dat_analysis styles
   ================================= */
body {
    background-color: var(--body-background);
    color: var(--main-text-color);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    margin: 20px;
}

h1 {
    color: var(--main-text-color);
}

h2 {
    margin-top: 30px;
    border-bottom: 1px solid var(--sidebar-border-color);
    padding-bottom: 5px;
    color: var(--main-text-color);
}

table {
    border-collapse: collapse;
    margin-top: 10px;
    margin-bottom: 20px; /* Add this line to create space after tables */
    font-size: 0.9em;
    background-color: var(--table-background);
    color: var(--table-text-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, color 0.3s ease;
    table-layout: auto;
}

th, td {
    border: 1px solid var(--table-border-color);
    padding: 8px 10px;
    text-align: left;
    vertical-align: middle;
}

th {
    background-color: var(--table-header-background);
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: var(--table-row-even-background);
}

tr:hover {
    background-color: var(--table-row-hover-background);
}

a {
    color: var(--sidebar-link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: var(--sidebar-link-hover-color);
}

p {
    color: var(--main-text-color);
}