/* Common Herb Politics - Governance Panel Styles */

* {
    box-sizing: border-box;
}

html {
    scrollbar-width: none; /* Firefox */
}

html::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

body {
    font-family: 'Courier New', Courier, monospace;
    background: #0a0f0a;
    color: #33ff33;
    margin: 0;
    padding: 33px 10px 20px 0;
    min-height: 100vh;
    scrollbar-width: none; /* Firefox */
}

body::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

h1, h2, h3 {
    font-weight: normal;
    margin: 0 0 15px 0;
}

h1 {
    font-size: 2em;
    text-shadow: 0 0 10px #33ff33;
    text-align: left;
    margin-top: -28px;
    margin-bottom: 0;
}

h2 {
    font-size: 1.3em;
    color: #66ff66;
}

h3 {
    font-size: 1.1em;
    color: #99ff99;
}

/* Layout */
.container {
    max-width: none;
    margin: 0;
}

.gov-layout {
    display: flex;
    gap: 0;
}

.gov-main {
    flex: 1;
    min-width: 0;
    margin-right: 200px;
}

/* Feed resize handle */
.feed-resize-handle {
    position: fixed;
    top: 33px;
    right: 200px;
    width: 5px;
    height: calc(100vh - 33px);
    cursor: col-resize;
    z-index: 10;
    background: transparent;
    transition: background 0.15s;
}

.feed-resize-handle:hover,
.feed-resize-handle.dragging {
    background: #4a9f4a;
}

.gov-feed {
    position: fixed;
    right: 0;
    top: 33px;
    width: 200px;
    height: calc(100vh - 33px);
    overflow-y: auto;
    scrollbar-width: none;
    border-left: 1px solid #1a331a;
}

.gov-feed::-webkit-scrollbar {
    display: none;
}

.gov-feed .feed {
    max-height: none;
}

.gov-feed .feed-entry {
    white-space: normal;
    padding: 10px 4px 10px 8px;
    text-align: justify;
}

.gov-feed .feed-entry:first-child {
    padding-top: 2px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Panels (legacy, retained for modal internals) */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* Gov Status Line */
.gov-status {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1a8c1a;
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 1.1em;
    margin-bottom: 8px;
    margin-right: 200px;
}

.gov-status-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: auto;
    margin-top: -40px;
    margin-right: -15px;
}

.gov-status-action {
    white-space: nowrap;
}

.gov-auth-btn {
    white-space: nowrap;
}

.gov-player-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1a8c1a;
    white-space: nowrap;
}

.pi-name {
    color: #33ff33;
}

.pi-gold {
    color: #DAA520;
}

.pi-detail {
    color: #669966;
}

.pi-sep {
    color: #1a3a1a;
}

.gov-status-sep {
    color: #1a3a1a;
}

.status-indicator {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid;
    font-size: 0.9em;
}

.status-indicator.paused {
    border-color: #ff9933;
    color: #ff9933;
}

.status-indicator.running {
    border-color: #33ff33;
    color: #33ff33;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
button {
    font-family: inherit;
    font-size: 0.9em;
    background: #0a0f0a;
    color: #33ff33;
    border: 1px solid #33ff33;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: #33ff33;
    color: #0a0f0a;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button.primary {
    background: #1a331a;
}

button.danger {
    border-color: #ff3333;
    color: #ff3333;
}

button.danger:hover {
    background: #ff3333;
    color: #0a0f0a;
}

/* Inputs */
input, select {
    font-family: inherit;
    font-size: 0.9em;
    background: #0a0f0a;
    color: #33ff33;
    border: 1px solid #33ff33;
    padding: 8px 12px;
}

input:focus, select:focus {
    outline: none;
    box-shadow: 0 0 5px #33ff33;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #99ff99;
}

.form-group {
    margin-bottom: 15px;
}

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

th, td {
    text-align: left;
    padding: 8px;
    border-bottom: none;
}

th {
    color: #99ff99;
    font-weight: normal;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable:hover {
    color: #33ff33;
}

th.sortable.active {
    color: #2aee2a;
}

tr:hover {
    background: #0f1a0f;
}

/* Feed / Log */
.feed {
    max-height: 500px;
    overflow-y: auto;
    font-size: 0.9em;
}

.feed-entry {
    padding: 15px;
    border-bottom: none;
    white-space: pre-wrap;
    line-height: 1.5;
}

.feed-entry:last-child {
    border-bottom: none;
}

.feed-entry .date {
    color: #66ff66;
    font-weight: bold;
}

/* Modal */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

.modal-backdrop.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal {
    background: #0d120d;
    border: 1px solid #33ff33;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: #33ff33;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Dashboard Grid */
.gov-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.gov-module {
    padding: 0;
}

.gov-module-wide {
    grid-column: 1 / -1;
}

.gov-right-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gov-module-content {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: none;
}

.gov-module-content::-webkit-scrollbar {
    display: none;
}

@media (max-width: 900px) {
    .gov-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility */
.text-muted {
    color: #669966;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0f0a;
}

::-webkit-scrollbar-thumb {
    background: #33ff33;
}


/* Feed filters */
.feed-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 6px 4px;
    border-bottom: 1px solid #1a331a;
}

.feed-filter {
    font-size: 0.7em;
    padding: 2px 6px;
    cursor: pointer;
    color: #669966;
    border: 1px solid transparent;
    user-select: none;
}

.feed-filter:hover {
    color: #33ff33;
}

.feed-filter.active {
    color: #33ff33;
    border-color: #33ff33;
}

/* Feed events (new format) */
.feed-event {
    padding: 2px 0;
    line-height: 1.4;
}

.feed-tag {
    font-weight: bold;
    font-size: 0.85em;
}

.feed-upcoming {
    padding: 2px 0;
    color: #669966;
    font-size: 0.9em;
}

/* Feed loading / end indicators */
.feed-loading {
    text-align: center;
    padding: 12px;
    color: #2a662a;
    font-size: 0.85em;
}

.feed-end {
    text-align: center;
    padding: 12px;
    color: #1a3a1a;
    font-size: 0.85em;
}

/* Ledger */
.ledger-positive { color: #4a9f4a; }
.ledger-negative { color: #cc4444; }

/* Voting Records */
.vote-yea { color: #4a9f4a; }
.vote-nay { color: #cc4444; }
.vote-abstain { color: #888888; }

#ledger-votes-section {
    margin-top: 12px;
}

#ledger-body {
    margin-bottom: 6px;
    font-size: 0.85em;
    padding: 4px 8px;
}

#ledger-jurisdiction {
    margin-bottom: 6px;
    font-size: 0.85em;
    padding: 4px 8px;
}

#ledger-pagination {
    padding: 8px;
}

/* Responsive — medium screens (MacBook ~1440px and below) */
@media (max-width: 1440px) {
    h1 {
        font-size: 1.6em;
    }
    .gov-feed {
        width: 315px;
    }
    .gov-main {
        margin-right: 315px;
    }
    .gov-status {
        margin-right: 315px;
    }
    .feed-resize-handle {
        right: 315px;
    }
}

/* Responsive — smaller screens (1280px and below) */
@media (max-width: 1280px) {
    h1 {
        font-size: 1.3em;
    }
    .gov-feed {
        width: 260px;
    }
    .gov-main {
        margin-right: 260px;
    }
    .gov-status {
        margin-right: 260px;
    }
    .feed-resize-handle {
        right: 260px;
    }
}

/* Responsive — very small screens (1100px and below) */
@media (max-width: 1100px) {
    h1 {
        font-size: 1.1em;
    }
    .gov-feed {
        width: 200px;
    }
    .gov-main {
        margin-right: 200px;
    }
    .gov-status {
        margin-right: 200px;
    }
    .feed-resize-handle {
        right: 200px;
    }
}
