/* Sound Byte Labs Doxygen Custom Styling - Accessibility Enhanced */

/* ========================================
   ACCESSIBILITY-ENHANCED BRAND COLORS
   ======================================== */

/* Base colors with improved contrast ratios for WCAG AA compliance */
:root {
    /* Enhanced brand colors - maintain neon aesthetic with better accessibility */
    --sbl-purple: #8844dd;     /* Improved contrast: was #b855ff */
    --sbl-pink: #dd4488;       /* Improved contrast: was #ff55b8 */  
    --sbl-blue: #2255ee;       /* Slightly darker: was #3366ff */
    --sbl-primary: #2255ee;    /* Primary blue with 4.8:1 contrast */
    --sbl-secondary: #2255ee;  /* Secondary blue */
    --sbl-accent: #dd4488;     /* Accent pink with 4.5:1 contrast */
    
    /* Alternative accent for colorblind users */
    --sbl-accent-alt: #ff8800; /* Orange alternative */
    
    /* System colors */
    --sbl-warning: #e67e00;    /* Enhanced contrast: was #ffc107 */
    --sbl-danger: #cc2936;     /* Enhanced contrast: was #dc3545 */
    --sbl-info: #0e7c91;      /* Enhanced contrast: was #17a2b8 */
    --sbl-success: #157347;    /* New success color */
    --sbl-light: #f8f9fa;
    --sbl-dark: #2c3e50;
    
    /* Gradients with accessibility considerations */
    --sbl-gradient-sb: linear-gradient(135deg, #8844dd 0%, #dd4488 100%);
    --sbl-gradient-labs: linear-gradient(135deg, #2255ee 0%, #1544cc 100%);
    
    /* Focus and interaction colors */
    --focus-color: #005fcc;    /* High contrast focus */
    --focus-background: #e6f3ff;
    --hover-background: #f0f7ff;
}

/* ========================================
   MOTION SENSITIVITY SUPPORT
   ======================================== */

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Default smooth transitions (overridden by reduce-motion) */
* {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ========================================
   ENHANCED FOCUS INDICATORS
   ======================================== */

/* High contrast focus indicators for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
.tablist li a:focus,
#nav-tree .item:focus {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
    background-color: var(--focus-background);
    border-radius: 3px;
}

/* Focus for interactive elements */
.tablist li a:focus-visible {
    outline: 3px solid var(--focus-color);
    outline-offset: 2px;
    background-color: var(--focus-background);
}

/* ========================================
   HEADER STYLING
   ======================================== */

#top {
    background: linear-gradient(135deg, #2255ee 0%, #1544cc 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#titlearea {
    border-bottom: 1px solid #ddd;
    padding: 1rem 0;
}

.header .headertitle .title {
    color: var(--sbl-dark);
    font-weight: 600;
    font-size: 1.8rem;
}

.header .headertitle .ingroups {
    color: #666;
    font-size: 0.9rem;
}

/* ========================================
   NAVIGATION STYLING WITH ACCESSIBILITY
   ======================================== */

.tablist {
    background: #fff;
    border-bottom: 2px solid var(--sbl-blue);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tablist li a {
    background: transparent;
    color: var(--sbl-dark);
    border-radius: 4px 4px 0 0;
    margin-right: 2px;
    /* Enhanced for screen readers */
    text-decoration: none;
}

.tablist li a:hover {
    background: var(--hover-background);
    color: var(--sbl-primary);
}

/* Keyboard navigation improvements */
.tablist li a:focus {
    z-index: 10;
    position: relative;
}

.tablist li.current a {
    background: var(--sbl-gradient-labs);
    color: white;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    letter-spacing: 0.3px;
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */

.ui-resizable-e {
    background: var(--sbl-primary);
}

#nav-tree {
    background: var(--sbl-light);
    border-right: 1px solid #ddd;
}

#nav-tree .item {
    color: var(--sbl-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

#nav-tree .item:hover {
    background: var(--hover-background);
}

#nav-tree .selected {
    background: var(--sbl-primary);
    color: white;
}

/* Content styling */
.contents {
    padding: 2rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin: 1rem;
}

.contents .textblock {
    border-left: 4px solid var(--sbl-primary);
    padding-left: 1.5em;
    margin: 1em 0;
    background: var(--sbl-light);
    border-radius: 0 4px 4px 0;
}

/* ========================================
   TYPOGRAPHY WITH ACCESSIBILITY
   ======================================== */

/* Improved font stack for better readability */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    font-size: 16px; /* Minimum 16px for mobile */
}

/* Section headers with enhanced contrast */
h1, h2, h3, h4, h5, h6 {
    color: var(--sbl-dark);
    border-bottom: 2px solid var(--sbl-primary);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    line-height: 1.3;
}

/* Enhanced H1 with accessibility considerations */
h1 {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-top: 0.5rem;
    /* Gradient text with fallback for accessibility */
    background: var(--sbl-gradient-sb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Fallback for browsers that don't support gradient text */
    color: var(--sbl-purple);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace, sans-serif;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Ensure gradient text has fallback */
@supports not (background-clip: text) {
    h1 {
        color: var(--sbl-purple) !important;
        background: none !important;
    }
}

h2 {
    font-size: 1.8rem;
    color: var(--sbl-primary);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace, sans-serif;
    font-weight: bold;
    letter-spacing: 0.3px;
}

h3 {
    font-size: 1.4rem;
    color: var(--sbl-secondary);
    border-bottom: 1px solid var(--sbl-primary);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace, sans-serif;
    font-weight: bold;
    letter-spacing: 0.2px;
}

/* Table of contents */
.toc {
    background: var(--sbl-light);
    border: 1px solid var(--sbl-primary);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.toc h3 {
    color: var(--sbl-primary);
    margin-top: 0;
    border-bottom: 1px solid var(--sbl-primary);
}

/* Table scrolling wrapper for all tables */
.contents table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 1em 0;
}

/* Ensure table maintains its layout while scrolling */
.contents table tbody,
.contents table thead {
    display: table;
    width: 100%;
    table-layout: auto;
}

/* Style for Doxygen's table containers */
.doxtable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1em 0;
}

/* General table styling */
table.markdownTable,
table.doxtable {
    border-collapse: collapse;
    border: 1px solid #dee2e6;
    min-width: 600px;
}

table.markdownTable th,
table.markdownTable td,
table.doxtable th,
table.doxtable td {
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    text-align: left;
}

table.markdownTable th,
table.doxtable th {
    background-color: #3366ff;
    color: white;
    font-weight: 600;
    white-space: nowrap;
}

/* Platform support table styling */
.platform-support table {
    width: auto;
    min-width: 600px; /* Minimum width to prevent squishing */
    border-collapse: collapse;
    margin: 1em 0;
}

.platform-support th,
.platform-support td {
    border: 1px solid #dee2e6;
    padding: 0.75rem;
    text-align: left;
    white-space: nowrap; /* Prevent text wrapping in cells */
}

.platform-support th {
    background-color: #3366ff; /* Changed to blue to match new theme */
    color: white;
    font-weight: 600;
}

.platform-support tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Code block styling */
.fragment {
    border-left: 4px solid var(--sbl-accent);
    background: #f8f9fa;
    padding: 1.5em;
    margin: 1.5em 0;
    border-radius: 0 8px 8px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    overflow-x: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fragment .line {
    line-height: 1.4;
}

/* Inline code with better contrast */
code, tt {
    background: var(--sbl-light);
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384; /* Enhanced contrast */
}

/* Template parameter styling */
.tparams {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 4px;
    padding: 0.5em;
    margin: 0.5em 0;
}

/* DOT graph styling */
.dotgraph {
    text-align: center;
    margin: 2em 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ========================================
   STATUS INDICATORS WITH PATTERNS
   ======================================== */

/* Enhanced status indicators with icons AND colors for accessibility */
.status-active::before {
    content: "✅ Active: ";
    color: var(--sbl-success);
    font-weight: bold;
}

.status-progress::before {
    content: "🔄 In Progress: ";
    color: var(--sbl-warning);
    font-weight: bold;
}

.status-planned::before {
    content: "📋 Planned: ";
    color: var(--sbl-info);
    font-weight: bold;
}

/* Alternative indicators for users who prefer text */
.status-active[data-text-only]::before {
    content: "[ACTIVE] ";
}

.status-progress[data-text-only]::before {
    content: "[IN PROGRESS] ";
}

.status-planned[data-text-only]::before {
    content: "[PLANNED] ";
}

/* API documentation improvements */
.memproto {
    background: var(--sbl-gradient-labs);
    color: white;
    border-radius: 8px 8px 0 0;
    padding: 1rem;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    letter-spacing: 0.2px;
}

.memdoc {
    background: var(--sbl-light);
    border: 1px solid var(--sbl-primary);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 1rem;
}

/* Parameter documentation */
.params {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 1rem 0;
}

.params .paramname {
    color: var(--sbl-primary);
    font-weight: 600;
}

/* Return value documentation */
.retval {
    background: #e8f5e8;
    border-left: 4px solid var(--sbl-accent);
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 0 4px 4px 0;
}

/* See also links */
.see {
    background: #e3f2fd;
    border-left: 4px solid var(--sbl-info);
    padding: 0.5rem;
    margin: 0.5rem 0;
    border-radius: 0 4px 4px 0;
}

/* Pixelated/retro styling inspired by logo */
.contents .textblock {
    border-left: 4px solid var(--sbl-accent);
    background: linear-gradient(135deg, var(--sbl-light) 0%, #ffffff 100%);
}

/* Add pixelated border effect to code blocks */
.fragment {
    border-left: 4px solid var(--sbl-accent);
    background: #f8f9fa;
    position: relative;
}

.fragment::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--sbl-gradient-sb);
}

/* Base mobile improvements */
* {
    box-sizing: border-box;
}

/* Ensure content doesn't overflow viewport */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    word-wrap: break-word;
}

/* Fix long URLs and code in content */
.contents a {
    word-break: break-word;
    hyphens: auto;
}

/* Fix pre-formatted text overflow */
pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    -webkit-overflow-scrolling: touch;
}

/* Enhanced project title styling */
#projectname {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace !important;
    font-weight: bold !important;
    letter-spacing: 1px !important;
    background: var(--sbl-gradient-sb) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

#projectnumber {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace !important;
    color: var(--sbl-secondary) !important;
    font-weight: bold !important;
}

#projectbrief {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace !important;
    color: var(--sbl-dark) !important;
    font-size: 0.9rem !important;
    letter-spacing: 0.2px !important;
}

/* ========================================
   RESPONSIVE DESIGN WITH ACCESSIBILITY
   ======================================== */

@media (max-width: 768px) {
    /* Ensure minimum touch target sizes (44px) */
    .tablist li a {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Enhanced mobile navigation */
    #nav-tree .item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Better mobile typography */
    body {
        font-size: 18px; /* Larger base size for mobile */
    }
    /* Fix project title area on mobile */
    #titlearea {
        padding: 0.5rem;
        text-align: center;
    }
    
    #projectname {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.25rem !important;
    }
    
    #projectnumber {
        font-size: 0.9rem !important;
        display: block !important;
        margin-top: 0.25rem !important;
    }
    
    #projectbrief {
        font-size: 0.8rem !important;
        margin-top: 0.5rem !important;
        line-height: 1.3 !important;
        max-width: 100% !important;
    }
    
    /* Fix main content layout */
    .contents {
        margin: 0.25rem;
        padding: 0.75rem;
        border-radius: 4px;
        overflow: hidden;
        clear: both;
    }
    
    /* Prevent content sections from floating around TOC */
    .contents > * {
        clear: both;
        width: 100%;
    }
    
    /* Ensure TOC doesn't squish content on mobile */
    .toc {
        float: none !important;
        width: 100% !important;
        margin: 1rem 0;
        padding: 0.75rem;
        font-size: 0.9rem;
        max-width: 100%;
        box-sizing: border-box;
        display: block;
        position: relative;
        clear: both;
    }
    
    /* Force content to not wrap around TOC on mobile */
    .contents .textblock {
        float: none !important;
        width: 100% !important;
        margin-left: 0 !important;
        clear: both;
    }
    
    .toc ul {
        margin: 0.5rem 0;
        padding-left: 1rem;
    }
    
    .toc li {
        margin: 0.25rem 0;
        line-height: 1.4;
    }
    
    /* Fix header sizing */
    h1 {
        font-size: 1.6rem;
        margin-top: 0.5rem;
        margin-bottom: 0.75rem;
        line-height: 1.2;
        word-wrap: break-word;
    }
    
    h2 {
        font-size: 1.4rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    h3 {
        font-size: 1.2rem;
        margin-top: 0.75rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    /* Fix code blocks and fragments */
    .fragment {
        padding: 0.75rem;
        margin: 0.75rem 0;
        font-size: 0.85rem;
        overflow-x: auto;
        white-space: pre;
        word-wrap: normal;
        -webkit-overflow-scrolling: touch;
    }
    
    .fragment .line {
        line-height: 1.4;
        white-space: pre;
    }
    
    /* Fix inline code */
    code, tt {
        font-size: 0.8rem;
        word-break: break-word;
        white-space: pre-wrap;
    }
    
    /* Fix long code blocks in tables or lists */
    .memproto, .memdoc {
        font-size: 0.85rem;
        overflow-x: auto;
    }
    
    .memproto {
        padding: 0.75rem;
        white-space: pre-wrap;
        word-break: break-word;
    }
    
    /* Fix navigation on mobile */
    .tablist {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .tablist li {
        display: inline-block;
        min-width: 80px;
    }
    
    .tablist li a {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Mobile table improvements */
    .contents table {
        font-size: 16px; /* Minimum readable size */
        min-width: 100%;
        width: auto;
    }
    
    /* Specific handling for tables with many columns */
    table {
        font-size: 16px; /* Maintain readability */
    }
    
    /* Fix sidebar navigation */
    #nav-tree {
        font-size: 0.9rem;
    }
    
    /* Fix textblocks */
    .textblock {
        padding-left: 1rem;
        margin: 0.75rem 0;
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Fix architecture diagrams */
    .dotgraph {
        padding: 0.5rem;
        margin: 1rem 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .dotgraph img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix platform support table */
    .platform-support {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .platform-support table {
        min-width: 600px;
        font-size: 0.8rem;
    }
    
    .platform-support th, 
    .platform-support td {
        padding: 0.5rem;
        white-space: nowrap;
    }
}

/* Additional breakpoint for very small screens */
@media (max-width: 480px) {
    #projectname {
        font-size: 1.3rem !important;
        letter-spacing: 0.5px !important;
    }
    
    #projectbrief {
        font-size: 0.75rem !important;
    }
    
    .contents {
        margin: 0.125rem;
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 1.4rem;
    }
    
    h2 {
        font-size: 1.2rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    .fragment {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .toc {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
}

/* ========================================
   HIGH CONTRAST MODE SUPPORT
   ======================================== */

@media (prefers-contrast: high) {
    :root {
        /* Higher contrast colors for high contrast mode */
        --sbl-purple: #5500aa;
        --sbl-pink: #aa0055;
        --sbl-blue: #0044bb;
        --sbl-primary: #0044bb;
        --sbl-accent: #aa0055;
    }
    
    /* Enhanced borders and outlines */
    .contents {
        border: 2px solid var(--sbl-primary);
    }
    
    .fragment {
        border: 2px solid var(--sbl-accent);
        border-left-width: 6px;
    }
    
    /* High contrast focus indicators */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 4px solid var(--focus-color);
        outline-offset: 2px;
    }
}

/* ========================================
   DARK MODE WITH ACCESSIBILITY
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Enhanced dark mode variables */
    :root {
        --sbl-purple: #aa77ff;     /* Lighter for dark backgrounds */
        --sbl-pink: #ff77bb;       /* Lighter for dark backgrounds */
        --sbl-blue: #4477ff;       /* Adjusted for dark mode */
        --sbl-primary: #4477ff;
        --sbl-secondary: #5588ff;
        --sbl-accent: #ff77bb;
        --sbl-warning: #ffd43b;
        --sbl-danger: #ff6b6b;
        --sbl-info: #4ecdc4;
        --sbl-success: #51cf66;
        --sbl-light: #2c3e50;
        --sbl-dark: #ecf0f1;
        --sbl-gradient-sb: linear-gradient(135deg, #aa77ff 0%, #ff77bb 100%);
        --sbl-gradient-labs: linear-gradient(135deg, #4477ff 0%, #3366ee 100%);
        
        /* Dark mode focus colors */
        --focus-color: #66aaff;
        --focus-background: #1a3d5c;
        --hover-background: #2a4d6c;
    }

    /* Dark background and text colors */
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }

    /* Header styling for dark mode */
    #top {
        background: linear-gradient(135deg, #2856e6 0%, #1a47d1 100%);
    }

    #titlearea {
        border-bottom: 1px solid #444;
        background-color: #1e1e1e;
    }

    .header {
        background-color: #1e1e1e;
    }

    .header .headertitle .title {
        color: var(--sbl-dark);
    }

    .header .headertitle .ingroups {
        color: #aaa;
    }

    /* Navigation styling for dark mode */
    .tablist {
        background: #1e1e1e;
        border-bottom: 2px solid var(--sbl-blue);
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }

    .tablist li a {
        color: #e0e0e0;
    }

    .tablist li a:hover {
        background: var(--hover-background);
        color: var(--sbl-primary);
    }
    
    #nav-tree .item:hover {
        background: var(--hover-background);
    }

    .tablist li.current a {
        background: var(--sbl-gradient-labs);
        color: white;
    }

    /* Sidebar navigation for dark mode */
    #nav-tree {
        background: #1e1e1e;
        border-right: 1px solid #444;
    }

    #nav-tree .item {
        color: #e0e0e0;
    }

    #nav-tree .selected {
        background: var(--sbl-primary);
        color: white;
    }

    /* Content styling for dark mode */
    .contents {
        background: #1e1e1e;
        color: #e0e0e0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    }

    .contents .textblock {
        background: #252525;
        border-left: 4px solid var(--sbl-primary);
    }

    /* Section headers for dark mode */
    h1, h2, h3, h4, h5, h6 {
        color: var(--sbl-dark);
        border-bottom-color: var(--sbl-primary);
    }

    h1 {
        background: var(--sbl-gradient-sb);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    h2 {
        color: var(--sbl-primary);
    }

    h3 {
        color: var(--sbl-secondary);
        border-bottom-color: var(--sbl-primary);
    }

    /* Table of contents for dark mode */
    .toc {
        background: #252525;
        border-color: var(--sbl-primary);
    }

    .toc h3 {
        color: var(--sbl-primary);
        border-bottom-color: var(--sbl-primary);
    }

    /* Tables for dark mode */
    table.markdownTable th,
    table.doxtable th {
        background-color: #2856e6;
        color: white;
    }

    table.markdownTable td,
    table.doxtable td {
        background-color: #1e1e1e;
        border-color: #444;
    }

    table.markdownTable,
    table.doxtable {
        border-color: #444;
    }

    .platform-support th {
        background-color: #2856e6;
    }

    .platform-support tr:nth-child(even) {
        background-color: #252525;
    }

    /* Code blocks for dark mode */
    .fragment {
        background: #0d1117;
        border-left-color: var(--sbl-accent);
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    /* Inline code for dark mode */
    code, tt {
        background: #2c3e50;
        border-color: #444;
        color: #ff7b72;
    }
    
    /* Enhanced dark mode focus indicators */
    a:focus,
    button:focus,
    input:focus,
    select:focus,
    textarea:focus,
    .tablist li a:focus,
    #nav-tree .item:focus {
        outline: 3px solid var(--focus-color);
        background-color: var(--focus-background);
    }

    /* Template parameters for dark mode */
    .tparams {
        background: #1e3a5f;
        border-color: #2856e6;
    }

    /* DOT graphs for dark mode */
    .dotgraph {
        background: #1e1e1e;
        border-color: #444;
    }

    /* API documentation for dark mode */
    .memproto {
        background: linear-gradient(135deg, #2856e6 0%, #1a47d1 100%);
        color: white;
    }

    .memdoc {
        background: #252525;
        border-color: var(--sbl-primary);
        color: #e0e0e0;
    }

    /* Parameters for dark mode */
    .params {
        background: #1e1e1e;
        border-color: #444;
    }

    .params .paramname {
        color: var(--sbl-primary);
    }

    /* Return values for dark mode */
    .retval {
        background: #1a3a1a;
        border-left-color: var(--sbl-accent);
    }

    /* See also for dark mode */
    .see {
        background: #1e3a5f;
        border-left-color: var(--sbl-info);
    }

    /* Links for dark mode */
    a {
        color: var(--sbl-primary);
    }

    a:hover {
        color: var(--sbl-accent);
    }

    a:visited {
        color: #8899ff;
    }

    /* Fix gradient text for dark mode */
    .contents .textblock {
        background: linear-gradient(135deg, #252525 0%, #1e1e1e 100%);
    }

    /* Page background */
    #doc-content {
        background-color: #1a1a1a;
    }

    /* Search box */
    #MSearchBox {
        background-color: #252525;
        border-color: #444;
    }

    #MSearchField {
        background-color: #1e1e1e;
        color: #e0e0e0;
        border-color: #444;
    }

    /* Directory tree items */
    .directory tr.even {
        background-color: #252525;
    }

    .directory tr:hover {
        background-color: #2c3e50;
    }

    /* Member list items */
    .memberdecls tr.even {
        background-color: #252525;
    }

    .memberdecls tr:hover {
        background-color: #2c3e50;
    }

    /* Fix for Doxygen's built-in elements */
    div.summary {
        background-color: #252525;
        border-color: #444;
    }

    div.summary a {
        color: var(--sbl-primary);
    }

    /* Fix nav path */
    .navpath {
        background-color: #252525;
        border-color: #444;
    }

    .navpath li.navelem {
        background-color: #1e1e1e;
    }

    .navpath li.navelem a {
        color: #e0e0e0;
    }

    /* Title area adjustments */
    div.title {
        background-color: #1e1e1e;
        color: #e0e0e0;
    }

    /* Fix footer */
    .footer {
        background-color: #1e1e1e;
        color: #888;
        border-top-color: #444;
    }
}

/* ========================================
   PRINT STYLES FOR ACCESSIBILITY
   ======================================== */

@media print {
    /* Ensure good contrast for printing */
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    /* Remove gradients for print */
    h1 {
        background: none !important;
        color: #333 !important;
        -webkit-text-fill-color: unset !important;
    }
    
    /* Ensure links are distinguishable */
    a {
        text-decoration: underline !important;
        color: #0000EE !important;
    }
    
    /* Show URL for links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}