/* Base Styles */
:root {
    --primary-color: #000;
    --secondary-color: #333;
    --accent-color: #666;
    --highlight-color: #0070f3;
    --text-color: #000;
    --bg-color: #fff;
    --sidebar-bg: #000;
    --sidebar-text: #fff;
    --card-bg: #fff;
    --border-color: #eaeaea;
}

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

body {
    font-family: 'IBM Plex Mono', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    letter-spacing: -0.02em;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-menu {
    list-style: none;
    margin-top: 20px;
}

.nav-menu li {
    margin-bottom: 5px;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Submenu Styles */
.nav-menu .has-submenu {
    position: relative;
}

.nav-menu .has-submenu .submenu {
    display: none;
    background-color: var(--sidebar-bg);
    border-radius: 4px;
    padding: 5px 0;
    list-style: none;
}

.nav-menu .has-submenu.expanded .submenu {
    display: block;
}

.nav-menu .submenu li {
    margin-left: 20px;
}

.nav-menu .submenu li a {
    padding: 12px 20px;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s;
}

.nav-menu .submenu .submenu-empty {
    padding: 12px 20px;
    color: #94a3b8;
    font-style: italic;
}

.nav-menu .submenu li a:hover {
    background-color: #3e3e3e;
    color: #ffffff;
}

.nav-menu .submenu .tool-icon {
    margin-right: 12px;
    font-size: 16px;
}

.nav-menu li a:hover, .nav-menu li.active a {
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--highlight-color);
}

.nav-menu li.logout {
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

.icon {
    margin-right: 10px;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
}

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

header h1 {
    font-size: 28px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-name {
    margin-right: 10px;
    font-weight: 500;
}

.user-avatar {
    font-size: 20px;
}

/* System Info Styles */
.system-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
}

.service-status {
    display: flex;
    gap: 15px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.service-icon {
    font-size: 14px;
    margin-right: 2px;
}

.status-light {
    font-size: 12px;
    margin-left: 4px;
}

.status-green {
    color: #2ecc71;
}

.status-yellow {
    color: #f39c12;
}

.status-red {
    color: #e74c3c;
}

.git-info {
    font-size: 11px;
    color: var(--accent-color);
}

.git-hash {
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Network Map Styles */
.network-map-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 30px;
}

.network-map-container h2 {
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.network-map {
    height: 600px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    background-color: #fafafa;
    margin-bottom: 15px;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
}

/* Map Legend Styles */
.map-legend {
    padding: 10px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

.map-legend h3 {
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.legend-label {
    font-family: 'Space Mono', monospace;
}

/* Networks Table Styles */
.networks-table-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
}

.networks-table-container h2 {
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

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

.networks-table th, .networks-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.networks-table th {
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.02);
}

.networks-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background-color: #000;
    color: #fff;
}

.status-inactive {
    background-color: #ccc;
    color: #000;
}

.status-warning {
    background-color: #666;
    color: #fff;
}

.action-btn {
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-color);
    margin-right: 5px;
    padding: 2px 8px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
}

.action-btn:hover {
    background-color: #000;
    color: #fff;
}

/* Drawer and Chain Styles */
.drawer-cell {
    padding: 0 !important;
}

.network-drawer {
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.02);
}

.drawer-section {
    margin-bottom: 20px;
}

.drawer-section h4 {
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Horizontal Chain Styles */
.chains-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chain-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border: 1px solid var(--border-color);
    background-color: #fff;
}

/* Chain boxes with links */
.chain-boxes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 0;
    margin-bottom: 10px;
    gap: 10px;
}

.chain-box {
    min-width: 120px;
    height: 60px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    font-weight: 500;
    position: relative;
    background-color: #fff;
}

.chain-link {
    width: 30px;
    height: 2px;
    background-color: var(--border-color);
    margin: 0 -1px;
}

/* Colored Status Icons */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge::before {
    content: '●';
    margin-right: 5px;
    font-size: 14px;
}

.status-active {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

.status-active::before {
    color: #2ecc71;
}

.status-inactive {
    background-color: rgba(189, 195, 199, 0.1);
    color: #7f8c8d;
}

.status-inactive::before {
    color: #7f8c8d;
}

.status-warning {
    background-color: rgba(241, 196, 15, 0.1);
    color: #f39c12;
}

.status-warning::before {
    color: #f39c12;
}

/* Styles from node-sim, now global */
.container-fluid {
    padding: 20px;
}
.tab-content {
    padding-top: 20px;
}
.card {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
}
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}
.drop-area {
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    cursor: pointer;
}
.drop-area.highlight {
    border-color: #007bff;
    background-color: #e8f4ff;
}
.stats-table {
    font-family: 'Space Mono', monospace;
    width: 100%;
}
.stats-table td {
    padding: 5px;
}
.stats-table td:first-child {
    font-weight: bold;
    width: 40%;
}
.control-label {
    font-weight: bold;
    margin-bottom: 5px;
}
.control-group {
    margin-bottom: 15px;
}
