/* ======== Stats Dashboard / Staking / Governance Styles ======== */

.header-nav {
    display: flex;
    gap: 4px;
    margin-left: 24px;
}

.nav-link {
    padding: 6px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-bg);
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

/* ======== Stats Layout ======== */

.stats-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ======== Metric Cards ======== */

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.metric-card {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.metric-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.metric-value {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.metric-change,
.metric-sub {
    font-size: 12px;
}

.metric-positive {
    color: var(--green);
}

.metric-negative {
    color: var(--red);
}

.metric-sub {
    color: var(--text-muted);
}

/* ======== Stats Table ======== */

.stats-table-header {
    display: grid;
    grid-template-columns: 40px 1fr 120px 80px 100px 80px;
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}

.fee-tier-header {
    grid-template-columns: 80px 1fr 100px 100px;
}

.stats-table {
    overflow-y: auto;
    max-height: 400px;
}

.stats-row {
    display: grid;
    grid-template-columns: 40px 1fr 120px 80px 100px 80px;
    padding: 10px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background 0.1s;
}

.stats-row:hover {
    background: var(--bg-hover);
}

.fee-tier-row {
    grid-template-columns: 80px 1fr 100px 100px;
    font-family: var(--font-mono);
    font-size: 13px;
}

.active-tier {
    background: var(--accent-bg);
    border-left: 3px solid var(--accent);
}

/* ======== Stats Chart ======== */

.stats-chart-panel {
    min-height: 300px;
}

.stats-chart {
    flex: 1;
    padding: 16px;
    min-height: 250px;
    position: relative;
}

.stats-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ======== Protocol Stats ======== */

.protocol-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border);
}

.proto-stat {
    background: var(--bg-panel);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.proto-label {
    font-size: 12px;
    color: var(--text-muted);
}

.proto-value {
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.proto-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* ======== Staking ======== */

.staking-panel {
    max-width: 480px;
}

.staking-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.staking-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.staking-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.staking-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-claim {
    padding: 10px;
    background: transparent;
    border: 2px solid var(--green);
    border-radius: var(--radius);
    color: var(--green);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-claim:hover {
    background: var(--green-bg);
}

/* ======== Referral ======== */

.referral-section {
    padding: 16px;
}

.referral-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
}

.btn-copy {
    cursor: pointer;
    border: none;
    background: var(--bg-secondary);
    color: var(--accent);
    font-weight: 600;
}

.btn-copy:hover {
    background: var(--accent-bg);
}

/* ======== Governance ======== */

.governance-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
}

.gov-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.gov-input:focus {
    border-color: var(--border-focus);
}

textarea.gov-input {
    resize: vertical;
    min-height: 80px;
}

select.gov-input {
    cursor: pointer;
}

/* ======== Proposal Cards ======== */

.proposals-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
}

.proposal-card {
    background: var(--bg-panel);
    padding: 20px;
}

.proposal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.proposal-id {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.proposal-type {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.type-fee {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
}

.type-treasury {
    background: rgba(234, 179, 8, 0.15);
    color: var(--yellow);
}

.type-general {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.proposal-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto;
}

.status-active {
    background: var(--green-bg);
    color: var(--green);
}

.status-passed {
    background: var(--accent-bg);
    color: var(--accent);
}

.status-failed {
    background: var(--red-bg);
    color: var(--red);
}

.proposal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.proposal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.proposal-votes {
    margin-bottom: 12px;
}

.vote-bar {
    height: 8px;
    background: var(--red);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.vote-for {
    height: 100%;
    background: var(--green);
    border-radius: 4px;
}

.vote-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.vote-for-label {
    color: var(--green);
}

.vote-against-label {
    color: var(--red);
}

.proposal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.proposal-actions {
    display: flex;
    gap: 8px;
}

.btn-vote {
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-vote-for {
    background: var(--green);
    color: #fff;
}

.btn-vote-for:hover {
    background: var(--green-hover);
}

.btn-vote-against {
    background: var(--red);
    color: #fff;
}

.btn-vote-against:hover {
    background: var(--red-hover);
}

/* ======== Utility Classes ======== */

.mono {
    font-family: var(--font-mono);
}

.bold {
    font-weight: 600;
}

.stats-row-pairs {
    grid-template-columns: 120px 1fr 100px 120px 120px;
}

/* ======== Responsive ======== */

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--accent);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-menu-btn:hover {
    background: var(--accent-bg);
    border-color: var(--accent);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

@keyframes menu-slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-panel);
        border-bottom: 2px solid var(--accent);
        flex-direction: column;
        padding: 8px;
        z-index: 100;
        gap: 2px;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(12px);
    }

    .header-nav.open {
        display: flex;
        animation: menu-slide-down 0.2s ease-out;
    }

    .header-nav .nav-link {
        padding: 12px 16px;
        font-size: 15px;
        font-weight: 600;
        border-radius: var(--radius);
        transition: all 0.15s;
    }

    .header-nav .nav-link:hover {
        background: var(--bg-hover);
    }

    .header-nav .nav-link.active {
        background: var(--accent-bg);
        color: var(--accent);
        border-left: 3px solid var(--accent);
    }

    .stats-overview {
        grid-template-columns: 1fr 1fr;
    }

    .stats-table-header,
    .stats-row {
        font-size: 11px;
    }
}
