/* Ultra theme customizations for mdbook */

:root {
    --ultra-accent: #6ee7b7;
    --ultra-bg: #0a0c10;
    --ultra-bg-elevated: #12151c;
}

/* Dark theme overrides */
.navy {
    --bg: #0a0c10;
    --sidebar-bg: #12151c;
    --sidebar-fg: #e4e8f0;
    --sidebar-active: #6ee7b7;
    --links: #6ee7b7;
    --inline-code-color: #c3e88d;
}

/* Code blocks */
.navy pre {
    background-color: #12151c !important;
    border: 1px solid #2a3142;
    border-radius: 8px;
}

.navy code {
    font-family: "JetBrains Mono", "Fira Code", monospace;
}

/* Syntax highlighting */
.navy .hljs-keyword {
    color: #c792ea;
}

.navy .hljs-function {
    color: #82aaff;
}

.navy .hljs-string {
    color: #c3e88d;
}

.navy .hljs-number {
    color: #f78c6c;
}

.navy .hljs-comment {
    color: #5c6a72;
    font-style: italic;
}

/* Tables */
.navy table {
    border-collapse: collapse;
    width: 100%;
}

.navy th,
.navy td {
    border: 1px solid #2a3142;
    padding: 8px 12px;
}

.navy th {
    background-color: #12151c;
    color: #6ee7b7;
    font-weight: 600;
    text-align: left;
}

.navy tr:hover {
    background-color: rgba(110, 231, 183, 0.05);
}

/* Headers */
.navy h1,
.navy h2,
.navy h3 {
    color: #e4e8f0;
    border-bottom-color: #2a3142;
}

.navy h1 {
    font-size: 2rem;
}

/* Sidebar */
.navy .sidebar {
    font-size: 0.9rem;
}

.navy .sidebar .sidebar-scrollbox {
    padding: 20px;
}

.navy .sidebar a {
    color: #8b95a8;
}

.navy .sidebar a:hover {
    color: #e4e8f0;
}

.navy .sidebar a.active {
    color: #6ee7b7;
}

/* Search */
.navy #searchbar {
    background-color: #12151c;
    border: 1px solid #2a3142;
    color: #e4e8f0;
}

/* Blockquotes */
.navy blockquote {
    border-left: 4px solid #6ee7b7;
    background-color: rgba(110, 231, 183, 0.05);
    padding: 1rem;
    margin: 1rem 0;
}

/* Links */
.navy a:hover {
    text-decoration: underline;
}

/* Page header */
.navy .page-title h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}


/* Print styling */
@media print {
    .navy {
        --bg: white;
        --fg: black;
    }
}


/* Ace Editor Integration */
.ultra-editor-wrapper {
    margin: 1.5rem 0;
    border: 1px solid #2a3142;
    border-radius: 8px;
    background: #12151c;
    overflow: hidden;
}

.ultra-ace-editor {
    width: 100%;
    min-height: 100px;
    font-size: 14px;
}

.ultra-toolbar {
    padding: 8px 12px;
    background: #1a1e26;
    border-top: 1px solid #2a3142;
    border-bottom: 1px solid #2a3142;
    display: flex;
    justify-content: flex-end;
}

.ultra-run-btn {
    background: #6ee7b7;
    color: #000;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.ultra-run-btn:hover {
    background: #4ade80;
    transform: translateY(-1px);
}

.ultra-results-container {
    display: flex;
    border-top: 1px solid #2a3142;
    min-height: 0;
}

.ultra-output {
    flex: 1;
    padding: 12px;
    font-family: "JetBrains Mono", monospace;
    font-size: 1rem;
    white-space: pre-wrap;
    background: #0d1117;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
    transition: all 0.2s;
    border-right: 1px solid #2a3142;
}

.ultra-svg-viewer {
    flex: 1;
    background: #06080a;
    min-height: 150px;
    min-width: 250px;
    position: relative;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ultra-svg-viewer:active {
    cursor: grabbing;
}

.ultra-svg-viewer svg {
    width: 100%;
    height: 100%;
}

.ultra-output:empty {
    display: block;
    /* Always show if in grid */
}

.ultra-output.running {
    color: #ffd700;
    font-style: italic;
}

.ultra-output.success {
    color: #e4e8f0;
}

.ultra-output.error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}