/* Custom styles for Micromegas documentation */
/* Micromegas Brand Colors - Rust Earth Palette */

/* Brand color palette */
:root {
    --mm-rust-orange: #bf360c;
    --mm-rust-dark: #8d3a14;
    --mm-blue: #1565c0;
    --mm-blue-dark: #0d47a1;
    --mm-gold: #ffc107;
    --mm-gold-dark: #ffb300;
    --mm-dark-bg: #0a0a0f;
    --mm-dark-surface: #1a1a2e;
    --mm-dark-card: #12121a;
    --mm-light-bg: #f5f5f7;
}

/* Light mode - use darker rust as primary for white text contrast */
[data-md-color-scheme="default"] {
    --md-primary-fg-color: #d84315;
    --md-primary-fg-color--light: #e64a19;
    --md-primary-fg-color--dark: #bf360c;
    --md-primary-bg-color: #ffffff;
    --md-primary-bg-color--light: #ffffff;
    --md-accent-fg-color: #1565c0;
    --md-accent-fg-color--transparent: rgba(21, 101, 192, 0.1);
    --md-accent-bg-color: #ffffff;
    --md-accent-bg-color--light: #ffffff;
}

/* Dark mode - use darker rust as primary with darker backgrounds */
[data-md-color-scheme="slate"] {
    --md-primary-fg-color: #e64a19;
    --md-primary-fg-color--light: #ff5722;
    --md-primary-fg-color--dark: #d84315;
    --md-primary-bg-color: #0a0a0f;
    --md-primary-bg-color--light: #12121a;
    --md-accent-fg-color: #42a5f5;
    --md-accent-fg-color--transparent: rgba(66, 165, 245, 0.1);
    --md-accent-bg-color: #0a0a0f;
    --md-accent-bg-color--light: #12121a;
    --md-default-bg-color: #0a0a0f;
    --md-default-bg-color--light: #12121a;
    --md-default-bg-color--lighter: #1a1a2e;
    --md-default-bg-color--lightest: #252538;
    --md-code-bg-color: #12121a;
    --md-footer-bg-color: #0a0a0f;
    --md-footer-bg-color--dark: #050508;
}

/* Header styling */
.md-header {
    background-color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .md-header {
    background-color: #12121a;
    border-bottom: 1px solid #1a1a2e;
}

/* Dark mode header text - ensure visibility */
[data-md-color-scheme="slate"] .md-header__title {
    color: #ffffff;
}

[data-md-color-scheme="slate"] .md-header__topic {
    color: #ffffff;
}

/* Dark mode search input styling */
[data-md-color-scheme="slate"] .md-search__input {
    background-color: #1a1a2e;
    color: #ffffff;
}

[data-md-color-scheme="slate"] .md-search__input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Dark mode header buttons/links */
[data-md-color-scheme="slate"] .md-header__button {
    color: #ffffff;
}

[data-md-color-scheme="slate"] .md-header__source {
    color: #ffffff;
}

/* Dark mode source (GitHub link) repository name */
[data-md-color-scheme="slate"] .md-source__repository {
    color: #ffffff;
}

[data-md-color-scheme="slate"] .md-source__facts {
    color: rgba(255, 255, 255, 0.7);
}

/* Navigation tabs styling */
.md-tabs {
    background-color: var(--md-primary-fg-color);
}

[data-md-color-scheme="slate"] .md-tabs {
    background-color: #0a0a0f;
    border-bottom: 1px solid #1a1a2e;
}

/* Dark mode navigation tab links */
[data-md-color-scheme="slate"] .md-tabs__link {
    color: rgba(255, 255, 255, 0.7);
}

[data-md-color-scheme="slate"] .md-tabs__link:hover,
[data-md-color-scheme="slate"] .md-tabs__link--active {
    color: #ffffff;
}

/* Make header logo larger */
.md-header__button.md-logo img {
    height: 2rem;
    width: auto;
}

/* Make Mermaid diagrams larger */
.mermaid {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 600px !important;
}

/* Increase font size in Mermaid diagrams */
.mermaid .node text,
.mermaid .edgeLabel text,
.mermaid .cluster text {
    font-size: 14px !important;
}

/* Make node boxes larger */
.mermaid .node rect,
.mermaid .node circle,
.mermaid .node ellipse,
.mermaid .node polygon {
    stroke-width: 2px !important;
}

/* Improve spacing between nodes */
.mermaid svg {
    width: 100% !important;
    height: auto !important;
}

/* Make all headers more prominent, especially h5 function names */
.md-typeset h5 {
    font-size: 1.1em !important;
    font-weight: 600 !important;
    margin-top: 1.6rem !important;
    margin-bottom: 0.8rem !important;
    color: var(--md-primary-fg-color) !important;
}

.md-typeset h4 {
    font-size: 1.25em !important;
    font-weight: 700 !important;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
}

.md-typeset h3 {
    font-size: 1.4em !important;
    font-weight: 700 !important;
    margin-top: 2.4rem !important;
    margin-bottom: 1.2rem !important;
}

/* Make function names in h5 stand out more with code styling */
.md-typeset h5 code {
    background-color: var(--md-code-bg-color) !important;
    color: var(--md-code-fg-color) !important;
    padding: 0.2em 0.4em !important;
    border-radius: 0.3em !important;
    font-size: 0.95em !important;
    font-weight: 600 !important;
}

/* Link styling with brand colors */
.md-typeset a {
    color: var(--md-accent-fg-color);
}

.md-typeset a:hover {
    color: var(--md-primary-fg-color);
}

/* Admonition styling with brand accent colors */
.md-typeset .admonition.note,
.md-typeset details.note {
    border-color: var(--mm-blue);
}

.md-typeset .admonition.note > .admonition-title,
.md-typeset details.note > summary {
    background-color: rgba(21, 101, 192, 0.1);
}

.md-typeset .admonition.tip,
.md-typeset details.tip {
    border-color: var(--mm-gold);
}

.md-typeset .admonition.tip > .admonition-title,
.md-typeset details.tip > summary {
    background-color: rgba(255, 193, 7, 0.1);
}

.md-typeset .admonition.warning,
.md-typeset details.warning {
    border-color: var(--mm-rust-orange);
}

.md-typeset .admonition.warning > .admonition-title,
.md-typeset details.warning > summary {
    background-color: rgba(191, 54, 12, 0.1);
}

/* Table of contents styling */
.md-nav__link--active {
    color: var(--md-accent-fg-color) !important;
}

/* Search highlight */
.md-search-result__meta {
    color: var(--md-primary-fg-color);
}

.md-search-result mark {
    background-color: rgba(255, 193, 7, 0.3);
}

/* Footer styling */
.md-footer {
    background-color: var(--md-footer-bg-color);
}

[data-md-color-scheme="slate"] .md-footer {
    background-color: #050508;
    border-top: 1px solid #1a1a2e;
}

/* Button/badge styling with brand colors */
.md-typeset .md-button--primary {
    background-color: var(--md-primary-fg-color);
    border-color: var(--md-primary-fg-color);
}

.md-typeset .md-button--primary:hover {
    background-color: var(--md-primary-fg-color--dark);
    border-color: var(--md-primary-fg-color--dark);
}

/* Code copy button hover */
.md-clipboard:hover {
    color: var(--md-accent-fg-color);
}

/* Cell type icons in headings */
.cell-icon {
    height: 1.2em;
    width: 1.2em;
    vertical-align: text-bottom;
    display: inline;
    margin-right: 0.3em;
}

/* Cell type icons in table of contents */
.md-nav--secondary a[href="#markdown"]::before,
.md-nav--secondary a[href="#variable"]::before,
.md-nav--secondary a[href="#table"]::before,
.md-nav--secondary a[href="#transposed-table"]::before,
.md-nav--secondary a[href="#chart"]::before,
.md-nav--secondary a[href="#log"]::before,
.md-nav--secondary a[href="#property-timeline"]::before,
.md-nav--secondary a[href="#swimlane"]::before,
.md-nav--secondary a[href="#perfetto-export"]::before,
.md-nav--secondary a[href="#reference-table"]::before,
.md-nav--secondary a[href="#horizontal-group-hg"]::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.3em;
    vertical-align: text-bottom;
    background-size: contain;
    background-repeat: no-repeat;
}

.md-nav--secondary a[href="#markdown"]::before { background-image: url("../images/cell-icons/file-text.svg"); }
.md-nav--secondary a[href="#variable"]::before { background-image: url("../images/cell-icons/variable.svg"); }
.md-nav--secondary a[href="#table"]::before { background-image: url("../images/cell-icons/table-2.svg"); }
.md-nav--secondary a[href="#transposed-table"]::before { background-image: url("../images/cell-icons/table-properties.svg"); }
.md-nav--secondary a[href="#chart"]::before { background-image: url("../images/cell-icons/bar-chart-3.svg"); }
.md-nav--secondary a[href="#log"]::before { background-image: url("../images/cell-icons/scroll-text.svg"); }
.md-nav--secondary a[href="#property-timeline"]::before { background-image: url("../images/cell-icons/gantt-chart.svg"); }
.md-nav--secondary a[href="#swimlane"]::before { background-image: url("../images/cell-icons/align-center.svg"); }
.md-nav--secondary a[href="#perfetto-export"]::before { background-image: url("../images/cell-icons/download.svg"); }
.md-nav--secondary a[href="#reference-table"]::before { background-image: url("../images/cell-icons/book-open.svg"); }
.md-nav--secondary a[href="#horizontal-group-hg"]::before { background-image: url("../images/cell-icons/group.svg"); }

/* Sidebar navigation active item */
.md-nav__item--active > .md-nav__link {
    color: var(--md-primary-fg-color);
    font-weight: 600;
}

/* Screenshot images */
.screenshot {
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--md-default-fg-color--lightest);
    border-radius: 4px;
    margin: 1rem 0;
    display: block;
}
