* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    margin-bottom: 30px;
    border-bottom: 2px solid #30363d;
    padding-bottom: 20px;
}

h1 {
    color: #58a6ff;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

h2 {
    color: #58a6ff;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.header-info {
    display: flex;
    gap: 30px;
    color: #8b949e;
    font-size: 0.9rem;
}

.header-info a {
    color: #58a6ff;
    text-decoration: none;
}

.header-info a:hover {
    text-decoration: underline;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-label {
    color: #8b949e;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stat-value {
    color: #58a6ff;
    font-size: 2rem;
    font-weight: bold;
}

.directory-stats {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

#directory-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.directory-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #0d1117;
    border-radius: 6px;
}

.directory-name-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.directory-name {
    font-family: monospace;
    color: #c9d1d9;
}

.directory-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.directory-count {
    color: #58a6ff;
    font-weight: bold;
}

.directory-bond-count {
    color: #f0883e;
    font-size: 0.85rem;
}

.directory-uptime {
    color: #8b949e;
    font-size: 0.85rem;
}

.status-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.status-connected {
    color: #3fb950;
}

.status-disconnected {
    color: #f85149;
}

.status-not-attempted {
    color: #6e7681;
}

.controls {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-group label {
    color: #c9d1d9;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.filter-group input[type="checkbox"] {
    cursor: pointer;
}

.filter-group input[type="text"],
.filter-group select {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #c9d1d9;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
    outline: none;
    border-color: #58a6ff;
}

.table-container {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #0d1117;
    position: sticky;
    top: 0;
}

th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    color: #58a6ff;
    border-bottom: 2px solid #30363d;
    white-space: nowrap;
}

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

th.sortable:hover {
    background: #161b22;
}

th.sortable::after {
    content: ' ⇅';
    opacity: 0.3;
}

th.sortable.asc::after {
    content: ' ↑';
    opacity: 1;
}

th.sortable.desc::after {
    content: ' ↓';
    opacity: 1;
}

td {
    padding: 12px 10px;
    border-bottom: 1px solid #21262d;
}

tbody tr:hover {
    background: #0d1117;
}

.type-sw0 {
    color: #3fb950;
}

.type-swa {
    color: #58a6ff;
}

.fee-absolute {
    color: #f85149;
}

.fee-relative {
    color: #d29922;
}

.counterparty {
    font-family: monospace;
    font-size: 0.9rem;
}

.directory-node {
    font-family: monospace;
    font-size: 0.8rem;
    color: #8b949e;
}

.directory-badges {
    gap: 4px;
}

.dir-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    cursor: help;
}

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

    .controls {
        flex-direction: column;
    }

    table {
        font-size: 0.8rem;
    }

    th, td {
        padding: 8px 6px;
    }
}

.bond-verification {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.bond-verification h3 {
    color: #58a6ff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.bond-verification p {
    color: #8b949e;
    margin: 10px 0;
}

.code-block {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
}

.code-block code {
    color: #79c0ff;
    font-size: 14px;
}

.code-block p {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #8b949e;
}

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

.bond-modal-content {
    background-color: #0d1117;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #30363d;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    color: #c9d1d9;
}

.bond-modal-content h2 {
    color: #58a6ff;
    margin-top: 0;
}

.bond-detail {
    margin: 15px 0;
    padding: 10px;
    background: #161b22;
    border-radius: 6px;
}

.bond-detail label {
    color: #8b949e;
    font-size: 12px;
    display: block;
    margin-bottom: 5px;
}

.bond-detail code {
    color: #79c0ff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
}

.bond-detail code a {
    color: #58a6ff;
    text-decoration: underline;
}

.bond-detail code a:hover {
    color: #79c0ff;
}

.close-modal {
    color: #8b949e;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #c9d1d9;
}

.bond-value-clickable {
    cursor: pointer;
    color: #58a6ff;
    text-decoration: underline;
}

.bond-value-clickable:hover {
    color: #79c0ff;
}

/* Feature Stats Section */
.feature-stats {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.feature-stats-description {
    color: #8b949e;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.feature-stats-description a {
    color: #58a6ff;
    text-decoration: none;
}

.feature-stats-description a:hover {
    text-decoration: underline;
}

#feature-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: #0d1117;
    border-radius: 6px;
    min-width: 120px;
}

.feature-name-container {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.feature-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.feature-count {
    color: #c9d1d9;
    font-weight: 600;
    font-size: 0.9rem;
}

.feature-percentage {
    color: #8b949e;
    font-size: 0.8rem;
}

.feature-no-data {
    color: #8b949e;
    font-style: italic;
}

/* Feature badges in table and stats */
.feature-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    cursor: help;
}

.feature-badges {
    gap: 4px;
}

.feature-legacy {
    background-color: #6e7681;
}
