/*
 * Transparency Project layout & typography.
 * Extends the existing palette defined in ../styles.css.
 */

:root {
    --nav-border: rgba(0, 255, 0, 0.35);
    --nav-hover-bg: rgba(0, 255, 0, 0.08);
    --nav-active-bg: rgba(0, 255, 0, 0.18);
    --report-border: rgba(0, 255, 0, 0.15);
    --report-alt-row: rgba(0, 30, 0, 0.45);
}

/* Top-level site nav */
.top-nav {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 15px auto;
    display: flex;
    gap: 0;
    justify-content: center;
    border-bottom: 1px solid var(--nav-border);
    padding: 0 10px;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.top-nav-link {
    padding: 10px 18px;
    color: var(--primary);
    text-decoration: none;
    font-family: 'Courier Prime', monospace;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: -1px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.top-nav-link:hover {
    background: var(--nav-hover-bg);
    color: var(--highlight);
}

.top-nav-link.active {
    background: var(--nav-active-bg);
    border-color: var(--nav-border);
    color: var(--highlight);
    font-weight: bold;
}

/* Transparency page body/container overrides */
body.transparency-body {
    justify-content: flex-start;
    padding: 15px;
}

.container.transparency-container {
    max-width: 1100px;
    text-align: left;
    padding: 20px 25px 30px 25px;
}

.transparency-header {
    text-align: center;
    margin-bottom: 10px;
}

.transparency-header .page-heading {
    margin-bottom: 5px;
}

.transparency-subtitle {
    margin: 0;
    color: var(--primary);
    opacity: 0.85;
}

.transparency-disclaimer {
    margin: 0.5rem 0 0 0;
    color: #ff3333;
    font-size: 0.9rem;
}

.transparency-meta {
    margin: 6px 0 0 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.last-updated {
    color: var(--highlight);
    font-family: monospace;
}

.last-updated.stale {
    color: #ff9966;
}

/* Sub-navigation (report sections) */
.sub-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 15px 0 20px 0;
    border-top: 1px dashed var(--nav-border);
    border-bottom: 1px dashed var(--nav-border);
    padding: 8px 0;
}

.sub-nav-link {
    color: var(--primary);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-family: 'Courier Prime', monospace;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sub-nav-link:hover {
    background: var(--nav-hover-bg);
    color: var(--highlight);
    border-color: var(--nav-border);
}

.sub-nav-link.active {
    background: var(--nav-active-bg);
    color: var(--highlight);
    border-color: var(--nav-border);
    font-weight: bold;
}

/* Report content area */
.report-view {
    min-height: 200px;
}

.report-view .loading {
    opacity: 0.7;
    font-style: italic;
    text-align: center;
    padding: 40px 0;
}

.report {
    line-height: 1.55;
}

.report-meta {
    padding-bottom: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--report-border);
    font-size: 0.85rem;
    opacity: 0.85;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.report-title {
    color: var(--highlight);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.report h1,
.report h2,
.report h3,
.report h4 {
    color: var(--highlight);
    margin-top: 1.6em;
    margin-bottom: 0.4em;
    line-height: 1.25;
    text-shadow: 0 0 5px rgba(247, 212, 23, 0.2);
}

.report h1 {
    font-size: 1.35rem;
    border-bottom: 1px solid var(--nav-border);
    padding-bottom: 6px;
}

.report h2 { font-size: 1.15rem; }
.report h3 { font-size: 1rem; }
.report h4 { font-size: 0.95rem; opacity: 0.9; }

.report p,
.report li {
    font-size: 0.92rem;
}

/* terminal.css sets em to light-theme --font-color (#151515); markdown _italics_ use <em>. */
.report em {
    color: var(--primary);
}

.report a {
    color: var(--highlight);
    text-decoration: none;
    border-bottom: 1px dashed var(--highlight);
    word-break: break-word;
}

.report a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.report ul,
.report ol {
    padding-left: 22px;
}

.report code {
    background: rgba(0, 255, 0, 0.08);
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 0.88em;
    color: var(--highlight);
    word-break: break-all;
}

.report pre {
    background: rgba(0, 10, 0, 0.7);
    border: 1px solid var(--report-border);
    padding: 10px 12px;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.4;
}

.report pre code {
    background: transparent;
    padding: 0;
    color: var(--primary);
}

.report blockquote {
    border-left: 3px solid var(--highlight);
    padding: 4px 12px;
    margin: 12px 0;
    background: rgba(247, 212, 23, 0.05);
    opacity: 0.95;
}

.report table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 20px 0;
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
}

.report table th,
.report table td {
    border: 1px solid var(--report-border);
    padding: 6px 9px;
    text-align: left;
    vertical-align: top;
    color: var(--primary);
    background-clip: padding-box;
}

.report table td {
    color: var(--primary);
}

.report table th {
    background: rgba(0, 255, 0, 0.1);
    color: var(--highlight);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
}

.report table tr:nth-child(even) td {
    background: var(--report-alt-row);
}

.report table strong {
    color: var(--highlight);
}

.report hr {
    border: none;
    border-top: 1px dashed var(--report-border);
    margin: 20px 0;
}

/* Key-value summary table emitted by the data-accuracy renderer */
.report .kv-table td:first-child {
    white-space: nowrap;
    color: var(--highlight);
    font-family: monospace;
    font-size: 0.82rem;
}

/* Sudo section: iframe'd standalone reports */
.sudo-frame {
    margin: 30px 0;
    border: 1px solid var(--report-border);
    padding: 12px;
    background: rgba(0, 10, 0, 0.3);
}

.sudo-frame h2 {
    margin-top: 0;
}

.sudo-frame iframe {
    width: 100%;
    height: 75vh;
    border: 1px solid var(--report-border);
    background: rgba(0, 10, 0, 0.4);
}

/* Fallback: ensure sudo embeds are full-size even if wrapper class differs. */
.report iframe[src*="sudo/"] {
    width: 100%;
    min-height: 75vh;
    border: 1px solid var(--report-border);
    background: rgba(0, 10, 0, 0.4);
}

.iframe-openlink {
    margin: 8px 0 0 0;
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Missing / error placeholder */
.missing-report {
    text-align: center;
    padding: 40px 20px;
    border: 1px dashed var(--nav-border);
    background: rgba(0, 10, 0, 0.3);
}

.missing-report h2 {
    color: var(--highlight);
}

.missing-report .muted {
    opacity: 0.65;
    font-size: 0.85rem;
    margin-top: 12px;
}

/* Downloads block */
.downloads {
    margin-top: 30px;
    padding: 14px 18px;
    border: 1px solid var(--report-border);
    background: rgba(0, 10, 0, 0.45);
}

.downloads h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--highlight);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
}

.downloads ul {
    margin: 0;
    padding-left: 18px;
}

.downloads li {
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.downloads a {
    color: var(--highlight);
    text-decoration: none;
    border-bottom: 1px dashed var(--highlight);
}

.downloads a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Staking page gets the same top nav; container already handles layout. */
.container.staking-container {
    text-align: center;
}

@media (max-width: 720px) {
    .container.transparency-container {
        padding: 15px;
    }
    .sudo-frame iframe {
        height: 60vh;
    }
    .report iframe[src*="sudo/"] {
        min-height: 60vh;
    }
    .report table {
        font-size: 0.78rem;
    }
}
