:root
{
    --bg-color: #111111;
    --text-color: #e3e3e3;
    --text-muted: #888888;
    --accent-color: #ffffff;
    --bullet-color: #333333;
    --bullet-active: #ffffff;
    --border-color: #262626;
    --sidebar-width: 250px;
    --line-length: 800px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}


[data-theme="light"]
{
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #3b82f6;
    --bullet-color: #cbd5e1;
    --border-color: #e2e8f0;
}

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

body
{
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

/* ── Auth / Lock Screen ───────────────────────────────────────────────── */
.auth-overlay
{
    position: fixed;
    inset: 0;
    background: #111111;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-panel
{
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.auth-tabs
{
    display: flex;
    border-bottom: 1px solid var(--border-color);
    gap: 0;
}

.auth-tab
{
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.auth-tab.active
{
    color: var(--text-color);
    border-bottom-color: var(--text-color);
}

.auth-fields
{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-input
{
    width: 100%;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s ease;
}

.auth-input:focus
{
    border-color: rgba(255, 255, 255, 0.35);
}

.auth-input::placeholder
{
    color: rgba(255, 255, 255, 0.18);
}

.auth-btn
{
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    margin-top: 4px;
}

.auth-btn:hover
{
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.auth-error
{
    font-size: 0.8rem;
    color: #ef4444;
    text-align: center;
    min-height: 1.2em;
}

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

#main-content
{
    flex: 1;
    overflow-y: auto;
    padding: 3rem 2rem;
    display: flex;
    justify-content: center;
}

#outliner-container
{
    width: 100%;
    max-width: var(--line-length);
}

.node
{
    position: relative;
    padding-left: 1.6rem;
    margin: 0;
    margin-bottom: 3px;
}

.node-bullet
{
    position: absolute;
    /* Center of bullet (left + width/2) = 0.5rem, content starts at 1rem */
    /* Gap between bullet center and text = 0.5rem ≈ 8px — snug and readable */
    left: calc(0.5rem - 3px);
    top: 10px;
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    cursor: grab;
    transition: all 0.2s ease;
    flex-shrink: 0;
    z-index: 1;
}

.node-bullet:hover
{
    background-color: var(--bullet-active);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.node-bullet:active
{
    cursor: grabbing;
}

/* Dragging state on the node itself */
.node.is-dragging
{
    opacity: 0.3;
}

/* Drop indicator line between nodes */
.drop-indicator
{
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1px;
    margin: 0 0 0 1rem;
    pointer-events: none;
}

/* Hoisted Root Styling */
.node.is-hoisted-root
{
    padding-left: 0;
}

.node.is-hoisted-root > .node-bullet
{
    display: none;
}

.node.is-hoisted-root > .node-content
{
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2rem;
    padding-left: 0;
    line-height: 1.2;
}

.node-content
{
    outline: none;
    min-height: 24px;
    line-height: 24px;
    padding: 0 4px;
    border-radius: 4px;
    cursor: text;
    white-space: pre-wrap;
    word-break: break-word;
    font-weight: 400;
    font-size: 0.95rem;
    color: #b3b3b3;
}

.node-content:focus
{
    outline: none;
}

.node-children
{
    border-left: 1px solid var(--border-color);
    /*
     * Bullet center = 0.5rem. Node padding-left = 1.6rem.
     * margin-left = -(1.6rem - 0.5rem) = -1.1rem  → border lands at 0.5rem = bullet center.
     */
    margin-left: -1.1rem;
}

/* Custom Tag Badges */
.badge
{
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 4px;
    color: white;
}

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

::-webkit-scrollbar-track
{
    background: transparent;
}

::-webkit-scrollbar-thumb
{
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover
{
    background: var(--bullet-color);
}

.breadcrumbs
{
    margin-bottom: 3rem;
    padding-bottom: 0;
    border-bottom: none;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    user-select: none;
}

.breadcrumb-nav-group
{
    display: flex;
    align-items: center;
    gap: 12px;
}

.breadcrumb-path-group
{
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-link
{
    cursor: pointer;
    font-weight: 300;
    font-size: 0.8rem;
    transition: color 0.2s ease;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.2);
}

.breadcrumb-nav-btn
{
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.2s ease;
}

.breadcrumb-home-btn
{
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s ease;
}

.breadcrumb-nav-btn:hover,
.breadcrumb-home-btn:hover
{
    color: var(--text-color);
}

.breadcrumb-link:hover
{
    color: var(--text-color);
}

.breadcrumb-icon
{
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.breadcrumb-separator
{
    opacity: 0.5;
    display: flex;
    align-items: center;
}

#floating-footer
{
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    padding: 8px 16px;
    display: flex;
    gap: 16px;
    z-index: 1000;
}

#floating-footer button
{
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#floating-footer button svg
{
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#floating-footer button:hover
{
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.05);
}

.header-settings-btn
{
    margin-left: auto;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.3);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
}

.header-settings-btn:hover
{
    color: var(--text-color);
}

/* Settings overlay: full page cover with same bg as app */
.settings-overlay
{
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 2000;
    overflow-y: auto;
    padding: 3rem 2rem;
    display: flex;
    justify-content: center;
}

.settings-panel
{
    width: 100%;
    max-width: var(--line-length);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-panel-header
{
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.settings-panel-header h2
{
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
    line-height: 1.2;
    flex: 1;
}

.settings-close-btn
{
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    margin-top: 4px;
    flex-shrink: 0;
}

.settings-close-btn:hover
{
    color: var(--text-color);
}

.settings-subtitle
{
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.03em;
}

.settings-section-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 4px;
}

.settings-section
{
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-section h3
{
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0;
}

.tag-add-btn
{
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.tag-add-btn:hover
{
    color: var(--text-color);
    border-color: rgba(255,255,255,0.4);
}

.tag-import-btn
{
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.02em;
    transition: color 0.2s ease, border-color 0.2s ease;
    font-family: var(--font-main);
}

.tag-import-btn:hover
{
    color: var(--text-color);
    border-color: rgba(255,255,255,0.4);
}

.tag-del-btn
{
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.tag-del-btn:hover
{
    color: #ef4444;
    border-color: #ef4444;
}

.tag-row
{
    display: flex;
    align-items: center;
    gap: 12px;
}

.tag-input
{
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: 4px;
    outline: none;
    width: 100px;
    transition: border-color 0.2s ease;
}

.tag-input:focus
{
    border-color: rgba(255, 255, 255, 0.3);
}

.tag-input::placeholder
{
    color: rgba(255, 255, 255, 0.15);
}

.tag-cmd-input
{
    width: 120px;
}

.tag-color-picker
{
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-color-dot
{
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 2px solid transparent;
}

.tag-color-dot:hover
{
    transform: scale(1.2);
}

.tag-color-dot.selected
{
    border-color: var(--text-color);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

/* Node tag badges rendered below bullet content */
.node-tags
{
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    padding-left: 4px;
    margin-top: 0;
    margin-bottom: 1px;
}

.node-tag-badge
{
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    background: none;
    padding: 0;
}

.node-tag-badge::before
{
    content: '[';
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

.node-tag-badge::after
{
    content: ']';
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

/* Reminder / Deadline date display */
.node-date
{
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    padding: 0 2px;
}

.node-date.is-reminder
{
    color: #888888;
}

.node-date.is-deadline
{
    color: #ef4444;
}

