/* * ================================================================================================
 * [MODULE] WORKSPACE STYLES
 * ================================================================================================
 */

/* 1. CONTENTOR PRINCIPAL (Ajustado para SPA) */
#view-workspace {
    /* Altura total do ecrã - (Altura do Header + Altura da Dock + Margens) */
    /* 100vh - (80px + 60px + extras) = ~140px a 160px */
    height: calc(100vh - 160px); 
    
    overflow: hidden; 
    margin-top: -10px; /* Ajuste fino para alinhar visualmente */
    position: relative;
    z-index: 1; /* Garante que fica abaixo da Navbar (z-index 9999) */
}

/* 2. GRELHA DE LAYOUT */
.workspace-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    backdrop-filter: blur(10px); /* Efeito vidro suave */
}

/* 3. PAINEL ESQUERDO (CORTEX) */
.cortex-panel {
    background: rgba(5, 5, 8, 0.4);
    border-right: 1px solid rgba(255,255,255,0.05);
    display: flex; 
    flex-direction: column;
    padding: 20px 15px;
    overflow: hidden;
}

.cortex-header { 
    margin-bottom: 15px; 
    padding-bottom: 10px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
}

.label-tech { 
    font-family: 'JetBrains Mono', monospace; 
    font-size: 0.65rem; 
    letter-spacing: 2px; 
    color: var(--accent); 
    font-weight: 700; 
    margin-bottom: 10px; 
    display: block; 
}

.cortex-search { 
    width: 100%; 
    background: rgba(0,0,0,0.3); 
    border: 1px solid rgba(255,255,255,0.1); 
    padding: 8px 10px; 
    border-radius: 6px; 
    color: var(--text); 
    font-size: 0.8rem; 
    outline: none;
    transition: 0.3s;
}
.cortex-search:focus { border-color: var(--accent); }

#cortex-list { 
    flex: 1; 
    overflow-y: auto; 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    margin-top: 10px; 
}

/* Nós de Memória (Posts na lista) */
.memory-node { 
    padding: 10px; 
    border-radius: 6px; 
    cursor: pointer; 
    transition: 0.2s; 
    background: rgba(255,255,255,0.02); 
    border: 1px solid transparent;
}
.memory-node:hover { background: rgba(255,255,255,0.05); }
.memory-node.active { 
    background: rgba(var(--accent-rgb), 0.1); 
    border-color: rgba(var(--accent-rgb), 0.3); 
}

.node-title { 
    font-weight: 600; 
    font-size: 0.8rem; 
    color: var(--text); 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
}
.node-meta { 
    font-size: 0.65rem; 
    opacity: 0.4; 
    font-family: 'JetBrains Mono'; 
    margin-top: 2px; 
}

/* 4. PAINEL DIREITO (EDITOR / NEURAL CANVAS) */
.neural-canvas {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 40px 30px 20px 30px !important;
    overflow: hidden;
    height: 100%;
}

/* Abas */
.synapse-tabs-wrapper { 
    display: flex; 
    gap: 5px; 
    margin-bottom: 10px; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
    padding-bottom: 5px; 
}

#tabs-container { 
    display: flex; 
    gap: 5px; 
    overflow-x: auto; 
}

.tab-node { 
    padding: 5px 12px; 
    font-size: 0.75rem; 
    color: rgba(255,255,255,0.4); 
    cursor: pointer; 
    background: rgba(255,255,255,0.02); 
    border-radius: 4px 4px 0 0; 
    white-space: nowrap; 
    transition: 0.2s;
}
.tab-node:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.tab-node.active { 
    color: var(--accent); 
    background: rgba(var(--accent-rgb), 0.1); 
    font-weight: 600;
}

/* Área de Escrita */
.quantum-editor { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    position: relative; 
}

.editor-status { 
    position: absolute; 
    top: -30px; 
    right: 0; 
    font-family: 'JetBrains Mono'; 
    font-size: 0.65rem; 
    opacity: 0.5; 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #555; transition: 0.3s; }
.pulse-dot.saved { background: var(--accent); box-shadow: 0 0 5px var(--accent); }
.pulse-dot.unsaved { background: #ffaa00; }

#editor-title {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 15px;
    outline: none;
    width: 100%;
}

/* Introduction field - PC only */
#editor-intro {
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 400;
    color: rgba(255,255,255,0.7);
    margin-bottom: 20px;
    outline: none;
    width: 100%;
    font-style: italic;
}
#editor-intro::placeholder {
    opacity: 0.3;
    font-style: italic;
}

#editor-content { 
    flex: 1; 
    background: transparent; 
    border: none; 
    resize: none; 
    outline: none; 
    color: rgba(255,255,255,0.9); 
    font-family: 'JetBrains Mono', monospace; 
    font-size: 0.95rem; 
    line-height: 1.6; 
}
#editor-content::placeholder { opacity: 0.15; }

/* Mobile */
@media (max-width: 800px) {
    .workspace-grid {
        grid-template-columns: 1fr;
        /* Remove visual styles on mobile to match original behavior */
        border: none;
        background: transparent;
        border-radius: 0;
        backdrop-filter: none;
    }
    .cortex-panel { display: none; } /* Esconde painel lateral em ecrãs pequenos */
    .neural-canvas { padding: 15px; }
    #editor-intro { display: none; } /* Introdução apenas visível em PC */
}




/* --- SYNTAX CRUCIBLE UI --- */

/* Abas do Painel Lateral */
.cortex-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.cortex-tab {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    transition: 0.3s;
}

.cortex-tab.active {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
}

.cortex-view.hidden { display: none; }
.cortex-view.active { display: block; animation: fadeIn 0.3s ease; }

/* Cartão de Variável */
.var-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
}

.var-label {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
    font-family: 'JetBrains Mono';
}

.var-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    padding: 8px;
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
}
.var-input:focus { border-color: var(--accent); }