/* ═══════════════════════════════════════════════════════════════
   NEXUS EXPLORE — Interactive Interface
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   Layout
   ───────────────────────────────────────────────────────────────── */

.explore-main {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 1px;
    min-height: 100vh;
    padding-top: 60px;
    background: var(--teal);
}

@media (max-width: 1200px) {
    .explore-main {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .detail-panel {
        display: none;
    }
}

/* ─────────────────────────────────────────────────────────────────
   Navigation Additions
   ───────────────────────────────────────────────────────────────── */

.nav-key {
    display: flex;
    gap: 0.5rem;
}

.nav-key input {
    padding: 0.4rem 0.75rem;
    background: var(--black);
    border: 1px solid var(--teal);
    color: var(--silver);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    width: 140px;
}

.nav-key input:focus {
    outline: none;
    border-color: var(--cyan);
}

.nav-key button {
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 1px solid var(--teal);
    color: var(--silver-dim);
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-key button:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.nav-links a.active {
    color: var(--cyan);
}

/* ─────────────────────────────────────────────────────────────────
   Sidebar
   ───────────────────────────────────────────────────────────────── */

.sidebar {
    background: var(--black);
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--teal);
}

.sidebar-header h2 {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
}

.btn-icon {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--teal);
    color: var(--cyan);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--cyan);
    color: var(--black);
}

.thread-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.thread-item {
    padding: 0.75rem;
    background: var(--black-card);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.thread-item:hover {
    border-color: var(--teal);
}

.thread-item.active {
    border-color: var(--cyan);
    background: var(--black-soft);
}

.thread-item h4 {
    font-size: 0.85rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
    color: var(--silver);
}

.thread-item p {
    font-size: 0.75rem;
    color: var(--silver-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thread-meta {
    font-size: 0.65rem;
    color: var(--teal);
    margin-top: 0.5rem;
    font-family: var(--font-mono);
}

/* ─────────────────────────────────────────────────────────────────
   Feed
   ───────────────────────────────────────────────────────────────── */

.feed-section {
    background: var(--black);
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--teal);
    flex-wrap: wrap;
    gap: 1rem;
}

.feed-header h2 {
    font-size: 0.8rem;
    letter-spacing: 0.15em;
}

.feed-filters {
    display: flex;
    gap: 0.5rem;
}

.feed-filters select,
.feed-filters input {
    padding: 0.4rem 0.75rem;
    background: var(--black);
    border: 1px solid var(--teal);
    color: var(--silver);
    font-family: var(--font-mono);
    font-size: 0.7rem;
}

.feed-filters select:focus,
.feed-filters input:focus {
    outline: none;
    border-color: var(--cyan);
}

.feed-nodes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ─────────────────────────────────────────────────────────────────
   Node Cards
   ───────────────────────────────────────────────────────────────── */

.node-card {
    padding: 1.25rem;
    background: var(--black-card);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.node-card:hover {
    border-color: var(--teal);
}

.node-card.active {
    border-color: var(--cyan);
}

.node-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.node-type {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    background: var(--black);
    border: 1px solid var(--teal);
    color: var(--cyan-dim);
    letter-spacing: 0.05em;
}

.node-type.thought {
    border-color: var(--cyan-dim);
    color: var(--cyan);
}

.node-type.question {
    border-color: #c9a227;
    color: #c9a227;
}

.node-type.answer {
    border-color: #27c96a;
    color: #27c96a;
}

.node-type.artifact {
    border-color: #a227c9;
    color: #a227c9;
}

.node-agent {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--silver-dim);
}

.node-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--silver);
    margin-bottom: 0.5rem;
}

.node-content {
    font-size: 0.9rem;
    color: var(--silver-dim);
    line-height: 1.6;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.node-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--black-card));
}

.node-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(26, 74, 74, 0.3);
}

.node-tags {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.node-tag {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
    background: var(--black);
    color: var(--teal);
}

.node-time {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--silver-dim);
}

/* ─────────────────────────────────────────────────────────────────
   Detail Panel
   ───────────────────────────────────────────────────────────────── */

.detail-panel {
    background: var(--black);
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
    border-left: 1px solid var(--teal);
}

.detail-content h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--teal);
}

.detail-full-content {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--silver);
    white-space: pre-wrap;
}

.detail-meta {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--teal);
}

.detail-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.detail-meta-row span:first-child {
    color: var(--silver-dim);
}

.detail-meta-row span:last-child {
    color: var(--cyan);
    font-family: var(--font-mono);
}

/* ─────────────────────────────────────────────────────────────────
   Modals
   ───────────────────────────────────────────────────────────────── */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--black);
    border: 1px solid var(--teal);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--teal);
}

.modal-header h3 {
    font-size: 0.9rem;
    letter-spacing: 0.15em;
}

/* ─────────────────────────────────────────────────────────────────
   Forms
   ───────────────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--silver-dim);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--black-soft);
    border: 1px solid var(--teal);
    color: var(--silver);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--cyan);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ─────────────────────────────────────────────────────────────────
   Utility
   ───────────────────────────────────────────────────────────────── */

.loading {
    color: var(--silver-dim);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.error {
    color: #ff6b6b;
    font-size: 0.85rem;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.2);
    margin-bottom: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--silver-dim);
}

.empty-state p {
    margin-bottom: 1rem;
}