/* Global Theme Variables */
:root {
    /* Default Indigo Theme */
    --theme-bg: #f1f5f9;
    --theme-card-bg: rgba(255, 255, 255, 0.98);
    --theme-text: #1e293b;
    --theme-text-muted: #64748b;
    --theme-heading: #0f172a;
    --theme-card-border: rgba(0,0,0,0.06);
    --theme-border-alt: #f1f5f9;
    --theme-header-bg: rgba(255, 255, 255, 0.75);
    --theme-primary: #4F46E5;
    --theme-primary-hover: #4338CA;
    --theme-light: #eef2ff;
    --theme-border: #c7d2fe;
    --theme-gradient-start: #4f46e5;
    --theme-gradient-end: #3b82f6;
    --theme-alert: #fffbeb;
    --theme-alert-border: #fde68a;
    --theme-alert-text: #d97706;
}

/* Base Theme Application */
body {
    background: var(--theme-bg) !important;
    color: var(--theme-text) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Ensure headings inherit the theme color */
h1, h2, h3, h4, h5, h6 {
    color: var(--theme-heading);
}

/* Cards using global theme */
.card {
    background: var(--theme-card-bg);
    border-color: var(--theme-card-border);
}

/* Print Styles: Force light theme for PDFs regardless of user settings */
@media print {
    :root, html, body {
        --theme-bg: #ffffff !important;
        --theme-card-bg: #ffffff !important;
        --theme-text: #000000 !important;
        --theme-text-muted: #333333 !important;
        --theme-heading: #000000 !important;
        --theme-card-border: #cccccc !important;
        --theme-border-alt: #cccccc !important;
        --theme-header-bg: #ffffff !important;
        --theme-primary: #4F46E5 !important;
    }
    
    body {
        background: #ffffff !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Make sure specific elements we want to style follow the standard */
    .card { background: #ffffff !important; border: 1px solid #cccccc !important; box-shadow: none !important; }
    
    /* Keep table headers slightly gray */
    th, .dataTable-table th {
        background: #f1f5f9 !important;
        color: #000000 !important;
    }
    
    /* Ensure warnings and specific colors are preserved if needed by targeting them directly if they aren't using the vars, 
       but our global vars are now reset so everything looks standard white/black */
}
