:root {
    /* University of Dubuque Colors */
    --ud-blue: #1c3c75;
    --ud-blue-light: #2a4d8a;
    --ud-blue-dark: #152f5f;
    --ud-white: #ffffff;
    --ud-gray-light: #f8f9fa;
    --ud-gray: #e9ecef;
    --ud-gray-dark: #6c757d;
    
    /* Theme Colors - Light Mode */
    --primary-color: var(--ud-blue);
    --secondary-color: var(--ud-blue-light);
    --accent-color: var(--ud-blue-dark);
    --background-color: var(--ud-white);
    --surface-color: var(--ud-gray-light);
    /* Aliases used throughout components */
    --background: var(--background-color);
    --background-elevated: var(--surface-color);
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: var(--ud-gray);
    --shadow-color: rgba(28, 60, 117, 0.1);
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --primary-color: #4a6ba3;
    --secondary-color: #5a7ab3;
    --accent-color: var(--ud-blue-light);
    --background-color: #121212;
    --surface-color: #1e1e1e;
    /* Aliases used throughout components */
    --background: var(--background-color);
    --background-elevated: var(--surface-color);
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #333333;
    --shadow-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: var(--ud-white);
    margin-bottom: 30px;
    padding: 30px 0;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--ud-white);
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.content {
    background: var(--ud-white);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px var(--shadow-color);
    margin-bottom: 20px;
    animation: fadeIn 0.5s ease-in;
}

[data-theme="dark"] .content {
    background: var(--surface-color);
}

/* Global link styling — content links only */
.content a:link, .content a:visited,
.card a:link, .card a:visited,
ol a:link, ol a:visited,
ul a:link, ul a:visited,
p a:link, p a:visited,
td a:link, td a:visited {
    color: #5a9fd4;
    text-decoration: none;
    transition: color 0.2s ease;
}

.content a:hover, .content a:active,
.card a:hover, .card a:active,
ol a:hover, ol a:active,
ul a:hover, ul a:active,
p a:hover, p a:active,
td a:hover, td a:active {
    color: #7db8e0;
    text-decoration: underline;
}

[data-theme="dark"] .content a:link, [data-theme="dark"] .content a:visited,
[data-theme="dark"] .card a:link, [data-theme="dark"] .card a:visited,
[data-theme="dark"] ol a:link, [data-theme="dark"] ol a:visited,
[data-theme="dark"] ul a:link, [data-theme="dark"] ul a:visited,
[data-theme="dark"] p a:link, [data-theme="dark"] p a:visited,
[data-theme="dark"] td a:link, [data-theme="dark"] td a:visited {
    color: #7db8e0;
}

[data-theme="dark"] .content a:hover, [data-theme="dark"] .content a:active,
[data-theme="dark"] .card a:hover, [data-theme="dark"] .card a:active,
[data-theme="dark"] ol a:hover, [data-theme="dark"] ol a:active,
[data-theme="dark"] p a:hover, [data-theme="dark"] p a:active {
    color: #a8d4f0;
}

/* PubMed / DOI reference links — always coordinated */
a[href*="pubmed"],
a[href*="doi.org"] {
    color: #5a9fd4 !important;
    font-size: 0.9em;
    font-weight: 600;
}

[data-theme="dark"] a[href*="pubmed"],
[data-theme="dark"] a[href*="doi.org"] {
    color: #7db8e0 !important;
}

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

/* Floating Back Button (universal) */
.back-button-floating {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1000;
    background: var(--primary-color);
    color: #fff !important;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 9999px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.back-button-floating:hover,
.back-button-floating:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.25);
    background: var(--secondary-color);
    outline: none;
}
.back-button-floating:active {
    transform: translateY(0);
}
@media print {
    .back-button-floating { display: none !important; }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.card {
    background: var(--surface-color);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

[data-theme="dark"] .card {
    background: #2a2a2a;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.card ul {
    list-style: none;
    padding-left: 0;
}

.card li {
    margin: 8px 0;
    padding-left: 20px;
    position: relative;
    color: var(--text-secondary);
}

.card li::before {
    content: "🔑";
    position: absolute;
    left: 0;
}

.card li strong {
    color: var(--text-color);
}

/* Navigation Buttons */
.nav-buttons {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-button {
    background: var(--secondary-color);
    color: var(--ud-white);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-color);
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-button:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.nav-button.home {
    background: linear-gradient(135deg, #00b894, #00a085);
}

.nav-button.theme {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

/* Print Button Styles */
.print-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: var(--ud-white);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px;
}

.print-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.print-button:before {
    content: "🖨️";
}

/* Treatment Protocols */
.treatment-protocol {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--ud-white);
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
}

.protocol-step {
    background: rgba(255,255,255,0.95);
    color: #333;
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    border-left: 5px solid var(--accent-color);
    font-weight: 600;
}

.step-number {
    background: var(--accent-color);
    color: var(--ud-white);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

/* Interactive Elements */
.interactive-demo {
    background: var(--ud-gray);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

[data-theme="dark"] .interactive-demo {
    background: #2a2a2a;
}

.slider-container {
    margin: 15px 0;
}

.slider {
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
}

.result-display {
    background: var(--primary-color);
    color: var(--ud-white);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
}

/* Tables */
.correction-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.correction-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 600;
}

.correction-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

[data-theme="dark"] .correction-table td {
    border-bottom-color: #444;
    background: var(--surface-color);
}

/* Print-specific styles */
@media print {
    /* Reset body styling for print */
    body {
        background: white !important;
        color: black !important;
        font-family: 'Times New Roman', serif !important;
        font-size: 12pt;
        line-height: 1.4;
        margin: 0;
        padding: 0;
    }

    /* Hide interactive elements */
    .nav-buttons,
    .print-button,
    .theme-toggle,
    button,
    .interactive-demo,
    .slider-container {
        display: none !important;
    }

    /* Page setup */
    @page {
        size: letter;
        margin: 1in 0.75in 1.25in 0.75in;
        
        @top-right {
        	content: "Copyright 2025 Andrew Bland MD";
    		font-family: 'Times New Roman', serif;
    		font-size: 9pt;
}
        
        @top-center {
            content: "University of Dubuque - Nephrology Lectures";
            font-family: 'Times New Roman', serif;
            font-size: 10pt;
            font-weight: bold;
        }
        
        @bottom-left {
            content: "Andrew Bland MD";
            font-family: 'Times New Roman', serif;
            font-size: 9pt;
        }
        
        @bottom-center {
            content: "For Educational Use Only";
            font-family: 'Times New Roman', serif;
            font-size: 9pt;
            font-style: italic;
            font-weight: bold;
        }
        
        @bottom-right {
            content: "Andrew Bland MD Page " counter(page) " of " counter(pages);
            font-family: 'Times New Roman', serif;
            font-size: 9pt;
        }
    }

    /* Container and content styling */
    .container {
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .header {
        background: none !important;
        color: black !important;
        text-align: center;
        margin-bottom: 20pt;
        padding: 0 !important;
        border-bottom: 2pt solid #1c3c75;
        page-break-after: avoid;
    }

    .header h1 {
        font-size: 18pt !important;
        font-weight: bold;
        margin-bottom: 6pt;
        color: #1c3c75 !important;
        text-shadow: none !important;
    }

    .header p {
        font-size: 12pt !important;
        margin-bottom: 12pt;
        color: black !important;
        opacity: 1 !important;
    }

    .content {
        background: white !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 0 12pt 0 !important;
        page-break-inside: avoid;
    }

    /* Headings */
    h1 { 
        font-size: 16pt !important; 
        font-weight: bold; 
        margin: 16pt 0 8pt 0;
        color: #1c3c75 !important;
        page-break-after: avoid;
    }
    
    h2 { 
        font-size: 14pt !important; 
        font-weight: bold; 
        margin: 14pt 0 6pt 0;
        color: #1c3c75 !important;
        page-break-after: avoid;
    }
    
    h3 { 
        font-size: 12pt !important; 
        font-weight: bold; 
        margin: 12pt 0 4pt 0;
        color: #1c3c75 !important;
        page-break-after: avoid;
    }

    h4, h5, h6 {
        font-size: 11pt !important;
        font-weight: bold;
        margin: 10pt 0 3pt 0;
        color: #1c3c75 !important;
        page-break-after: avoid;
    }

    /* Cards and grids */
    .grid {
        display: block !important;
        margin: 12pt 0 !important;
    }

    .card {
        background: white !important;
        border: 1pt solid #1c3c75 !important;
        border-radius: 0 !important;
        padding: 8pt !important;
        margin: 6pt 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        border-left: 3pt solid #1c3c75 !important;
    }

    .card h3 {
        color: #1c3c75 !important;
        border-bottom: 1pt solid #1c3c75 !important;
        padding-bottom: 3pt !important;
        margin-bottom: 6pt !important;
    }

    /* Lists */
    ul, ol {
        margin: 6pt 0 6pt 18pt !important;
        padding: 0 !important;
    }

    li {
        margin: 3pt 0 !important;
        line-height: 1.3 !important;
        color: black !important;
    }

    .card li::before {
        content: "• " !important;
        font-weight: bold;
        color: #1c3c75 !important;
    }

    /* Tables */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 12pt 0 !important;
        font-size: 10pt !important;
        page-break-inside: avoid;
    }

    th {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1pt solid #1c3c75 !important;
        padding: 6pt !important;
        font-weight: bold !important;
        text-align: center !important;
    }

    td {
        border: 1pt solid #1c3c75 !important;
        padding: 6pt !important;
        text-align: center !important;
        background: white !important;
        color: black !important;
    }

    /* Treatment protocols */
    .treatment-protocol {
        background: #f8f9fa !important;
        border: 2pt solid #1c3c75 !important;
        color: black !important;
        padding: 12pt !important;
        margin: 12pt 0 !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }

    .protocol-step {
        background: white !important;
        color: black !important;
        padding: 8pt !important;
        margin: 6pt 0 !important;
        border-left: 3pt solid #1c3c75 !important;
        border-radius: 0 !important;
    }

    .step-number {
        background: #1c3c75 !important;
        color: white !important;
        display: inline-block !important;
        width: 18pt !important;
        height: 18pt !important;
        text-align: center !important;
        line-height: 18pt !important;
        border-radius: 50% !important;
        margin-right: 6pt !important;
        font-size: 9pt !important;
        font-weight: bold !important;
    }

    /* Page breaks */
    .page-break-before {
        page-break-before: always;
    }

    .page-break-after {
        page-break-after: always;
    }

    .no-page-break {
        page-break-inside: avoid;
    }

    /* Links */
    a {
        color: #1c3c75 !important;
        text-decoration: underline !important;
    }

    a:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    /* Strong emphasis */
    strong, b {
        font-weight: bold !important;
        color: #1c3c75 !important;
    }

    /* Ensure proper spacing */
    p {
        margin: 6pt 0 !important;
        text-align: justify !important;
    }

    /* Print footer content */
    .print-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40pt;
        border-top: 1pt solid #1c3c75;
        background: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6pt 12pt;
        font-size: 9pt;
        font-family: 'Times New Roman', serif;
    }
}

/* Add this at the end of your existing CSS - won't affect current styling */

@media print {
    /* Your existing print styles remain unchanged */
    
    /* Only add this for the dynamic footers */
    .dynamic-print-footer {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Gentle page breaks at natural content boundaries */
    .grid {
        page-break-after: always;
    }
    
    .grid:last-child {
        page-break-after: auto;
    }
    
    /* Ensure major content sections can break */
    .content > div:not(.header) {
        page-break-inside: avoid;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .header h1 { font-size: 2rem; }
    .grid { grid-template-columns: 1fr; }
    .theme-toggle {
        position: static;
        margin: 10px auto;
        display: block;
    }
    .nav-buttons {
        flex-direction: column;
        align-items: center;
    }
    .nav-button {
        width: 200px;
        justify-content: center;
    }
    .print-button {
        width: 180px;
        justify-content: center;
    }
}


/* --- Global Navigation (2025 UDPA) --- */
.top-nav { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-bottom:1px solid var(--border-color); background: var(--background); position: sticky; top: 0; z-index: 100; }
.top-nav .brand { font-weight:800; color:var(--primary-color); text-decoration:none; }
.top-nav .nav-links { display:flex; gap:12px; }
.top-nav .nav-links a { text-decoration:none; color:var(--text-color); padding:6px 10px; border-radius:8px; }
.top-nav .nav-links a:hover { background:var(--background-elevated); }
.nav-toggle { display:none; background:none; border:none; font-size:1.25rem; cursor:pointer; }
@media (max-width: 820px) {
  .nav-toggle { display:block; }
  .nav-links { display:none; flex-direction:column; gap:8px; padding:10px 0; }
  .nav-links.open { display:flex; }
}

/* --- Sections & Hero --- */
.section { padding: 32px 0; }
.hero { text-align:center; padding: 32px 0; }
.hero .sub { opacity:.8; margin-top:8px; }
.cta-row { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin: 12px 0 8px; }
.btn { display:inline-block; padding: 8px 14px; border:1px solid var(--border-color); border-radius:10px; text-decoration:none; color:var(--text-color); background: var(--background); }
.btn:hover { background: var(--background-elevated); }
.btn-primary { background: var(--primary-color); color:#fff; border-color: var(--primary-color); }
.btn-primary:hover { filter: brightness(0.95); }

/* --- Chips & Quick Links --- */
.chip { display:inline-block; padding:6px 10px; border-radius: 999px; background: var(--background-elevated); border:1px solid var(--border-color); text-decoration:none; color: var(--text-color); margin: 4px; }
.quick-links { display:flex; flex-wrap:wrap; gap:8px; }

/* --- UDPA Quickbar --- */
.udpa-quickbar { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; padding:8px; background:var(--background-elevated); border-radius:12px; margin: 8px 0 16px; }
.udpa-quickbar a { text-decoration:none; padding:6px 10px; border-radius:8px; background: var(--background); border:1px solid var(--border-color); color: var(--text-color); }
.udpa-quickbar a:hover { background: var(--background-elevated); }

/* --- Search --- */
.search-box { display:flex; justify-content:center; margin: 8px 0 16px; }
.search-box input { width:min(800px, 92%); padding:10px 12px; border:1px solid var(--border-color); border-radius:12px; }
.search-hit { outline: 2px solid var(--secondary-color); outline-offset: 2px; border-radius: 6px; }

/* --- Kicker headings --- */
.kicker { color: var(--secondary-text); margin: 8px 0 4px; font-size: 0.95rem; text-transform: uppercase; letter-spacing: .04em; }

/* --- Tools list --- */
.tool-links { list-style: none; padding: 0; margin: 8px 0 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 12px; }
.tool-links a { text-decoration:none; color: var(--primary-color); }
.tool-links a:hover { text-decoration: underline; }

/* --- Site Map --- */
.section.subtle { background: var(--background-elevated); border-radius: 12px; padding: 24px; }
.cols { display:grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 24px; }
.cols a { display:block; color: var(--text-color); text-decoration:none; margin: 2px 0; }
.cols a:hover { text-decoration: underline; }

/* --- Footer --- */
.site-footer { border-top: 1px solid var(--border-color); padding: 20px 0; margin-top: 24px; text-align:center; }
.site-footer nav { display:flex; flex-wrap:wrap; gap:12px; justify-content:center; margin-bottom: 6px; }
.muted { color: var(--secondary-text); }
.small { font-size: 0.9rem; }


/* =============================================
   DARK MODE CONTRAST SAFEGUARDS
   For hardcoded light backgrounds in inline styles
   This ensures dark text on light backgrounds when in dark mode
   ============================================= */

/* Pure white backgrounds */
[data-theme="dark"] [style*="background: white"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background:#ffffff"] {
  color: #111 !important;
  background: #2a2a2a !important;
}

/* Light gray backgrounds (f8f9fa, f0f0f0, e9ecef) */
[data-theme="dark"] [style*="background: #f8f9fa"],
[data-theme="dark"] [style*="background:#f8f9fa"],
[data-theme="dark"] [style*="background: #f0f0f0"],
[data-theme="dark"] [style*="background:#f0f0f0"],
[data-theme="dark"] [style*="background: #e9ecef"],
[data-theme="dark"] [style*="background:#e9ecef"] {
  background: #2a2a2a !important;
  color: #e0e0e0 !important;
}

/* Light blue backgrounds (e8f4f8, d1ecf1, cce5ff) */
[data-theme="dark"] [style*="background: #e8f4f8"],
[data-theme="dark"] [style*="background:#e8f4f8"],
[data-theme="dark"] [style*="background: #d1ecf1"],
[data-theme="dark"] [style*="background:#d1ecf1"],
[data-theme="dark"] [style*="background: #cce5ff"],
[data-theme="dark"] [style*="background:#cce5ff"] {
  background: #1a2d3d !important;
  color: #a8d4f0 !important;
}

/* Light yellow/warning backgrounds (fff3cd, fffacd, fff3e0, ffeaa7) */
[data-theme="dark"] [style*="background: #fff3cd"],
[data-theme="dark"] [style*="background:#fff3cd"],
[data-theme="dark"] [style*="background: #fffacd"],
[data-theme="dark"] [style*="background:#fffacd"],
[data-theme="dark"] [style*="background: #fff3e0"],
[data-theme="dark"] [style*="background:#fff3e0"],
[data-theme="dark"] [style*="background: #ffeaa7"],
[data-theme="dark"] [style*="background:#ffeaa7"] {
  background: #3d3520 !important;
  color: #f5e6a3 !important;
}

/* Override dark yellow/brown text (#856404) inside warning boxes in dark mode */
[data-theme="dark"] [style*="background: #fff3cd"] [style*="color: #856404"],
[data-theme="dark"] [style*="background: #fff3cd"] [style*="color:#856404"],
[data-theme="dark"] [style*="background:#fff3cd"] [style*="color: #856404"],
[data-theme="dark"] [style*="background:#fff3cd"] [style*="color:#856404"] {
  color: #f5e6a3 !important;
}

/* Also catch any elements with just the color inside these containers */
[data-theme="dark"] [style*="background: #fff3cd"] h5,
[data-theme="dark"] [style*="background: #fff3cd"] p,
[data-theme="dark"] [style*="background: #fff3cd"] strong,
[data-theme="dark"] [style*="background:#fff3cd"] h5,
[data-theme="dark"] [style*="background:#fff3cd"] p,
[data-theme="dark"] [style*="background:#fff3cd"] strong {
  color: #f5e6a3 !important;
}

/* =============================================
   BOOTSTRAP-STYLE ALERT TEXT COLORS - Dark Mode Overrides
   These are dark text colors meant for light alert backgrounds
   ============================================= */

/* Warning text color #856404 (dark gold) - convert to light gold */
[data-theme="dark"] [style*="color: #856404"],
[data-theme="dark"] [style*="color:#856404"] {
  color: #f5e6a3 !important;
}

/* Danger text color #721c24 (dark red) - convert to light red */
[data-theme="dark"] [style*="color: #721c24"],
[data-theme="dark"] [style*="color:#721c24"] {
  color: #f0a8a8 !important;
}

/* Success text color #155724 (dark green) - convert to light green */
[data-theme="dark"] [style*="color: #155724"],
[data-theme="dark"] [style*="color:#155724"] {
  color: #a8e6cf !important;
}

/* Info text color #0c5460 (dark teal) - convert to light teal */
[data-theme="dark"] [style*="color: #0c5460"],
[data-theme="dark"] [style*="color:#0c5460"] {
  color: #a8d4f0 !important;
}

/* Primary text color #004085 (dark blue) - convert to light blue */
[data-theme="dark"] [style*="color: #004085"],
[data-theme="dark"] [style*="color:#004085"] {
  color: #a8d4f0 !important;
}

/* Secondary text color #383d41 (dark gray) - convert to light gray */
[data-theme="dark"] [style*="color: #383d41"],
[data-theme="dark"] [style*="color:#383d41"] {
  color: #d0d0d0 !important;
}

/* Light green backgrounds (d4edda, e8f5e9, e8f8f5) */
[data-theme="dark"] [style*="background: #d4edda"],
[data-theme="dark"] [style*="background:#d4edda"],
[data-theme="dark"] [style*="background: #e8f5e9"],
[data-theme="dark"] [style*="background:#e8f5e9"],
[data-theme="dark"] [style*="background: #e8f8f5"],
[data-theme="dark"] [style*="background:#e8f8f5"] {
  background: #1a2f26 !important;
  color: #a8e6cf !important;
}

/* Light red/pink backgrounds (f8d7da, fff5f5, fff3f3, fdf2e9) */
[data-theme="dark"] [style*="background: #f8d7da"],
[data-theme="dark"] [style*="background:#f8d7da"],
[data-theme="dark"] [style*="background: #fff5f5"],
[data-theme="dark"] [style*="background:#fff5f5"],
[data-theme="dark"] [style*="background: #fff3f3"],
[data-theme="dark"] [style*="background:#fff3f3"],
[data-theme="dark"] [style*="background: #fdf2e9"],
[data-theme="dark"] [style*="background:#fdf2e9"] {
  background: #3d2020 !important;
  color: #f0a8a8 !important;
}

/* Light purple backgrounds (f4e8f8, f5f0ff, e8e4f0) */
[data-theme="dark"] [style*="background: #f4e8f8"],
[data-theme="dark"] [style*="background:#f4e8f8"],
[data-theme="dark"] [style*="background: #f5f0ff"],
[data-theme="dark"] [style*="background:#f5f0ff"],
[data-theme="dark"] [style*="background: #e8e4f0"],
[data-theme="dark"] [style*="background:#e8e4f0"] {
  background: #2d1a32 !important;
  color: #d4b8e0 !important;
}

/* Ensure nested elements also get correct text color */
[data-theme="dark"] [style*="background: white"] *,
[data-theme="dark"] [style*="background:white"] *,
[data-theme="dark"] [style*="background: #fff"] *,
[data-theme="dark"] [style*="background:#fff"] *,
[data-theme="dark"] [style*="background: #e8f4f8"] *,
[data-theme="dark"] [style*="background:#e8f4f8"] * {
  color: inherit !important;
}

/* Fix heading colors inside light background containers in dark mode */
[data-theme="dark"] [style*="background: white"] h1,
[data-theme="dark"] [style*="background: white"] h2,
[data-theme="dark"] [style*="background: white"] h3,
[data-theme="dark"] [style*="background: white"] h4,
[data-theme="dark"] [style*="background: #e8f4f8"] h1,
[data-theme="dark"] [style*="background: #e8f4f8"] h2,
[data-theme="dark"] [style*="background: #e8f4f8"] h3,
[data-theme="dark"] [style*="background: #e8f4f8"] h4 {
  color: var(--secondary-color) !important;
}

/* Fix strong/bold text inside containers */
[data-theme="dark"] [style*="background: white"] strong,
[data-theme="dark"] [style*="background: #e8f4f8"] strong,
[data-theme="dark"] [style*="background: #fff3cd"] strong,
[data-theme="dark"] [style*="background: #d4edda"] strong {
  color: inherit !important;
}

/* Override hardcoded dark text colors (like #2c3e50) inside light bg containers in dark mode */
[data-theme="dark"] [style*="background: white"] [style*="color: #2c3e50"],
[data-theme="dark"] [style*="background: white"] [style*="color:#2c3e50"],
[data-theme="dark"] [style*="background: #e8f4f8"] [style*="color: #2c3e50"],
[data-theme="dark"] [style*="background: #e8f4f8"] [style*="color:#2c3e50"],
[data-theme="dark"] [style*="background: #fff3cd"] [style*="color: #2c3e50"],
[data-theme="dark"] [style*="background: #d4edda"] [style*="color: #2c3e50"] {
  color: #e0e0e0 !important;
}

/* Also override color for elements that inherit from parent but have explicit dark text */
[data-theme="dark"] [style*="background: white"] ul,
[data-theme="dark"] [style*="background: white"] li,
[data-theme="dark"] [style*="background: white"] p,
[data-theme="dark"] [style*="background: #e8f4f8"] ul,
[data-theme="dark"] [style*="background: #e8f4f8"] li,
[data-theme="dark"] [style*="background: #e8f4f8"] p {
  color: #e0e0e0 !important;
}

/* Fix heading colors that are hardcoded for light mode */
[data-theme="dark"] [style*="background: white"] [style*="color: #e74c3c"],
[data-theme="dark"] [style*="background: white"] [style*="color: #27ae60"],
[data-theme="dark"] [style*="background: white"] [style*="color: #8e44ad"],
[data-theme="dark"] [style*="background: white"] [style*="color: #f39c12"],
[data-theme="dark"] [style*="background: white"] [style*="color: #3498db"] {
  /* Keep these vibrant colors but make them lighter for dark bg */
  filter: brightness(1.3) !important;
}

/* Additional light color backgrounds for table rows and misc elements */
[data-theme="dark"] [style*="background: #e2e3f0"],
[data-theme="dark"] [style*="background:#e2e3f0"] {
  background: #2d2a3d !important;
  color: #d0cce0 !important;
}

/* Table row backgrounds in dark mode - ensure all text is readable */
[data-theme="dark"] tr[style*="background: #e8f4f8"] td,
[data-theme="dark"] tr[style*="background: #fff3cd"] td,
[data-theme="dark"] tr[style*="background: #f8d7da"] td,
[data-theme="dark"] tr[style*="background: #f4e8f8"] td,
[data-theme="dark"] tr[style*="background: #d4edda"] td,
[data-theme="dark"] tr[style*="background: #fff5f5"] td,
[data-theme="dark"] tr[style*="background: #e9ecef"] td,
[data-theme="dark"] tr[style*="background: #d1ecf1"] td {
  color: #e0e0e0 !important;
}

/* Override hardcoded inline text colors on table cells in dark mode */
/* Warning yellow #856404 -> light gold */
[data-theme="dark"] td[style*="color: #856404"],
[data-theme="dark"] td[style*="color:#856404"] {
  color: #f5e6a3 !important;
}
/* Danger red #721c24 -> light pink */
[data-theme="dark"] td[style*="color: #721c24"],
[data-theme="dark"] td[style*="color:#721c24"] {
  color: #f0a8a8 !important;
}
/* Info teal #0c5460 -> light cyan */
[data-theme="dark"] td[style*="color: #0c5460"],
[data-theme="dark"] td[style*="color:#0c5460"] {
  color: #a8d4e6 !important;
}
/* Success green #155724 -> light green */
[data-theme="dark"] td[style*="color: #155724"],
[data-theme="dark"] td[style*="color:#155724"] {
  color: #a8e6cf !important;
}
/* Purple #493071 -> light purple */
[data-theme="dark"] td[style*="color: #493071"],
[data-theme="dark"] td[style*="color:#493071"] {
  color: #d4b8e0 !important;
}

/* Also handle backgrounds set directly on divs without space after colon */
[data-theme="dark"] div[style*="background:#e8f4f8"],
[data-theme="dark"] div[style*="background:#fff3cd"],
[data-theme="dark"] div[style*="background:#f8d7da"],
[data-theme="dark"] div[style*="background:#f4e8f8"],
[data-theme="dark"] div[style*="background:#d4edda"],
[data-theme="dark"] div[style*="background:#d1ecf1"],
[data-theme="dark"] div[style*="background:#e2e3f0"] {
  color: #e0e0e0 !important;
}

/* Fix colors inside these containers */
[data-theme="dark"] div[style*="background: #e8f4f8"] *,
[data-theme="dark"] div[style*="background: #fff3cd"] *,
[data-theme="dark"] div[style*="background: #f8d7da"] *,
[data-theme="dark"] div[style*="background: #f4e8f8"] *,
[data-theme="dark"] div[style*="background: #d4edda"] *,
[data-theme="dark"] div[style*="background: #d1ecf1"] *,
[data-theme="dark"] div[style*="background: #e2e3f0"] * {
  color: inherit !important;
}

/* Skeleton Key Graphic - responsive image styles */
.skeleton-key-figure { text-align: center; margin: 12px 0 28px; }
.skeleton-key-img { max-width: min(100%, 900px); height: auto; border-radius: 12px; box-shadow: 0 8px 24px var(--shadow-color); border: 1px solid var(--border-color); background: var(--background); }
[data-theme="dark"] .skeleton-key-img { background: #111; }

/* ========================================================
   ALERT BOX CLASSES - Reliable dark mode support
   ======================================================== */

/* Warning alert (yellow) */
.alert-warning {
  color: #856404;
}
.alert-warning h4,
.alert-warning h5,
.alert-warning p,
.alert-warning ul,
.alert-warning li,
.alert-warning strong,
.alert-warning span {
  color: #856404;
}
[data-theme="dark"] .alert-warning,
[data-theme="dark"] .alert-warning[style*="background"],
[data-theme="dark"] [style*="background"] .alert-warning {
  background: #3d3520 !important;
  color: #f5e6a3 !important;
}
[data-theme="dark"] .alert-warning h4,
[data-theme="dark"] .alert-warning h5,
[data-theme="dark"] .alert-warning h3,
[data-theme="dark"] .alert-warning p,
[data-theme="dark"] .alert-warning ul,
[data-theme="dark"] .alert-warning li,
[data-theme="dark"] .alert-warning strong,
[data-theme="dark"] .alert-warning span,
[data-theme="dark"] .alert-warning *,
[data-theme="dark"] [style*="background"] .alert-warning *,
[data-theme="dark"] .alert-warning[style*="background"] * {
  color: #f5e6a3 !important;
}

/* Danger alert (red) */
.alert-danger {
  color: #721c24;
}
.alert-danger h3,
.alert-danger h4,
.alert-danger h5,
.alert-danger p,
.alert-danger ul,
.alert-danger li,
.alert-danger strong,
.alert-danger span {
  color: #721c24;
}
[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-danger[style*="background"],
[data-theme="dark"] [style*="background"] .alert-danger {
  background: #3d2020 !important;
  color: #f0a8a8 !important;
}
[data-theme="dark"] .alert-danger h3,
[data-theme="dark"] .alert-danger h4,
[data-theme="dark"] .alert-danger h5,
[data-theme="dark"] .alert-danger p,
[data-theme="dark"] .alert-danger ul,
[data-theme="dark"] .alert-danger li,
[data-theme="dark"] .alert-danger strong,
[data-theme="dark"] .alert-danger span,
[data-theme="dark"] .alert-danger *,
[data-theme="dark"] [style*="background"] .alert-danger *,
[data-theme="dark"] .alert-danger[style*="background"] * {
  color: #f0a8a8 !important;
}

/* Success alert (green) */
.alert-success {
  color: #155724;
}
.alert-success h4,
.alert-success h5,
.alert-success p,
.alert-success ul,
.alert-success li,
.alert-success strong,
.alert-success span {
  color: #155724;
}
[data-theme="dark"] .alert-success,
[data-theme="dark"] .alert-success[style*="background"],
[data-theme="dark"] [style*="background"] .alert-success {
  background: #1a2f26 !important;
  color: #a8e6cf !important;
}
[data-theme="dark"] .alert-success h4,
[data-theme="dark"] .alert-success h5,
[data-theme="dark"] .alert-success p,
[data-theme="dark"] .alert-success ul,
[data-theme="dark"] .alert-success li,
[data-theme="dark"] .alert-success strong,
[data-theme="dark"] .alert-success span,
[data-theme="dark"] .alert-success *,
[data-theme="dark"] [style*="background"] .alert-success *,
[data-theme="dark"] .alert-success[style*="background"] * {
  color: #a8e6cf !important;
}

/* Info alert (blue/teal) */
.alert-info {
  color: #0c5460;
}
.alert-info h4,
.alert-info h5,
.alert-info p,
.alert-info ul,
.alert-info li,
.alert-info strong,
.alert-info span {
  color: #0c5460;
}
[data-theme="dark"] .alert-info,
[data-theme="dark"] .alert-info[style*="background"],
[data-theme="dark"] [style*="background"] .alert-info {
  background: #1a2d3d !important;
  color: #a8d4e6 !important;
}
[data-theme="dark"] .alert-info h4,
[data-theme="dark"] .alert-info h5,
[data-theme="dark"] .alert-info p,
[data-theme="dark"] .alert-info ul,
[data-theme="dark"] .alert-info li,
[data-theme="dark"] .alert-info strong,
[data-theme="dark"] .alert-info span,
[data-theme="dark"] .alert-info *,
[data-theme="dark"] [style*="background"] .alert-info *,
[data-theme="dark"] .alert-info[style*="background"] * {
  color: #a8d4e6 !important;
}

/* Purple/Violet alert */
.alert-purple {
  color: #493071;
}
.alert-purple h4,
.alert-purple h5,
.alert-purple p,
.alert-purple li,
.alert-purple strong,
.alert-purple span {
  color: #493071;
}
[data-theme="dark"] .alert-purple,
[data-theme="dark"] .alert-purple[style*="background"],
[data-theme="dark"] [style*="background"] .alert-purple {
  background: #2d1a32 !important;
  color: #d4b8e0 !important;
}
[data-theme="dark"] .alert-purple h4,
[data-theme="dark"] .alert-purple h5,
[data-theme="dark"] .alert-purple p,
[data-theme="dark"] .alert-purple ul,
[data-theme="dark"] .alert-purple li,
[data-theme="dark"] .alert-purple strong,
[data-theme="dark"] .alert-purple span,
[data-theme="dark"] .alert-purple *,
[data-theme="dark"] [style*="background"] .alert-purple *,
[data-theme="dark"] .alert-purple[style*="background"] * {
  color: #d4b8e0 !important;
}

/* ========================================================
   GLOBAL HARDCODED COLOR OVERRIDES FOR DARK MODE
   These override inline styles that use light-mode-only colors
   ======================================================== */

/* Dark gray text #2c3e50 - convert to light gray */
[data-theme="dark"] [style*="color: #2c3e50"],
[data-theme="dark"] [style*="color:#2c3e50"] {
  color: #e0e0e0 !important;
}

/* Green headings #27ae60 - convert to lighter green */
[data-theme="dark"] [style*="color: #27ae60"],
[data-theme="dark"] [style*="color:#27ae60"] {
  color: #6ee7b7 !important;
}

/* Red headings #dc3545, #e74c3c - convert to lighter red */
[data-theme="dark"] [style*="color: #dc3545"],
[data-theme="dark"] [style*="color:#dc3545"],
[data-theme="dark"] [style*="color: #e74c3c"],
[data-theme="dark"] [style*="color:#e74c3c"] {
  color: #f87171 !important;
}

/* Blue headings #007bff, #3498db - convert to lighter blue */
[data-theme="dark"] [style*="color: #007bff"],
[data-theme="dark"] [style*="color:#007bff"],
[data-theme="dark"] [style*="color: #3498db"],
[data-theme="dark"] [style*="color:#3498db"] {
  color: #60a5fa !important;
}

/* Purple headings #8e44ad, #9b59b6 - convert to lighter purple */
[data-theme="dark"] [style*="color: #8e44ad"],
[data-theme="dark"] [style*="color:#8e44ad"],
[data-theme="dark"] [style*="color: #9b59b6"],
[data-theme="dark"] [style*="color:#9b59b6"] {
  color: #c084fc !important;
}

/* Orange headings #f39c12, #e67e22 - convert to lighter orange */
[data-theme="dark"] [style*="color: #f39c12"],
[data-theme="dark"] [style*="color:#f39c12"],
[data-theme="dark"] [style*="color: #e67e22"],
[data-theme="dark"] [style*="color:#e67e22"] {
  color: #fbbf24 !important;
}

/* Teal headings #1abc9c, #16a085 - convert to lighter teal */
[data-theme="dark"] [style*="color: #1abc9c"],
[data-theme="dark"] [style*="color:#1abc9c"],
[data-theme="dark"] [style*="color: #16a085"],
[data-theme="dark"] [style*="color:#16a085"] {
  color: #5eead4 !important;
}

/* Additional dark text colors that need lightening */
[data-theme="dark"] [style*="color: #333"],
[data-theme="dark"] [style*="color:#333"],
[data-theme="dark"] [style*="color: #444"],
[data-theme="dark"] [style*="color:#444"],
[data-theme="dark"] [style*="color: #555"],
[data-theme="dark"] [style*="color:#555"],
[data-theme="dark"] [style*="color: #666"],
[data-theme="dark"] [style*="color:#666"] {
  color: #d0d0d0 !important;
}

/* Fix nested content inside white/light backgrounds */
[data-theme="dark"] [style*="background: white"] ol,
[data-theme="dark"] [style*="background: white"] ul,
[data-theme="dark"] [style*="background: white"] li,
[data-theme="dark"] [style*="background: white"] p,
[data-theme="dark"] [style*="background: white"] span,
[data-theme="dark"] [style*="background: white"] strong,
[data-theme="dark"] [style*="background: white"] td,
[data-theme="dark"] [style*="background:white"] ol,
[data-theme="dark"] [style*="background:white"] ul,
[data-theme="dark"] [style*="background:white"] li,
[data-theme="dark"] [style*="background:white"] p,
[data-theme="dark"] [style*="background:white"] span,
[data-theme="dark"] [style*="background:white"] strong,
[data-theme="dark"] [style*="background:white"] td {
  color: #e0e0e0 !important;
}

/* Fix headings inside white backgrounds - make them readable colors */
[data-theme="dark"] [style*="background: white"] h1,
[data-theme="dark"] [style*="background: white"] h2,
[data-theme="dark"] [style*="background: white"] h3,
[data-theme="dark"] [style*="background: white"] h4,
[data-theme="dark"] [style*="background: white"] h5,
[data-theme="dark"] [style*="background: white"] h6,
[data-theme="dark"] [style*="background:white"] h1,
[data-theme="dark"] [style*="background:white"] h2,
[data-theme="dark"] [style*="background:white"] h3,
[data-theme="dark"] [style*="background:white"] h4,
[data-theme="dark"] [style*="background:white"] h5,
[data-theme="dark"] [style*="background:white"] h6 {
  color: #e0e0e0 !important;
}

/* Preserve colored headings inside white backgrounds but brighten them */
[data-theme="dark"] [style*="background: white"] h3[style*="color: #27ae60"],
[data-theme="dark"] [style*="background: white"] h4[style*="color: #27ae60"],
[data-theme="dark"] [style*="background: white"] h5[style*="color: #27ae60"],
[data-theme="dark"] [style*="background:white"] h3[style*="color: #27ae60"],
[data-theme="dark"] [style*="background:white"] h4[style*="color: #27ae60"],
[data-theme="dark"] [style*="background:white"] h5[style*="color: #27ae60"] {
  color: #6ee7b7 !important;
}

[data-theme="dark"] [style*="background: white"] h3[style*="color: #dc3545"],
[data-theme="dark"] [style*="background: white"] h4[style*="color: #dc3545"],
[data-theme="dark"] [style*="background: white"] h5[style*="color: #dc3545"],
[data-theme="dark"] [style*="background:white"] h3[style*="color: #dc3545"],
[data-theme="dark"] [style*="background:white"] h4[style*="color: #dc3545"],
[data-theme="dark"] [style*="background:white"] h5[style*="color: #dc3545"] {
  color: #f87171 !important;
}

[data-theme="dark"] [style*="background: white"] h3[style*="color: #007bff"],
[data-theme="dark"] [style*="background: white"] h4[style*="color: #007bff"],
[data-theme="dark"] [style*="background: white"] h5[style*="color: #007bff"],
[data-theme="dark"] [style*="background:white"] h3[style*="color: #007bff"],
[data-theme="dark"] [style*="background:white"] h4[style*="color: #007bff"],
[data-theme="dark"] [style*="background:white"] h5[style*="color: #007bff"] {
  color: #60a5fa !important;
}

/* Fix light green backgrounds (#e8f5e9, #e8f8f5) nested content */
[data-theme="dark"] [style*="background: #e8f5e9"] *,
[data-theme="dark"] [style*="background:#e8f5e9"] *,
[data-theme="dark"] [style*="background: #e8f8f5"] *,
[data-theme="dark"] [style*="background:#e8f8f5"] * {
  color: #a8e6cf !important;
}

/* Fix yellow/amber backgrounds (#fff8e1, #fff3cd) - common warning boxes */
[data-theme="dark"] [style*="background: #fff8e1"],
[data-theme="dark"] [style*="background:#fff8e1"] {
  background: #3d3520 !important;
}
[data-theme="dark"] [style*="background: #fff8e1"] *,
[data-theme="dark"] [style*="background:#fff8e1"] * {
  color: #fde68a !important;
}
[data-theme="dark"] [style*="background: #fff3cd"],
[data-theme="dark"] [style*="background:#fff3cd"] {
  background: #3d3520 !important;
}
[data-theme="dark"] [style*="background: #fff3cd"] *,
[data-theme="dark"] [style*="background:#fff3cd"] * {
  color: #fde68a !important;
}

/* Fix light gray backgrounds (#f8f9fa, #ecf0f1) - common info boxes */
[data-theme="dark"] [style*="background: #f8f9fa"],
[data-theme="dark"] [style*="background:#f8f9fa"] {
  background: #2a2a2a !important;
}
[data-theme="dark"] [style*="background: #f8f9fa"] *,
[data-theme="dark"] [style*="background:#f8f9fa"] * {
  color: #e0e0e0 !important;
}
[data-theme="dark"] [style*="background: #ecf0f1"],
[data-theme="dark"] [style*="background:#ecf0f1"] {
  background: #2a2a2a !important;
}
[data-theme="dark"] [style*="background: #ecf0f1"] *,
[data-theme="dark"] [style*="background:#ecf0f1"] * {
  color: #e0e0e0 !important;
}

/* Fix light red backgrounds (#ffebee, #f8d7da) */
[data-theme="dark"] [style*="background: #ffebee"],
[data-theme="dark"] [style*="background:#ffebee"] {
  background: #3d2020 !important;
}
[data-theme="dark"] [style*="background: #ffebee"] *,
[data-theme="dark"] [style*="background:#ffebee"] * {
  color: #f0a8a8 !important;
}
[data-theme="dark"] [style*="background: #f8d7da"],
[data-theme="dark"] [style*="background:#f8d7da"] {
  background: #3d2020 !important;
}
[data-theme="dark"] [style*="background: #f8d7da"] *,
[data-theme="dark"] [style*="background:#f8d7da"] * {
  color: #f0a8a8 !important;
}

/* Fix light blue backgrounds (#d1ecf1, #e3f2fd) */
[data-theme="dark"] [style*="background: #d1ecf1"],
[data-theme="dark"] [style*="background:#d1ecf1"] {
  background: #1a2d3d !important;
}
[data-theme="dark"] [style*="background: #d1ecf1"] *,
[data-theme="dark"] [style*="background:#d1ecf1"] * {
  color: #a8d4e6 !important;
}
[data-theme="dark"] [style*="background: #e3f2fd"],
[data-theme="dark"] [style*="background:#e3f2fd"] {
  background: #1a2d3d !important;
}
[data-theme="dark"] [style*="background: #e3f2fd"] *,
[data-theme="dark"] [style*="background:#e3f2fd"] * {
  color: #a8d4e6 !important;
}

/* Fix light green backgrounds (#d4edda) */
[data-theme="dark"] [style*="background: #d4edda"],
[data-theme="dark"] [style*="background:#d4edda"] {
  background: #1a2f26 !important;
}
[data-theme="dark"] [style*="background: #d4edda"] *,
[data-theme="dark"] [style*="background:#d4edda"] * {
  color: #a8e6cf !important;
}

/* Fix light purple backgrounds (#f3e5f5, #e8daef) */
[data-theme="dark"] [style*="background: #f3e5f5"],
[data-theme="dark"] [style*="background:#f3e5f5"] {
  background: #2d1a32 !important;
}
[data-theme="dark"] [style*="background: #f3e5f5"] *,
[data-theme="dark"] [style*="background:#f3e5f5"] * {
  color: #d4b8e0 !important;
}
[data-theme="dark"] [style*="background: #e8daef"],
[data-theme="dark"] [style*="background:#e8daef"] {
  background: #2d1a32 !important;
}
[data-theme="dark"] [style*="background: #e8daef"] *,
[data-theme="dark"] [style*="background:#e8daef"] * {
  color: #d4b8e0 !important;
}

/* ========================================================
   BOOTSTRAP ALERT TEXT COLOR OVERRIDES
   These are dark text colors used inside Bootstrap-style alerts
   ======================================================== */

/* Warning alert text #856404 - dark yellow/brown */
[data-theme="dark"] [style*="color: #856404"],
[data-theme="dark"] [style*="color:#856404"] {
  color: #fde68a !important;
}

/* Danger alert text #721c24 - dark red */
[data-theme="dark"] [style*="color: #721c24"],
[data-theme="dark"] [style*="color:#721c24"] {
  color: #f0a8a8 !important;
}

/* Success alert text #155724 - dark green */
[data-theme="dark"] [style*="color: #155724"],
[data-theme="dark"] [style*="color:#155724"] {
  color: #a8e6cf !important;
}

/* Info alert text #0c5460 - dark teal */
[data-theme="dark"] [style*="color: #0c5460"],
[data-theme="dark"] [style*="color:#0c5460"] {
  color: #a8d4e6 !important;
}

/* Purple alert text #493071 - dark purple */
[data-theme="dark"] [style*="color: #493071"],
[data-theme="dark"] [style*="color:#493071"] {
  color: #d4b8e0 !important;
}

/* Black text - convert to light gray in dark mode */
[data-theme="dark"] [style*="color: black"],
[data-theme="dark"] [style*="color:black"] {
  color: #e0e0e0 !important;
}
