/* monopole.systems - Terminal Command Line Generative Systems */
/* Colors: #121820, #1E2A3A, #FF4444, #A0B0C0, #0A0E14, #FFB800, #1A2230, #607080, #00FF9F */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0A0E14;
    color: #A0B0C0;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

#app {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
#sidebar {
    width: 240px;
    min-width: 240px;
    height: 100%;
    background: #0A0E14;
    border-right: 1px solid #1E2A3A;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #1E2A3A;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #00FF9F;
    white-space: nowrap;
}

.prompt {
    color: #FFB800;
}

.cursor {
    color: #00FF9F;
}

.cursor.blink {
    animation: cursorBlink 1s step-end infinite;
}

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

#file-tree {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #607080;
    line-height: 1.8;
}

#file-tree .tree-line {
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.05s ease;
}

#file-tree .tree-line.visible {
    opacity: 1;
}

#file-tree .tree-line .file-name {
    color: #A0B0C0;
}

#file-tree .tree-line .dir-name {
    color: #00FF9F;
}

#file-tree .tree-line .exec-name {
    color: #FF4444;
}

/* Dashboard */
#dashboard {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
    background: #1E2A3A;
    padding: 1px;
}

.quadrant {
    background: #121820;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    position: relative;
}

.quadrant.visible {
    opacity: 1;
}

.quadrant::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid #00FF9F;
    opacity: 0;
    pointer-events: none;
}

.quadrant.border-drawn::before {
    animation: drawBorder 600ms linear forwards;
}

@keyframes drawBorder {
    0% {
        clip-path: polygon(0 0, 0 0, 0 0, 0 0);
        opacity: 0.4;
    }
    25% {
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        opacity: 0.4;
    }
    50% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 0);
        opacity: 0.4;
    }
    75% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 0.4;
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 0.2;
    }
}

.quadrant-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #1E2A3A;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    flex-shrink: 0;
}

.quadrant-label {
    color: #00FF9F;
    font-weight: 500;
    letter-spacing: 1px;
}

.quadrant-status {
    color: #607080;
    font-size: 10px;
}

.quadrant-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00FF9F;
    margin-right: 6px;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Topology Quadrant - Canvas */
#quadrant-topology {
    grid-column: 1;
    grid-row: 1;
}

#node-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
    display: block;
}

/* Data Flow Quadrant */
#quadrant-dataflow {
    grid-column: 2;
    grid-row: 1;
}

#dataflow-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
}

.flow-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #1A2230;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.flow-line.visible {
    opacity: 1;
    transform: translateX(0);
}

.flow-source {
    color: #00FF9F;
    min-width: 90px;
}

.flow-arrow {
    color: #607080;
}

.flow-dest {
    color: #A0B0C0;
    min-width: 90px;
}

.flow-rate {
    color: #FFB800;
    margin-left: auto;
    font-size: 10px;
}

/* Status Log Quadrant */
#quadrant-log {
    grid-column: 1;
    grid-row: 2;
}

#log-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
}

.log-entry {
    padding: 3px 0;
    white-space: nowrap;
    opacity: 0;
    animation: fadeInLog 0.3s ease forwards;
}

@keyframes fadeInLog {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-timestamp {
    color: #607080;
    margin-right: 8px;
}

.log-level-info {
    color: #00FF9F;
}

.log-level-warn {
    color: #FFB800;
}

.log-level-error {
    color: #FF4444;
}

.log-message {
    color: #A0B0C0;
}

/* Detail Panel Quadrant */
#quadrant-detail {
    grid-column: 2;
    grid-row: 2;
}

#detail-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-title {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    font-weight: 500;
    color: #00FF9F;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #1E2A3A;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
}

.detail-key {
    color: #607080;
}

.detail-value {
    color: #FFB800;
}

/* Process List */
.process-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
}

.process-pid {
    color: #607080;
    min-width: 40px;
}

.process-name {
    color: #A0B0C0;
    flex: 1;
}

.process-cpu {
    color: #FFB800;
    min-width: 40px;
    text-align: right;
}

/* Memory Bars */
.memory-bar-container {
    margin-bottom: 6px;
}

.memory-bar-label {
    display: flex;
    justify-content: space-between;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: #607080;
    margin-bottom: 3px;
}

.memory-bar-track {
    height: 4px;
    background: #1A2230;
    border-radius: 2px;
    overflow: hidden;
}

.memory-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease;
}

.memory-bar-fill.green {
    background: #00FF9F;
}

.memory-bar-fill.yellow {
    background: #FFB800;
}

.memory-bar-fill.red {
    background: #FF4444;
}

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

::-webkit-scrollbar-track {
    background: #0A0E14;
}

::-webkit-scrollbar-thumb {
    background: #1E2A3A;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #607080;
}
