:root {
    --bg-dark: #0f172a;
    --bg-panel: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

#cy-container {
    flex: 1;
    position: relative;
    height: 100%;
}

#header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

#header h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#cy {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
}

#sidebar {
    width: 450px;
    background-color: var(--bg-panel);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: -4px 0 15px rgba(0,0,0,0.2);
}

#sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

#node-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
    word-break: break-word;
}

.badge {
    background: var(--border);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#markdown-preview {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e2e8f0;
}

#markdown-preview h1, #markdown-preview h2, #markdown-preview h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #fff;
}

#markdown-preview p, #markdown-preview ul {
    margin-bottom: 1em;
}

#markdown-preview code {
    background: #0f172a;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

#markdown-preview pre {
    background: #0f172a;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1em;
}

#markdown-editor {
    width: 100%;
    height: 60vh;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    font-family: monospace;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 15px;
}

#markdown-editor:focus {
    outline: none;
    border-color: var(--primary);
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--border);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

#btn-edit {
    margin-top: 20px;
    width: 100%;
    background: var(--border);
    color: white;
}

#btn-edit:hover {
    background: #475569;
}
