/* Validator-specific tweaks layered on explorer.css theme */
body { font-family: 'Quicksand', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; margin:0; padding:0; }

h1 {
    margin: 0;
    padding-top: 3px;
    font-size: 16px;
    font-weight: normal;
}

h1.home {
    padding-top: 5px;
}

h2 {
    font-size: 16px;
}

a {
    color: #FFFFFF;
}

.top-menu-button {
    font-family: "Source Sans Pro", sans-serif;
    background-color: #555;
    border: none;
    color: #eee;
    padding: 5px 10px;
    cursor: pointer;
}

.top-menu-button:hover {
    background-color: #666;
}

.container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100vh !important;
}

.terminal {
    width: 100% !important;
    height: 100% !important;
    margin: 15px;
    background-color: #232323;
    border-radius: 5px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.terminal-header {
    background-color: #232323 !important;
    border-bottom: 1px solid #555;
    padding: 20px 15px 15px 20px !important;
    text-align: center !important;
    font-size: 16px !important;
    display: flex;
    justify-content: space-between;
}

.instructions { margin: 12px 16px; padding: 12px; border: 1px solid #555; border-radius: 8px; background: #2a2a2a; color: #eee; }
.instructions h3 { margin: 0 0 6px 0; }
.instructions p { margin: 6px 0; color: #ccc; }
.instructions ul { margin: 6px 0 0 18px; color: #ccc; }
.instructions img { display:block; max-width: 520px; width:100%; border-radius:8px; border:1px solid #444; margin: 8px auto; }
/* Light theme: instructions match monitor cards */
body.theme-light .instructions { background:#ffffff; color: var(--fg); border:1px solid var(--border); }
body.theme-light .instructions p,
body.theme-light .instructions ul { color: var(--mut); }
body.theme-light .instructions img { border-color: var(--border); }

.terminal-header a {
    color: #eee;
    text-decoration: none;
}

.terminal-body { font-family: "Source Sans Pro", sans-serif; flex:1; margin-bottom: 0; background: transparent; padding: 12px 0; border: none; border-radius: 0; overflow-y:auto; overflow-x:hidden; font-size:12px; word-wrap:break-word; box-sizing:border-box; max-height: 65vh; }
/* Add breathing space between Live Feed header and body */
.live-feed .panel-header { margin-bottom: 10px; }
body.theme-light .terminal-body { background: transparent; color: inherit; border: none; }
body.theme-light .terminal-body { background: transparent; color: inherit; border: none; }

.command-message {
    font-style: italic;
}

.command-link {
    color: yellow;
    text-decoration: none;
}

.terminal-message {
    margin-bottom: 10px !important;
}

/* Compact pills/tags for short status notices */
.pill-wrap { margin: 6px 0; }
.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 16px;
    border: 1px solid #444;
    background: #2f2f2f;
    color: #ddd;
    box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.pill--ok { border-color:#3aa15f; background:#2b3d2f; color:#bfe9cd; }
.pill--warn { border-color:#eab308; background:#3c3213; color:#f9e8a6; }
.pill--err { border-color:#ef4444; background:#3a1717; color:#fecaca; }
.pill--info { border-color:#60a5fa; background:#1f2f40; color:#cfe8ff; }
/* Light theme pill variants to keep color-coding */
body.theme-light .pill { background:#f1f5f9; color:#0f172a; border-color: var(--border); }
body.theme-light .pill--ok { background:#dcfce7; border-color:#86efac; color:#065f46; }
body.theme-light .pill--warn { background:#fef3c7; border-color:#fde68a; color:#92400e; }
body.theme-light .pill--err { background:#fee2e2; border-color:#fecaca; color:#7f1d1d; }
body.theme-light .pill--info { background:#dbeafe; border-color:#bfdbfe; color:#1e3a8a; }
/* Header placement: no extra margins */
.panel-header .pill-wrap { margin: 0; }

/* Friendly message cards */
.msg { position: relative; padding: 10px 12px; background:#0a0f1c; border:1px solid rgba(45, 68, 116, .75); border-left-width:4px; border-radius:8px; box-shadow: 0 2px 6px rgba(0,0,0,.25); animation: popIn .25s ease-out; }
.msg + .msg { margin-top:8px; }
.msg h5 { margin:0 0 6px 0; font-size:12px; letter-spacing:.2px; }
.msg small { color:#bbb; }
.msg code { color:#e8e8e8; }
.msg--tx { border-left-color:#3aa15f; }
.msg--tx h5 { color:#bfe9cd; }
.msg--block { border-left-color:#60a5fa; }
.msg--block h5 { color:#b8ddff; }
.msg--info { border-left-color:#eab308; }
.msg--info h5 { color:#f9e8a6; }
.msg--success { border-left-color:#3aa15f; }
.msg--success h5 { color:#bfe9cd; }
.msg--ok { border-left-color:#3aa15f; }
.msg--warn { border-left-color:#eab308; }
.msg--err { border-left-color:#ef4444; }
.msg .icon { margin-right:6px; }

/* Compact, one-line cards for lightweight notices (intent/req/prune) */
.msg--mini { padding: 6px 8px; border-left-width:3px; display:flex; align-items:center; gap:6px; width: 200px; }
.msg--mini .txt { color:#ddd; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* Light theme: message cards */
body.theme-light .msg { background:#ffffff; border-color: var(--border); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
body.theme-light .msg h5 { color:#0f172a; }
body.theme-light .msg small { color:#64748b; }
body.theme-light .msg code { color:#0f172a; }
body.theme-light .msg--mini .txt { color:#334155; }

@keyframes popIn { from { transform: translateY(4px); opacity: 0; } to { transform:none; opacity:1; } }

.input-hint {
    font-family: "Source Sans Pro", sans-serif;
    position: absolute;
    left: 140px;
    color: yellow;
}

.terminal-input {
    background-color: #232323 !important;
    border: 1px solid #555;
    width: 260px;
    padding: 5px !important;
    color: #FFF;
}
body.theme-light .terminal-input { background: var(--bg-soft) !important; border:1px solid var(--border); color: var(--fg); }

.terminal-button {
    font-family: "Source Sans Pro", sans-serif;
    padding: 5px;
    margin-left: 10px;
    background-color: #10223f;
    border: 1px solid var(--border);
    color: var(--fg);
    cursor: pointer !important;
}
body.theme-light .terminal-button { border-color:#c7d2fe; background:linear-gradient(180deg, #2563eb, #1d4ed8); color:#fff; }

/* Center diagnostics row inside card */
.diag-row { display:flex; align-items:center; justify-content:center; gap:8px; }

.autocomplete-list {
    display: inline-block;
    position: absolute;
    background-color: #333;
    left: 50;
    bottom: 50px;
    z-index: 1000;
}

.autocomplete-list-item {
    display: inline-block;
    margin-right: 10px;
    cursor: pointer;
    padding: 3px;
    background-color: #333;
    color: #eee;
}
body.theme-light .autocomplete-list { background:#ffffff; border:1px solid var(--border); box-shadow: 0 8px 24px rgba(15,23,42,.08); }
body.theme-light .autocomplete-list-item { background:transparent; color:#0f172a; }

.autocomplete-list-item:hover {
    text-decoration: underline;
}


::placeholder {
    color: #ccc; /* Specify the color you want */
}

.table-wrapper {
    overflow-x: auto !important; /* Add horizontal scroll for overflow */
}

.table {
    width: 100% !important;
    border-collapse: collapse !important;
}

.table th,
.table td {
    padding: 8px !important;
}

.table th {
    background-color: #232323 !important;
    text-align: left !important;
}

.table tbody tr:nth-child(even) {
    background-color: #555 !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #232323;
    color: #FFFFFF;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    max-height: 80%;
    overflow-y: auto;
}
body.theme-light .modal-content { background:#ffffff; color:#0f172a; box-shadow: 0 10px 24px rgba(15,23,42,.08); border:1px solid var(--border); }

.terminal-header div {
    margin-top: -10px;
}

.green { color: #22c55e; }

.red {
    color: red;
}

.terminal-header .green,
.terminal-header .red {
    font-size: 40px;
    line-height: 1;
    vertical-align: middle;
    margin-right: 5px;
}

/* Capability badges */
.cap-badges { text-align: right; margin-bottom: 4px; }
.badge {
    display: inline-block;
    padding: 2px 6px;
    margin-left: 4px;
    font-size: 10px;
    border-radius: 10px;
    border: 1px solid #666;
    color: #ddd;
    background: #444;
}
.badge.on { border-color: #3aa15f; background: #2b3d2f; color: #bfe9cd; }
.badge.off { border-color: #777; background: #3a3a3a; color: #888; }
.cap-lock { margin-left: 6px; font-size: 12px; vertical-align: middle; }
.cap-check { margin-left: 6px; font-size: 12px; vertical-align: middle; color: #3aa15f; }

.stats-cards {
    display: flex;
    background-color: #232323;
    justify-content: space-between;
    gap: 10px;
}

.stats-card {
    flex: 1;
    background-color: #333333;
    font-size: 12px;
    margin: 15px 0 15px 0;
    padding: 15px;
    border: 1px solid #555;
    border-radius: 5px;
    min-height: 200px; /* Ensures same height; adjust if needed */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stats-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #ccc;
}
/* Light theme: stats containers */
body.theme-light .stats-cards { background: transparent; }
body.theme-light .stats-card { background:#ffffff; border:1px solid var(--border); }
body.theme-light .stats-card h4 { color:#334155; }

.stats-card div {
    margin-bottom: 5px;
}

.card-footer {
    margin-top: auto;
    text-align: right;
}

#download-stats {
    display: block;
    margin: 10px auto 0;
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#stat-uptime { transition: opacity .18s ease; }
#stat-uptime.fade-out { opacity: .15; }
#stat-uptime.fade-in { animation: uptFade .18s ease forwards; }
@keyframes uptFade { from { opacity:.15 } to { opacity:1 } }

/* Mobile: stack the stats cards */
@media (max-width: 768px) {
  .stats-cards {
    flex-direction: column;   /* from row -> column on mobile */
    gap: 12px;                /* a bit more breathing room */
  }
  .stats-card {
    min-height: unset;        /* allow natural height when stacked */
    margin: 8px 0;            /* vertical rhythm */
  }
  .card-footer {
    text-align: left;         /* easier tapping on mobile */
  }
}
/* Make main content fill viewport height and Live Feed take remaining space */
html, body { height: 100%; overflow: hidden; }
#view { display:flex; flex-direction: column; height: calc(100vh - 60px); overflow: hidden; }
.live-feed { display:flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.live-feed .terminal-body { flex:1 1 auto; min-height: 0; height: 100%; overflow-y: auto; }
.topbar .right { position:relative; display:flex; gap:8px; align-items:center; }

/* Tabs */
.tabs-header { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.tabs { display:flex; gap:8px; flex-wrap:wrap; }
.tab { background: transparent; border:1px solid rgba(255,255,255,0.1); color:#e5e7eb; padding:6px 12px; border-radius:999px; cursor:pointer; font-size:0.9rem; transition:background .2s ease, color .2s ease, border .2s ease; }
.tab:hover { background:rgba(96,165,250,0.15); border-color:rgba(96,165,250,0.4); }
.tab.active { background:#2563eb; color:#fff; border-color:#2563eb; }
.tab-actions { display:flex; gap:8px; align-items:center; }
.tab-panel { display:none; margin-top:12px; }
.tab-panel.active { display:block; animation: popIn .18s ease-out; }
.diag-tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:12px; }

/* Governance */
.governance-panel { display:flex; flex-direction:column; gap:14px; }
.gov-summary { font-size:0.9rem; color:#cbd5f5; }
.gov-section h4 { margin:0 0 6px 0; font-size:1rem; font-weight:600; }
.gov-section details { background:rgba(13,23,42,0.5); border:1px solid rgba(148,163,209,0.15); border-radius:10px; padding:8px 12px; }
.gov-section details summary { cursor:pointer; font-weight:600; color:#e5e7eb; }
.gov-list { display:flex; flex-direction:column; gap:10px; }
.gov-list.empty { color:#94a3b8; font-size:0.9rem; }
.gov-controls { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-bottom:10px; }
.gov-controls .gov-pagination { margin-left:auto; }
.gov-filter-label { font-size:0.85rem; color:#94a3b8; }
.gov-filter-select { appearance:none; background:rgba(15,23,42,0.6); color:#e5e7eb; border:1px solid rgba(148,163,209,0.2); border-radius:8px; padding:6px 10px; min-width:150px; }
.gov-filter-select:focus { outline:none; border-color:#4f46e5; }
.gov-pagination { display:flex; align-items:center; gap:8px; }
.gov-pagination.hidden { display:none; }
.gov-page-info { font-size:0.85rem; color:#94a3b8; }
.gov-card { border:1px solid rgba(148,163,209,0.18); background:rgba(10,15,28,0.75); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:10px; transition:border-color 0.2s ease, box-shadow 0.2s ease; }
.gov-card--highlight { border-color:#4f46e5; box-shadow:0 0 0 3px rgba(79,70,229,0.35); }
.gov-card-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.gov-card-header h5 { margin:0; font-size:1.05rem; color:#e0e7ff; }
.gov-status { font-size:0.75rem; text-transform:uppercase; padding:2px 8px; border-radius:999px; border:1px solid; display:inline-flex; align-items:center; gap:4px; }
.status-active { background:rgba(34,197,94,0.14); border-color:rgba(34,197,94,0.35); color:#4ade80; }
.status-passed { background:rgba(59,130,246,0.18); border-color:rgba(59,130,246,0.35); color:#bfdbfe; }
.status-executed { background:#0f172a; border-color:#1e293b; color:#bae6fd; }
.status-failed { background:#7f1d1d; border-color:#991b1b; color:#fee2e2; }
.status-expired { background:#334155; border-color:#475569; color:#e2e8f0; }
.gov-meta { display:flex; flex-wrap:wrap; gap:10px; font-size:0.85rem; color:#94a3b8; }
.gov-meta strong { color:#cbd5f5; }
.gov-tally { display:flex; flex-direction:column; gap:6px; }
.gov-tally-bar { display:flex; height:10px; background:#1e293b; border-radius:999px; overflow:hidden; }
.gov-tally-bar span { display:block; height:100%; }
.gov-tally-bar .yes { background:#22c55e; }
.gov-tally-bar .no { background:#ef4444; }
.gov-tally-bar .abstain { background:#f97316; }
.gov-tally-values { display:flex; gap:12px; font-size:0.85rem; color:#94a3b8; }
.gov-actions { display:flex; flex-wrap:wrap; gap:8px; }
.gov-actions .btn { min-width:90px; }
.gov-note { font-size:0.8rem; color:#94a3b8; }

.btn.xs { padding:4px 10px; font-size:0.75rem; line-height:1.2; border-radius:999px; }
.btn.xs:disabled { opacity:0.4; cursor:default; }

/* Notifications */
.badge { display:inline-flex; align-items:center; justify-content:center; min-width:16px; height:16px; border-radius:999px; background:#ef4444; color:#fff; font-size:0.65rem; padding:0 4px; margin-left:4px; }
.badge.hidden { display:none; }
.gov-dropdown { position:absolute; top:48px; right:10px; width:260px; max-height:260px; overflow-y:auto; background:#0f172a; border:1px solid rgba(148,163,209,0.25); border-radius:12px; box-shadow:0 12px 30px rgba(15,23,42,0.35); padding:10px; z-index:2000; }
.gov-dropdown.hidden { display:none; }
.gov-dropdown ul { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.gov-dropdown li { display:flex; flex-direction:column; gap:4px; font-size:0.85rem; border:1px solid rgba(148,163,209,0.15); border-radius:8px; padding:8px; background:rgba(17,24,39,0.8); cursor:pointer; }
.gov-dropdown li.unread { border-color:#2563eb; }
.gov-dropdown li span { color:#cbd5f5; }
.gov-dropdown li small { color:#94a3b8; }

/* Utility */
.hidden { display:none !important; }
.muted { color:#94a3b8; font-size:0.85rem; }

/* Light theme adjustments */
body.theme-light .tab { border-color: rgba(148,163,209,0.4); color: var(--fg); }
body.theme-light .tab:hover { background: rgba(148,163,209,0.2); }
body.theme-light .tab.active { background:#2563eb; color:#fff; border-color:#2563eb; }
body.theme-light .governance-panel { color: var(--fg); }
body.theme-light .gov-summary { color: var(--mut); }
body.theme-light .gov-section details { background:#f1f5f9; border-color:var(--border); color: var(--fg); }
body.theme-light .gov-section details summary { color: var(--fg); }
body.theme-light .gov-list.empty { color: var(--mut); }
body.theme-light .gov-card { background:#ffffff; border-color: var(--border); }
body.theme-light .gov-card--highlight { border-color:#4f46e5; box-shadow:0 0 0 3px rgba(79,70,229,0.25); }
body.theme-light .gov-card-header h5 { color: var(--fg); }
body.theme-light .gov-meta { color: var(--mut); }
body.theme-light .gov-meta strong { color: var(--fg); }
body.theme-light .gov-filter-select { background:#ffffff; color: var(--fg); border-color: var(--border); }
body.theme-light .gov-dropdown { background:#ffffff; border-color: var(--border); box-shadow:0 12px 30px rgba(15,23,42,0.12); }
body.theme-light .gov-dropdown li { background:#f8fafc; border-color: var(--border); }
body.theme-light .gov-dropdown li span { color: var(--fg); }
body.theme-light .gov-dropdown li small { color: var(--mut); }
body.theme-light .muted { color:#64748b; }
