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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    overflow: hidden;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #2d2d2d;
    padding: 15px 20px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

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

.controls {
    display: flex;
    gap: 10px;
}

.controls button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.controls button:hover {
    background: #0056b3;
}

.address-input-section {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    max-width: 500px;
}

#addressInput {
    flex: 1;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', monospace;
}

#addressInput:focus {
    outline: none;
    border-color: #007bff;
}

#addressInput::placeholder {
    color: #888;
}

#examineBtn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}

#examineBtn:hover {
    background: #218838;
}

#examineBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.main-content {
    flex: 1;
    display: flex;
    position: relative;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: #0a0a0a;
}

#graphCanvas {
    width: 100%;
    height: 100%;
    cursor: grab;
    display: block;
}

#graphCanvas:active {
    cursor: grabbing;
}

.context-menu {
    position: absolute;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    min-width: 180px;
}

.menu-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #444;
    transition: background 0.2s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: #3d3d3d;
}

.sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 350px;
    background: #2d2d2d;
    border-left: 1px solid #444;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 100;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

#closeSidebar {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

#closeSidebar:hover {
    background: #444;
    color: #fff;
}

.address-info {
    padding: 20px;
    flex: 1;
}

.address-hash {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    background: #1a1a1a;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    word-break: break-all;
    border: 1px solid #444;
}

.address-label {
    background: #007bff;
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
    margin-bottom: 20px;
}

.address-label:empty {
    display: none;
}

.address-details {
    margin-bottom: 25px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #333;
}

.detail-label {
    color: #888;
    font-size: 14px;
}

.detail-value {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.detail-value.balance {
    font-family: 'Monaco', 'Menlo', monospace;
    color: #4CAF50;
}

.summary-section {
    margin-top: 20px;
}

.summary-section h4 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #ccc;
}

.summary-text {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.4;
    color: #fff;
}

.risk-factors-section {
    margin-top: 20px;
}

.risk-factors-section h4 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #ccc;
}

.risk-factors-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.risk-factor-item {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 10px;
    font-size: 13px;
}

.risk-factor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.risk-factor-name {
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}

.risk-factor-score {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.risk-factor-score.high {
    background: #F44336;
    color: white;
}

.risk-factor-score.medium {
    background: #FFC107;
    color: black;
}

.risk-factor-score.low {
    background: #4CAF50;
    color: white;
}

.risk-factor-description {
    color: #ccc;
    line-height: 1.3;
}

.risk-section {
    margin-bottom: 30px;
}

.risk-section h4 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #ccc;
}

.risk-gauge {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.risk-value {
    font-size: 18px;
    font-weight: bold;
    fill: #fff;
}

.transactions-section h4 {
    margin-bottom: 15px;
    font-size: 16px;
    color: #ccc;
}

.transactions-list {
    max-height: 400px;
    overflow-y: auto;
}

.transaction-item {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 8px;
}

.transaction-hash {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    word-break: break-all;
}

.transaction-amount {
    font-size: 14px;
    font-weight: bold;
}

.transaction-amount.incoming {
    color: #4CAF50;
}

.transaction-amount.outgoing {
    color: #F44336;
}

.transaction-type {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.no-data {
    color: #888;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

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

.modal-content {
    background: #2d2d2d;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #444;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

#labelInput {
    width: 100%;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    margin-bottom: 20px;
}

#labelInput:focus {
    outline: none;
    border-color: #007bff;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

#saveLabelBtn {
    background: #007bff;
    color: white;
}

#saveLabelBtn:hover {
    background: #0056b3;
}

#cancelLabelBtn {
    background: #6c757d;
    color: white;
}

#cancelLabelBtn:hover {
    background: #545b62;
}

.address-node {
    cursor: pointer;
    transition: stroke-width 0.2s;
}

.address-node:hover {
    stroke-width: 3;
}

.transaction-edge {
    cursor: pointer;
}

.edge-label {
    font-size: 12px;
    fill: #ccc;
    text-anchor: middle;
    pointer-events: none;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner {
    border: 2px solid #444;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 10px;
}