/*
 * WiZ Visual While* Web Interface - Dark Theme Only
 */

:root {
    color-scheme: dark;
}

body {
    margin: 40px auto;
    max-width: 1400px;
    background-color: #0d1117 !important;
    color: #e6edf3 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

.fixed {
    width: 50%;
}
.fixed30 {
    width: 30%;
}
.fixed20 {
    width: 20%;
}
.flex-item {
    flex-grow: 1;
}

/* Containers and panels */
.gray {
    padding: 12px;
    border: 1px solid #30363d;
    background-color: #161b22;
    color: #e6edf3;
    border-radius: 6px;
}

.configuration {
    padding: 12px;
    border: 1px solid #30363d;
    background-color: #161b22;
    border-radius: 6px;
    color: #e6edf3;
}

.result {
    padding: 12px;
    border: 1px solid #30363d;
    background-color: #161b22;
    border-radius: 6px;
    color: #e6edf3;
}

/* Syntax / Semantic highlighting */
.addr {
    color: #7ee787;
    font-weight: bold;
}

.read {
    color: #ff7b72;
    font-weight: bold;
}

.write {
    color: #79c0ff;
    font-weight: bold;
}

.vname {
    color: #f2cc60;
    font-weight: bold;
}

.scrollpane {
    overflow-x: auto;
    overflow-y: hidden;
}

/* Proof tree */
.proof {
    text-align: center;
    display: inline-block;
    width: max-content;
    margin: 20px;
}
.premise {
    display: inline-block;
    margin-left: 1em;
    margin-right: 1em;
}
.conclusion {
    display: inline;
}

.rule {
    border-top: 1px solid #8b949e;
    text-align: right;
    display: block;
    height: 1px;
    z-index: 2;
}

.rulename {
    background-color: #21262d;
    border: 1px solid #30363d;
    padding: 2px 5px;
    color: #f0f6fc;
    font-size: x-small;
    visibility: hidden;
    z-index: 1;
    position: relative;
    display: inline-block;
    height: auto;
    top: -1.5em;
    border-radius: 4px;
}

.ctx {
    margin: 1em;
}

.proof:hover .rule .rulename {
    visibility: visible;
}

.tt {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Monaco editor root & wrapper */
#monaco-editor-root {
    border: 1px solid #30363d;
    border-radius: 6px;
    width: 100%;
    height: calc(80vh - 7.5rem - 70px);
    flex-grow: 1;
    background-color: #1e1e1e;
    overflow: hidden;
}

/* Instant text fallback shown until Monaco has initialized. */
#code-fallback {
    position: absolute;
    inset: 0;
    z-index: 2;
    margin: 0;
    padding: 12px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre;
    overflow: auto;
    tab-size: 4;
}

.wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

#status-msg {
    color: #ff7b72;
}

/* Mermaid & graph styling */
g.node {
    cursor: pointer;
}

g.node rect, g.node polygon, g.node circle {
    fill: #161b22 !important;
    stroke: #388bfd !important;
}

g.node .label text, g.node text {
    fill: #e6edf3 !important;
}

g.node:hover rect, g.node:hover polygon, g.node:hover circle {
    fill: #21262d !important;
    stroke: #58a6ff !important;
    stroke-width: 3px !important;
}

.highlight-row td {
    background-color: #1f3557 !important;
    color: #f0f6fc !important;
}

.mermaidTooltip {
    position: absolute;
    text-align: center;
    max-width: 250px;
    padding: 8px 12px;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    background: #21262d;
    color: #f0f6fc;
    border: 1px solid #30363d;
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 100;
    opacity: 0.98;
}

/* Dark mode form controls */
.form-control {
    background-color: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

.form-control:focus {
    background-color: #161b22 !important;
    border-color: #58a6ff !important;
    color: #e6edf3 !important;
    box-shadow: 0 0 0 0.25rem rgba(88, 166, 255, 0.25) !important;
}

/* Accordion */
.accordion {
    --bs-accordion-bg: #161b22;
    --bs-accordion-color: #e6edf3;
    --bs-accordion-border-color: #30363d;
}

/* Tables */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: #e6edf3;
    border-color: #30363d;
}

.table th, .table td {
    border-color: #30363d;
}

/* Links */
a {
    color: #58a6ff;
    text-decoration: none;
}
a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* Footer disclaimer box */
.wiz-footer {
    background-color: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wiz-footer .badge-mirror {
    background-color: #21262d;
    color: #8b949e;
    border: 1px solid #30363d;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.4em 0.8em;
    border-radius: 6px;
}
