/* Custom theme overrides */
:root {
    --md-primary-fg-color: #ff1744;
    --md-primary-fg-color--light: #000000;
    --md-primary-fg-color--dark: #000000;
    --md-accent-fg-color: #ff1744;
    --md-accent-fg-color--transparent: rgba(52, 152, 219, 0.1);
    --md-default-bg-color: #000000;
    --md-default-fg-color: #ffffff;
    --wcag-focus-outline: none;
    --wcag-focus-outline-dark: 3px solid #ff1744;
    --wcag-link-color: #ffffff;
    --wcag-link-hover: #ff1744;
    --wcag-bg-light: #fff;
    --wcag-bg-dark: #111;
    --wcag-text-dark: #111;
    --wcag-text-light: #fff;
}

/* Base styles */
body, .md-content, .md-main, .md-typeset {
    background: #000000 !important;
    color: #ffffff !important;
}

/* Navigation content wrapper */
.wy-nav-content-wrap {
    margin-left: 300px;
    background: #000000 !important;
    min-height: 100%;
}

.wy-nav-content {
    background: #000000 !important;
    color: #ffffff !important;
}

/* Menu styles */
.wy-menu-vertical {
    background: #000000 !important;
}

.wy-menu-vertical li.toctree-l1.current > a {
    background: #000000 !important;
    border-bottom: solid 1px #000000 !important;
    border-top: solid 1px #000000 !important;
    color: #ffffff !important;
}

.wy-menu-vertical li.toctree-l1 > a {
    color: #ffffff !important;
    background: #000000 !important;
}

.wy-menu-vertical li.toctree-l1 > a:hover {
    background: #000000 !important;
    color: #ff1744 !important;
}

/* Nested menu items */
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a {
    background: #000000 !important;
    color: #ffffff !important;
}

.wy-menu-vertical li.toctree-l2 > a {
    color: #ffffff !important;
    background: #000000 !important;
}

.wy-menu-vertical li.toctree-l3 > a {
    color: #ffffff !important;
    background: #000000 !important;
}

.wy-menu-vertical li.toctree-l2 > a:hover,
.wy-menu-vertical li.toctree-l3 > a:hover {
    background: #000000 !important;
    color: #ff1744 !important;
}

/* Image styles */
.md-typeset img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

/* Custom header styles */
.md-header {
    background-color: #000000;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

/* Custom navigation styles */
.md-nav__title {
    color: var(--md-primary-fg-color);
    font-weight: 600;
}

.md-nav__link {
    color: #ffffff;
}

.md-nav__link:hover {
    color: var(--md-accent-fg-color);
}

/* Custom content styles */
.md-content {
    max-width: 1200px;
}

.md-content h1 {
    color: var(--md-primary-fg-color);
    border-bottom: 2px solid var(--md-accent-fg-color);
    padding-bottom: 0.5rem;
}

.md-content h2 {
    color: #ffffff;
}

/* Custom code block styles */
.md-typeset pre {
    background-color: #111111;
    border-radius: 4px;
    border: 1px solid #333333;
}

.md-typeset code {
    color: #ff1744;
    background-color: rgba(255, 23, 68, 0.1);
}

/* Custom table styles */
.md-typeset table {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
    background: #000000;
    color: #ffffff;
}

.md-typeset th {
    background-color: #111111;
    color: #ffffff;
}

.md-typeset td {
    color: #ffffff;
}

/* Custom admonition styles */
.md-typeset .admonition {
    border-radius: 4px;
    border: none;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
    background: #111111;
    color: #ffffff;
}

.md-typeset .admonition-title {
    border-radius: 4px 4px 0 0;
    background: #111111;
    color: #ffffff;
}

/* Custom search styles */
.md-search__input {
    background-color: #111111;
    border-radius: 4px;
    color: #ffffff;
}

.md-search__input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Custom footer styles */
.md-footer {
    background-color: #000000;
}

.md-footer-copyright {
    color: rgba(255, 255, 255, 0.7);
}

/* Custom button styles */
.md-button {
    border-radius: 4px;
    transition: all 0.3s ease;
    background: #111111;
    color: #ffffff;
}

.md-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

/* Custom scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #000000;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444444;
}

/* Custom mobile styles */
@media screen and (max-width: 76.1875em) {
    .md-nav--primary .md-nav__title {
        background-color: #000000;
    }
    
    .md-nav--primary .md-nav__title::before {
        color: #ffffff;
    }
    
    .md-nav__source {
        background-color: #111111;
    }
}

/* Custom print styles */
@media print {
    .md-content {
        max-width: none;
    }
    
    .md-typeset pre {
        white-space: pre-wrap;
    }
    
    .md-footer {
        display: none;
    }
}

/* WCAG 2.2 Accessibility Improvements */
:root {
    --wcag-focus-outline: 3px solid #ffbf47;
    --wcag-focus-outline-dark: 3px solid #ff1744;
    --wcag-link-color: #ff1744;
    --wcag-link-hover: #ff1744;
    --wcag-bg-light: #000000;
    --wcag-bg-dark: #000000;
    --wcag-text-dark: #ffffff;
    --wcag-text-light: #ffffff;
}

/* Focus styles for all interactive elements */
a, button, input, textarea, select, summary {
    outline: none;
    transition: box-shadow 0.2s, outline 0.2s;
}

a:focus, button:focus, input:focus, textarea:focus, select:focus, summary:focus {
    outline: var(--wcag-focus-outline);
    box-shadow: 0 0 0 3px rgba(255,191,71,0.5);
    z-index: 2;
}

/* Links with high contrast */
.md-typeset a, .md-typeset a:visited {
    color: var(--wcag-link-color) !important;
    text-decoration: underline;
}

.md-typeset a:hover, .md-typeset a:focus {
    color: var(--wcag-link-hover) !important;
    background: rgba(255, 23, 68, 0.1);
}

/* Larger base font and line height for readability */
body, .md-typeset {
    font-size: 1.1em;
    line-height: 1.7;
}

/* Table accessibility */
.md-typeset table {
    border-collapse: collapse;
    width: 100%;
}

.md-typeset th, .md-typeset td {
    border: 1px solid #333333;
    padding: 0.5em 1em;
}

.md-typeset th {
    background: #111111;
    color: #ffffff;
    font-weight: bold;
}

/* Ensure buttons are large enough */
button, .md-button {
    min-height: 44px;
    min-width: 44px;
    font-size: 1em;
}

/* Ensure form fields are large enough */
input, textarea, select {
    min-height: 44px;
    font-size: 1em;
}

/* Remove text-shadow for clarity */
.md-header, .md-footer, .md-nav, .md-sidebar, .md-nav__title, .md-nav__item, .md-nav__link {
    text-shadow: none !important;
}

/* Ensure sufficient color contrast for code blocks */
.md-typeset pre, .md-typeset code {
    background: #111111 !important;
    color: #ff1744 !important;
}

/* Add skip to content link for keyboard users */
.skip-to-content {
    position: absolute;
    left: -999px;
    top: 10px;
    background: #ff1744;
    color: #ffffff;
    padding: 8px 16px;
    z-index: 1000;
    border-radius: 4px;
    font-weight: bold;
}

.skip-to-content:focus {
    left: 10px;
    outline: var(--wcag-focus-outline);
}

/* Custom styles for Read the Docs theme */

/* Import Roboto font */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* Base styles */
body {
    font-family: 'Roboto', sans-serif;
    background: #000000;
}

/* Main content area */
.wy-nav-content {
    max-width: 1200px;
    background: #000000;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
    color: #e74c3c;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

/* Links */
a {
    color: #e74c3c;
    font-family: 'Roboto', sans-serif;
}

a:hover {
    color: #c0392b;
}

/* Sidebar */
.wy-side-nav-search {
    background-color: #e74c3c;
    font-family: 'Roboto', sans-serif;
    padding: 1.5em;
}

.wy-side-nav-search input[type="text"] {
    border-color: #c0392b;
    background: #000000;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    border-radius: 4px;
    padding: 8px;
}

/* Navigation */
.wy-nav-side {
    background: #000000;
    font-family: 'Roboto', sans-serif;
    border-right: 1px solid #000000;
}

.wy-menu-vertical {
    background: #000000;
}

.wy-menu-vertical li.current {
    background: #000000;
    border-right: 4px solid #e74c3c;
}

.wy-menu-vertical li.current > a {
    color: #e74c3c;
    font-weight: bold;
    padding: 0.5em 1em;
}

.wy-menu-vertical li.current > a:hover {
    background: #000000;
    color: #e74c3c;
}

.wy-menu-vertical li a {
    color: #e74c3c;
    padding: 0.5em 1em;
    border-bottom: 1px solid #000000;
}

.wy-menu-vertical li a:hover {
    background: #000000;
    color: #e74c3c;
}

.wy-menu-vertical li.toctree-l1.current > a {
    background: #2a2a2a;
    border-right: 4px solid #e74c3c;
}

.wy-menu-vertical li.toctree-l2.current > a {
    background: #2a2a2a;
    border-right: 4px solid #e74c3c;
}

.wy-menu-vertical li.toctree-l3.current > a {
    background: #2a2a2a;
    border-right: 4px solid #e74c3c;
}

/* Code blocks */
.rst-content pre.literal-block {
    background: #000000;
    border: 1px solid #333333;
    color: #ffffff;
    font-family: 'Roboto Mono', monospace;
    border-radius: 4px;
    padding: 1em;
    position: relative;
}

/* Code block copy button */
.code-block-wrapper {
    position: relative;
}

.copy-button {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5em 1em;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: background-color 0.3s;
}

.copy-button:hover {
    background: #c0392b;
}

/* Admonitions */
.rst-content .admonition {
    background: #000000;
    border-left: 4px solid #e74c3c;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    border-radius: 4px;
    margin: 1em 0;
}

.rst-content .admonition-title {
    background: #e74c3c;
    color: white;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    padding: 0.5em 1em;
}

/* Tables */
.rst-content table.docutils {
    border: 1px solid #333333;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    border-radius: 4px;
    overflow: hidden;
}

.rst-content table.docutils th {
    background: #2a2a2a;
    font-weight: 500;
    padding: 0.8em;
}

.rst-content table.docutils td {
    background: #000000;
    padding: 0.8em;
}

/* Table wrapper for responsiveness */
.table-wrapper {
    overflow-x: auto;
    margin: 1em 0;
}

/* Mobile menu button */
.wy-nav-top {
    background: #e74c3c;
    font-family: 'Roboto', sans-serif;
    padding: 0.8em;
}

/* Version selector */
.rst-versions {
    background: #000000;
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    border-top: 1px solid #333333;
}

.rst-versions .rst-current-version {
    background: #2a2a2a;
    color: #e74c3c;
    padding: 0.8em;
}

/* General text */
.rst-content {
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
}

/* Search */
.wy-side-nav-search input[type="text"]::placeholder {
    color: #999999;
    font-family: 'Roboto', sans-serif;
}

/* Footer */
footer {
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    background: #000000;
    padding: 1em;
    border-top: 1px solid #333333;
}

/* Version selector text */
.rst-versions .rst-current-version {
    color: #ffffff;
}

/* Version selector links */
.rst-versions a {
    color: #e74c3c;
}

/* Version selector hover */
.rst-versions a:hover {
    color: #c0392b;
}

/* Breadcrumbs */
.wy-breadcrumbs {
    color: #ffffff;
    font-family: 'Roboto', sans-serif;
    background: #000000;
    padding: 1em;
    border-bottom: 1px solid #333333;
}

.wy-breadcrumbs a {
    color: #e74c3c;
}

.wy-breadcrumbs a:hover {
    color: #c0392b;
}

/* Code syntax highlighting */
.highlight {
    background: #000000;
    font-family: 'Roboto Mono', monospace;
    border-radius: 4px;
    padding: 1em;
}

.highlight .k {
    color: #e74c3c;
}

.highlight .n {
    color: #ffffff;
}

.highlight .s {
    color: #2ecc71;
}

.highlight .mi {
    color: #f1c40f;
}

/* Mobile menu improvements */
@media screen and (max-width: 768px) {
    .wy-nav-side {
        position: absolute;
        left: -260px;
        top: 0;
        width: 250px;
        height: 100%;
        z-index: 2000;
        transition: left 0.3s;
    }
    .wy-nav-side.nav-open {
        left: 0;
    }
    .wy-nav-content-wrap {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        transition: margin-left 0.3s;
    }
    .wy-nav-content {
        max-width: 100vw !important;
        padding: 1em !important;
    }
    .md-content {
        max-width: 100vw !important;
        padding: 1em !important;
    }
    .wy-nav-top {
        display: block !important;
        background: #000000;
        border-bottom: 1px solid #000000;
        position: fixed;
        width: 100vw;
        top: 0;
        left: 0;
        z-index: 2100;
    }
    .wy-nav-top a {
        color: #e74c3c;
    }
    .wy-menu-vertical li a {
        padding: 1em 1.5em;
    }
    /* First column styles on mobile */
    .wy-menu-vertical li.toctree-l1:first-child {
        display: block !important;
        background: #000000;
    }
    .wy-menu-vertical li.toctree-l1:first-child > a {
        color: #e74c3c;
        font-weight: bold;
        padding: 1em 1.5em;
        border-bottom: 1px solid #000000;
    }
    .wy-menu-vertical li.toctree-l1:first-child.current {
        background: #000000;
        border-right: 4px solid #e74c3c;
    }
    .wy-menu-vertical li.toctree-l1:first-child.current > a {
        background: #000000;
        color: #e74c3c;
    }
    /* Ensure first column is expanded by default */
    .wy-menu-vertical li.toctree-l1:first-child.current > ul {
        display: block !important;
    }
}

/* External link tooltip */
[title="External link"] {
    position: relative;
}

[title="External link"]:after {
    content: "↗";
    margin-left: 0.2em;
    font-size: 0.8em;
}

/* Navigation menu styles */
.wy-nav-side {
    background: #000000;
    border-right: 1px solid #000000;
}

.wy-side-nav-search {
    background: #000000;
    border-bottom: 1px solid #000000;
}

.wy-side-nav-search input[type="text"] {
    background: #000000;
    border: 1px solid #000000;
    color: #ffffff;
}

.wy-menu-vertical {
    background: #000000;
}

.wy-menu-vertical li.current {
    background: #000000;
    border-right: 4px solid #e74c3c;
}

.wy-menu-vertical li.current > a {
    color: #e74c3c;
    font-weight: bold;
    padding: 0.5em 1em;
}

.wy-menu-vertical li.current > a:hover {
    background: #000000;
    color: #e74c3c;
}

.wy-menu-vertical li > a {
    color: #e74c3c;
    padding: 0.5em 1em;
    border-bottom: 1px solid #000000;
}

.wy-menu-vertical li > a:hover {
    background: #000000;
    color: #e74c3c;
}

.wy-menu-vertical li.on a {
    background: #000000;
    color: #e74c3c;
    border-right: 4px solid #e74c3c;
}

.wy-menu-vertical li.on a:hover {
    background: #000000;
    color: #e74c3c;
}

.wy-menu-vertical li ul {
    display: none;
    border-top: 1px solid #000000;
    background: #000000;
}

.wy-menu-vertical li ul li {
    background: #000000;
}

.wy-menu-vertical li ul li a {
    color: #e74c3c;
    padding: 0.4em 1em 0.4em 2em;
    background: #000000;
}

.wy-menu-vertical li ul li a:hover {
    background: #000000;
    color: #e74c3c;
}

/* Mobile menu improvements */
@media screen and (max-width: 768px) {
    .wy-nav-top {
        background: #000000;
        border-bottom: 1px solid #000000;
    }

    .wy-nav-top a {
        color: #e74c3c;
    }

    .wy-nav-side {
        background: #000000;
    }

    .wy-menu-vertical li.current {
        background: #000000;
    }

    .wy-menu-vertical li.current > a {
        color: #e74c3c;
        font-weight: bold;
    }
}

/* Navigation items */
.wy-nav-content-wrap .wy-nav-content {
    background: #000000;
}

.wy-nav-content-wrap .wy-nav-content a {
    color: #e74c3c;
}

.wy-nav-content-wrap .wy-nav-content a:hover {
    color: #e74c3c;
    text-decoration: underline;
}

.wy-nav-content-wrap .wy-nav-content a:visited {
    color: #e74c3c;
}

.wy-nav-content-wrap .wy-nav-content a:active {
    color: #e74c3c;
}

/* Remove hover background for all menu items */
.toctree-l1:hover,
.toctree-l2:hover,
.toctree-l3:hover,
.toctree-l1 > a:hover,
.toctree-l2 > a:hover,
.toctree-l3 > a:hover,
.wy-menu-vertical li:hover,
.wy-menu-vertical li > a:hover,
.wy-menu-vertical li ul li:hover,
.wy-menu-vertical li ul li > a:hover,
.wy-menu-vertical li.current:hover,
.wy-menu-vertical li.current > a:hover,
.wy-menu-vertical li.on:hover,
.wy-menu-vertical li.on > a:hover {
    background: #000000 !important;
}

/* WCAG 2.2 Accessibility Improvements */
:root {
  --wcag-focus-outline: 3px solid #ffbf47;
  --wcag-focus-outline-dark: 3px solid #ff1744;
  --wcag-link-color: #005ea5;
  --wcag-link-hover: #ff1744;
  --wcag-bg-light: #fff;
  --wcag-bg-dark: #111;
  --wcag-text-dark: #111;
  --wcag-text-light: #fff;
}

/* Focus styles for all interactive elements */
a, button, input, textarea, select, summary {
  outline: none;
  transition: box-shadow 0.2s, outline 0.2s;
}
a:focus, button:focus, input:focus, textarea:focus, select:focus, summary:focus {
  outline: var(--wcag-focus-outline);
  box-shadow: 0 0 0 3px rgba(255,191,71,0.5);
  z-index: 2;
}
[data-md-color-scheme="slate"] a:focus, [data-md-color-scheme="slate"] button:focus, [data-md-color-scheme="slate"] input:focus, [data-md-color-scheme="slate"] textarea:focus, [data-md-color-scheme="slate"] select:focus, [data-md-color-scheme="slate"] summary:focus {
  outline: var(--wcag-focus-outline-dark);
  box-shadow: 0 0 0 3px rgba(255,23,68,0.5);
}

/* Ensure sufficient contrast for text */
body, .md-content, .md-main, .md-typeset {
  color: var(--wcag-text-dark) !important;
  background: var(--wcag-bg-light) !important;
}
[data-md-color-scheme="slate"] body, [data-md-color-scheme="slate"] .md-content, [data-md-color-scheme="slate"] .md-main, [data-md-color-scheme="slate"] .md-typeset {
  color: var(--wcag-text-light) !important;
  background: var(--wcag-bg-dark) !important;
}

/* Links with high contrast */
.md-typeset a, .md-typeset a:visited {
  color: var(--wcag-link-color) !important;
  text-decoration: underline;
}
.md-typeset a:hover, .md-typeset a:focus {
  color: var(--wcag-link-hover) !important;
  background: #fff3cd;
}
[data-md-color-scheme="slate"] .md-typeset a, [data-md-color-scheme="slate"] .md-typeset a:visited {
  color: #ffbf47 !important;
}
[data-md-color-scheme="slate"] .md-typeset a:hover, [data-md-color-scheme="slate"] .md-typeset a:focus {
  color: #fff !important;
  background: #ff1744;
}

/* Larger base font and line height for readability */
body, .md-typeset {
  font-size: 1.1em;
  line-height: 1.7;
}

/* Table accessibility */
.md-typeset table {
  border-collapse: collapse;
  width: 100%;
}
.md-typeset th, .md-typeset td {
  border: 1px solid #888;
  padding: 0.5em 1em;
}
.md-typeset th {
  background: #f5f5f5;
  color: #111;
  font-weight: bold;
}
[data-md-color-scheme="slate"] .md-typeset th {
  background: #222;
  color: #ffbf47;
}

/* Ensure buttons are large enough */
button, .md-button {
  min-height: 44px;
  min-width: 44px;
  font-size: 1em;
}

/* Ensure form fields are large enough */
input, textarea, select {
  min-height: 44px;
  font-size: 1em;
}

/* Remove text-shadow for clarity */
.md-header, .md-footer, .md-nav, .md-sidebar, .md-nav__title, .md-nav__item, .md-nav__link {
  text-shadow: none !important;
}

/* Ensure sufficient color contrast for code blocks */
.md-typeset pre, .md-typeset code {
  background: #222 !important;
  color: #ffbf47 !important;
}
[data-md-color-scheme="slate"] .md-typeset pre, [data-md-color-scheme="slate"] .md-typeset code {
  background: #111 !important;
  color: #ffbf47 !important;
}

/* Add skip to content link for keyboard users */
.skip-to-content {
  position: absolute;
  left: -999px;
  top: 10px;
  background: #ffbf47;
  color: #111;
  padding: 8px 16px;
  z-index: 1000;
  border-radius: 4px;
  font-weight: bold;
}
.skip-to-content:focus {
  left: 10px;
  outline: var(--wcag-focus-outline);
}

/* Remove yellow highlight from toctree-expand button */
.toctree-expand {
    outline: none !important;
    box-shadow: none !important;
}

.toctree-expand:focus {
    outline: none !important;
    box-shadow: none !important;
}

.toctree-expand:focus-visible {
    outline: none !important;
    box-shadow: none !important;
} 