
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --accent: #00ff88;
    --accent-dim: #00cc6a;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --border: #2a2a3a;
    --danger: #ff4444;
    --warning: #ffaa00;
    --success: #00ff88;
}

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

body {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ONE SCENE Container */
.scene {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    grid-template-rows: 60px 1fr 40px;
    gap: 1px;
    height: 100vh;
    background: var(--border);
}

/* Header */
.header {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--accent);
}

.logo {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent);
}

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

.nav {
    display: flex;
    gap: 20px;
}

.nav-item {
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent);
    background: var(--bg-tertiary);
}

/* Panels */
.panel {
    background: var(--bg-secondary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: bold;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Left Sidebar - Feed */
.feed-item {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent);
    cursor: pointer;
    transition: all 0.2s;
}

.feed-item:hover {
    transform: translateX(4px);
}

.feed-item.hot {
    border-left-color: var(--danger);
}

.feed-item.cooling {
    border-left-color: var(--text-secondary);
    opacity: 0.7;
}

.feed-item-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.feed-item-meta {
    font-size: 0.85em;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.charge-bar {
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.charge-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

/* Main Content - Chat */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
}

.message.user {
    background: var(--accent);
    color: var(--bg-primary);
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    background: var(--bg-tertiary);
    border-bottom-left-radius: 4px;
}

.message-meta {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-top: 4px;
}

.message.user .message-meta {
    color: var(--bg-secondary);
}

.chat-input {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1em;
}

.chat-input input:focus {
    outline: none;
    border-color: var(--accent);
}

.chat-input button {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-input button:hover {
    background: var(--accent-dim);
}

/* Right Sidebar - Status */
.status-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.status-card h3 {
    color: var(--accent);
    font-size: 0.9em;
    margin-bottom: 8px;
}

.status-value {
    font-size: 2em;
    font-weight: bold;
}

.status-label {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Security Events */
.security-event {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.security-event.info {
    background: rgba(0, 255, 136, 0.1);
    border-left: 3px solid var(--success);
}

.security-event.warning {
    background: rgba(255, 170, 0, 0.1);
    border-left: 3px solid var(--warning);
}

.security-event.critical {
    background: rgba(255, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
}

/* Footer */
.footer {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

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

/* Search */
.search-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    margin-bottom: 16px;
}

.search-result {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
}

.search-result-score {
    color: var(--accent);
    font-size: 0.85em;
}

/* HTMX Loading */
.htmx-request {
    opacity: 0.5;
}

.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

/* SVG Scene Container */
.svg-scene {
    position: relative;
    width: 100%;
    height: 100%;
}

.svg-scene svg {
    width: 100%;
    height: 100%;
}

/* Alexandria Graph Panel */
.graph-container {
    width: 100%;
    height: 400px;
    background: var(--bg-primary);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.graph-node {
    position: absolute;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent);
    border-radius: 20px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.graph-node:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: scale(1.1);
}

.graph-node.active {
    background: var(--accent);
    color: var(--bg-primary);
}

.graph-edge {
    stroke: var(--accent);
    stroke-width: 1;
    fill: none;
    opacity: 0.5;
}

/* BBBCP Query Panel */
.bbbcp-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bbbcp-section {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
}

.bbbcp-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: bold;
}

.bbbcp-bone { color: #ff6b6b; }
.bbbcp-blob { color: #4ecdc4; }
.bbbcp-biz { color: #ffe66d; }
.bbbcp-circle { color: #95e1d3; }
.bbbcp-pin { color: #f38181; }

.bbbcp-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.bbbcp-result {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    border-left: 3px solid var(--accent);
}

.bbbcp-result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.bbbcp-quality {
    font-size: 0.9em;
    padding: 2px 8px;
    border-radius: 4px;
}

.bbbcp-quality.high {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success);
}

.bbbcp-quality.medium {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning);
}

.bbbcp-quality.low {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger);
}

/* Tesseract Visualization */
.tesseract-container {
    width: 100%;
    height: 300px;
    background: var(--bg-primary);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tesseract-face {
    position: absolute;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75em;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.tesseract-face.active {
    border-color: var(--accent);
    color: var(--accent);
}

.tesseract-core {
    width: 120px;
    height: 120px;
    border: 2px solid var(--accent);
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.tesseract-core::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid var(--accent);
    opacity: 0.5;
}

.tesseract-inner {
    transform: rotate(-45deg);
    font-size: 0.8em;
    text-align: center;
    color: var(--accent);
}

/* 5W Dimension Panel */
.dimension-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.dimension-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.dimension-card:hover {
    border-color: var(--accent);
}

.dimension-card.pinned {
    border-color: var(--accent);
    background: rgba(0, 255, 136, 0.1);
}

.dimension-label {
    font-weight: bold;
    margin-bottom: 4px;
    color: var(--accent);
}

.dimension-value {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.tab {
    padding: 8px 16px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.tab.active {
    color: var(--accent);
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--accent);
}
