/* Ratibot Console - Retro Terminal Styles */

@import url('https://fonts.googleapis.com/css2?family=VT323&family=IBM+Plex+Mono:wght@400;700&display=swap');

:root {
    --bg-color: #0a0a0a;
    --terminal-bg: #0d1117;
    --text-color: #33ff66;
    --text-dim: #22cc44;
    --text-bright: #66ff99;
    --accent-color: #00ffff;
    --error-color: #ff5555;
    --warning-color: #ffcc00;
    --success-color: #33ff66;
    --border-color: #2a4a2a;
    --scanline-color: rgba(0, 255, 65, 0.02);
}

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

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* CRT Effect */
.crt {
    position: relative;
    min-height: 100vh;
}

.crt::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 1000;
    pointer-events: none;
}

.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(0, 255, 65, 0.02);
    z-index: 1000;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.27861; }
    5% { opacity: 0.34769; }
    10% { opacity: 0.23604; }
    15% { opacity: 0.90626; }
    20% { opacity: 0.18128; }
    25% { opacity: 0.83891; }
    30% { opacity: 0.65583; }
    35% { opacity: 0.67807; }
    40% { opacity: 0.26559; }
    45% { opacity: 0.84693; }
    50% { opacity: 0.96019; }
    55% { opacity: 0.08594; }
    60% { opacity: 0.20313; }
    65% { opacity: 0.71988; }
    70% { opacity: 0.53455; }
    75% { opacity: 0.37288; }
    80% { opacity: 0.71428; }
    85% { opacity: 0.70419; }
    90% { opacity: 0.7003; }
    95% { opacity: 0.36108; }
    100% { opacity: 0.24387; }
}

.scanline {
    position: fixed;
    width: 100%;
    height: 4px;
    background: var(--scanline-color);
    z-index: 1001;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Terminal Container */
.terminal {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.ascii-art {
    color: var(--text-bright);
    font-family: 'VT323', monospace;
    font-size: 12px;
    line-height: 1.1;
    text-shadow: 0 0 10px var(--text-color);
    margin-bottom: 10px;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.status {
    font-weight: bold;
    font-size: 16px;
    animation: blink 1s infinite;
}

.status.online {
    color: var(--success-color);
    animation: none;
    text-shadow: 0 0 8px var(--success-color);
}

.status.error {
    color: var(--error-color);
}

@keyframes blink {
    50% { opacity: 0.5; }
}

.timestamp {
    color: var(--text-bright);
    font-size: 14px;
}

/* Info Panel */
.info-panel {
    background: rgba(0, 255, 65, 0.06);
    border: 1px solid var(--border-color);
    padding: 18px;
    margin-bottom: 20px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px;
}

.info-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.label {
    color: var(--text-bright);
    width: 130px;
    flex-shrink: 0;
    font-weight: 500;
}

.value {
    color: var(--accent-color);
    word-break: break-all;
    font-weight: 500;
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: 10px;
    font-size: 14px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 1;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.tab {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-dim);
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    transition: all 0.2s;
    letter-spacing: 0.5px;
}

.tab:hover {
    border-color: var(--text-bright);
    color: var(--text-bright);
    background: rgba(0, 255, 65, 0.05);
}

.tab.active {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
    font-weight: 600;
}

/* Console Output */
.console-output {
    flex: 1;
    background: var(--terminal-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    max-height: 55vh;
    font-size: 14px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Log Entries */
.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 255, 65, 0.15);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
}

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

.log-entry.system {
    color: var(--accent-color);
}

.log-entry.trade {
    color: var(--success-color);
}

.log-entry.error {
    color: var(--error-color);
    font-weight: 500;
}

.log-entry.warning {
    color: var(--warning-color);
}

.log-entry .time {
    color: var(--text-bright);
    margin-right: 12px;
    font-weight: 500;
}

/* Activity Feed */
.activity-item {
    margin-bottom: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 255, 65, 0.1);
}

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

.activity-item .activity-icon {
    margin-right: 8px;
}

.activity-item.post-entry {
    padding: 12px;
    border: 1px solid var(--border-color);
    background: rgba(0, 255, 65, 0.02);
    border-radius: 4px;
}

.activity-item.post-entry:hover {
    background: rgba(0, 255, 65, 0.05);
}

.log-entry .jupiter-link {
    text-decoration: none;
    margin-left: 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.log-entry .jupiter-link:hover {
    opacity: 1;
}

.log-entry .token-link {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-color);
    transition: all 0.2s;
}

.log-entry .token-link:hover {
    color: #fff;
    border-bottom-color: #fff;
    text-shadow: 0 0 8px var(--accent-color);
}

/* Post Entries */
.post-entry {
    padding: 16px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    background: rgba(0, 255, 65, 0.03);
    border-radius: 4px;
}

.post-entry:hover {
    background: rgba(0, 255, 65, 0.06);
    border-color: var(--text-dim);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.post-time {
    color: var(--text-bright);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
}

.post-action {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 3px;
}

.post-action.buy {
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.post-action.sell {
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.post-action.hold {
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.post-text {
    font-family: 'VT323', monospace;
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-color);
    margin-bottom: 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-link {
    color: var(--accent-color);
    text-decoration: none;
    font-family: 'VT323', monospace;
    font-size: 14px;
}

.post-link:hover {
    text-decoration: underline;
}

.post-link.simulated {
    color: var(--text-dim);
    font-style: italic;
}

.badge {
    font-family: 'VT323', monospace;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
}

.badge.simulated {
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
    background: rgba(255, 170, 0, 0.1);
}

.badge.live {
    color: var(--success-color);
    border: 1px solid var(--success-color);
    background: rgba(0, 255, 65, 0.1);
}

#posts-list {
    max-height: 500px;
    overflow-y: auto;
}

.no-posts {
    color: var(--text-dim);
    font-family: 'VT323', monospace;
    font-size: 16px;
    text-align: center;
    padding: 40px;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    color: var(--text-bright);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 12px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.15);
}

.data-table tr:hover {
    background: rgba(0, 255, 65, 0.08);
}

.data-table .buy {
    color: var(--success-color);
    font-weight: 600;
}

.data-table .sell {
    color: var(--error-color);
    font-weight: 600;
}

.data-table a {
    color: var(--accent-color);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

/* Errors List */
#errors-list .error-item {
    background: rgba(255, 85, 85, 0.15);
    border-left: 3px solid var(--error-color);
    padding: 12px;
    margin-bottom: 12px;
    font-family: 'IBM Plex Mono', monospace;
}

#errors-list .error-time {
    color: var(--text-bright);
    font-size: 13px;
}

#errors-list .error-message {
    color: var(--error-color);
    margin-top: 5px;
}

/* Footer */
.footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}

.stats {
    display: flex;
    gap: 20px;
    color: var(--text-dim);
}

.stats span span {
    color: var(--text-color);
}

.links {
    display: flex;
    gap: 15px;
}

.links a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

.links a:hover {
    color: var(--text-color);
}

/* Empty State */
.empty-state {
    color: var(--text-dim);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

/* NFT Grid */
.nft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.nft-title {
    color: var(--accent-color);
    font-family: 'VT323', monospace;
    font-size: 18px;
}

.magiceden-btn {
    background: linear-gradient(135deg, #e42575, #6f2da8);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.magiceden-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(228, 37, 117, 0.4);
}

.nft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.nft-card {
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
    cursor: pointer;
}

.nft-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.nft-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.nft-card-info {
    padding: 10px;
    font-family: 'VT323', monospace;
}

.nft-card-title {
    color: var(--text-color);
    font-size: 14px;
    margin-bottom: 4px;
}

.nft-card-price {
    color: var(--accent-color);
    font-size: 12px;
}

.nft-card-status {
    font-size: 11px;
    margin-top: 4px;
}

.nft-card-status.listed {
    color: var(--success-color);
}

.nft-card-status.sold {
    color: var(--text-dim);
}

/* Loading */
.loading {
    display: inline-block;
    animation: pulse 1s infinite;
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
    .terminal {
        padding: 10px;
    }

    .ascii-art {
        font-size: 8px;
    }

    .post-entry {
        padding: 10px;
    }
}

    .info-panel {
        font-size: 14px;
    }

    .label {
        width: 80px;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        padding: 6px 12px;
        font-size: 11px;
    }

    .footer {
        flex-direction: column;
        align-items: center;
    }

    .stats {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* P&L Colors */
.pnl.positive {
    color: var(--success-color);
}

.pnl.negative {
    color: var(--error-color);
}

/* Token links in tables */
.data-table .token-link {
    color: var(--accent-color);
    text-decoration: none;
}

.data-table .token-link:hover {
    text-decoration: underline;
}

/* ==================== ECOSYSTEM MAP ==================== */

.ecosystem-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.ecosystem-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ecosystem-title {
    color: var(--text-bright);
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 8px var(--text-color);
}

.ecosystem-stats {
    color: var(--text-dim);
    font-size: 12px;
}

.ecosystem-updated {
    color: var(--text-dim);
    font-size: 10px;
    opacity: 0.7;
}

.constellation-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 20px;
    padding: 20px;
    min-height: 320px;
    position: relative;
    overflow: hidden;
}

.constellation {
    position: relative;
    width: 100%;
    height: 280px;
}

/* Home token (center) */
.home-node {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(0, 255, 255, 0.3) 0%, transparent 70%);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: pulse-home 2s ease-in-out infinite;
}

.home-symbol {
    color: var(--accent-color);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 10px var(--accent-color);
}

.home-label {
    color: var(--text-dim);
    font-size: 10px;
    margin-top: 2px;
}

@keyframes pulse-home {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.4); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 255, 0.7); }
}

/* Token nodes */
.token-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.token-node:hover {
    z-index: 20;
    transform: translate(-50%, -50%) scale(1.2);
}

.token-circle {
    border-radius: 50%;
    border: 2px solid var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.token-node:hover .token-circle {
    box-shadow: 0 0 20px var(--text-color);
}

/* Flow states */
.token-node.accumulating .token-circle {
    border-color: var(--success-color);
    background: rgba(51, 255, 102, 0.15);
    animation: pulse-accumulate 1.5s ease-in-out infinite;
}

.token-node.distributing .token-circle {
    border-color: var(--error-color);
    background: rgba(255, 85, 85, 0.15);
}

.token-node.neutral .token-circle,
.token-node.unknown .token-circle {
    border-color: var(--text-dim);
}

.token-node.new .token-circle {
    border-color: var(--warning-color);
    background: rgba(255, 204, 0, 0.15);
}

@keyframes pulse-accumulate {
    0%, 100% { box-shadow: 0 0 5px rgba(51, 255, 102, 0.3); }
    50% { box-shadow: 0 0 15px rgba(51, 255, 102, 0.6); }
}

.token-symbol {
    color: var(--text-bright);
    font-size: 11px;
    font-weight: bold;
    max-width: 50px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-overlap {
    color: var(--text-dim);
    font-size: 9px;
    margin-top: 3px;
}

/* Connection lines */
.connection-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    transform-origin: left center;
    z-index: 1;
    opacity: 0.5;
}

/* Token tooltip on hover */
.token-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--terminal-bg);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 8px;
    font-size: 11px;
}

.token-node:hover .token-tooltip {
    display: block;
}

.token-tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 3px;
}

.token-tooltip-row:last-child {
    margin-bottom: 0;
}

.token-tooltip-label {
    color: var(--text-dim);
}

.token-tooltip-value {
    color: var(--accent-color);
}

/* Ecosystem table */
.ecosystem-table-container {
    max-height: 300px;
    overflow-y: auto;
}

.ecosystem-table .overlap-bar {
    display: inline-block;
    height: 12px;
    background: var(--text-color);
    margin-right: 8px;
    vertical-align: middle;
    min-width: 2px;
}

.ecosystem-table .flow-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.flow-indicator.accumulating {
    color: var(--success-color);
}

.flow-indicator.distributing {
    color: var(--error-color);
}

.flow-indicator.neutral,
.flow-indicator.unknown {
    color: var(--text-dim);
}

.flow-indicator.new {
    color: var(--warning-color);
}

.flow-arrow {
    font-size: 14px;
}

/* Legend */
.ecosystem-legend {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid;
}

.legend-dot.accumulating {
    border-color: var(--success-color);
    background: rgba(51, 255, 102, 0.3);
}

.legend-dot.distributing {
    border-color: var(--error-color);
    background: rgba(255, 85, 85, 0.3);
}

.legend-dot.neutral {
    border-color: var(--text-dim);
}

.legend-dot.new {
    border-color: var(--warning-color);
    background: rgba(255, 204, 0, 0.3);
}

