/* Monaco Line Notes Glyph Margin Icon */
.monaco-note-glyph {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f72585"><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/></svg>') no-repeat center center;
    background-size: 14px 14px;
    cursor: pointer;
}
.monaco-note-add-glyph {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2350fa7b" opacity="0.65"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>') no-repeat center center;
    background-size: 14px 14px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.monaco-note-add-glyph:hover {
    opacity: 1;
}

/* Notepad Mentions Autocomplete Popup */
#notepad-mention-popup {
    position: absolute;
    z-index: 10005;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    max-height: 180px;
    overflow-y: auto;
    width: 220px;
    font-family: inherit;
    font-size: 11px;
}

.notepad-mention-item {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.notepad-mention-item:hover, .notepad-mention-item.active {
    background: rgba(189, 147, 249, 0.15);
    color: #ff79c6;
}

.notepad-mention-item .material-icons {
    font-size: 14px;
}

#notepad-textarea {
    flex: 1;
    min-height: 150px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--md-sys-color-on-surface);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
    resize: none;
    outline: none;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.25);
    transition: all 0.2s ease;
    overflow-y: auto;
}

#notepad-textarea:focus {
    border-color: #bd93f9;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 0 8px rgba(189, 147, 249, 0.2);
}

/* Notepad Preview Area */
#notepad-preview-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    color: var(--md-sys-color-on-surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
    font-family: 'Outfit', 'Segoe UI', sans-serif;
}

#notepad-preview-area h1,
#notepad-preview-area h2,
#notepad-preview-area h3 {
    color: #ff79c6;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: 600;
}
#notepad-preview-area h1 { font-size: 1.3em; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 3px; }
#notepad-preview-area h2 { font-size: 1.15em; }
#notepad-preview-area h3 { font-size: 1.05em; }
#notepad-preview-area p { margin-bottom: 8px; font-size: 11.5px; line-height: 1.5; opacity: 0.9; }
#notepad-preview-area ul, #notepad-preview-area ol { padding-left: 16px; margin-bottom: 8px; }
#notepad-preview-area li { margin-bottom: 3px; font-size: 11.5px; }
#notepad-preview-area code.inline-code {
    background: rgba(0, 0, 0, 0.25);
    color: #f1fa8c;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 85%;
}
#notepad-preview-area blockquote {
    border-left: 3px solid #bd93f9;
    padding-left: 8px;
    color: #6272a4;
    margin: 8px 0;
    background: rgba(255,255,255,0.01);
}
#notepad-preview-area .task-list-item {
    list-style-type: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
#notepad-preview-area .task-checkbox {
    cursor: pointer;
    accent-color: #bd93f9;
}

/* @ Mentions Links inside Preview Mode */
.note-ref {
    color: #ff79c6 !important;
    text-decoration: none !important;
    font-weight: 600;
    cursor: pointer;
    background: rgba(189, 147, 249, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
    border: 1px solid rgba(189, 147, 249, 0.25);
}

.note-ref:hover {
    background: rgba(189, 147, 249, 0.2);
    border-color: #bd93f9;
    box-shadow: 0 2px 6px rgba(189, 147, 249, 0.3);
}

.note-ref[data-type="interface"] {
    color: #50fa7b !important;
    background: rgba(80, 250, 123, 0.08) !important;
    border-color: rgba(80, 250, 123, 0.2) !important;
}

.note-ref[data-type="interface"]:hover {
    background: rgba(80, 250, 123, 0.18) !important;
    border-color: #50fa7b !important;
    box-shadow: 0 2px 6px rgba(80, 250, 123, 0.3) !important;
}

.note-ref[data-type="variable"] {
    color: #8be9fd !important;
    background: rgba(139, 233, 253, 0.08) !important;
    border-color: rgba(139, 233, 253, 0.2) !important;
}

.note-ref[data-type="variable"]:hover {
    background: rgba(139, 233, 253, 0.18) !important;
    border-color: #8be9fd !important;
    box-shadow: 0 2px 6px rgba(139, 233, 253, 0.3) !important;
}

.note-ref::before {
    content: "@";
    opacity: 0.8;
}

/* ContentEditable Notepad Placeholder Support */
#notepad-textarea:empty::before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
    display: block;
}

/* Rich Mentions Badge inside Notepad Editor */
.note-mention-badge {
    background: rgba(189, 147, 249, 0.12);
    border: 1px solid rgba(189, 147, 249, 0.25);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0 2px;
    user-select: all;
    vertical-align: middle;
}
.note-mention-badge[data-type="doc"] {
    color: #ff79c6; /* Pink doc pill */
}
.note-mention-badge[data-type="file"] {
    color: #bd93f9; /* Purple script pill */
}
.note-mention-badge[data-type="interface"] {
    color: #50fa7b; /* Green interface pill */
    background: rgba(80, 250, 123, 0.08);
    border-color: rgba(80, 250, 123, 0.25);
}
.note-mention-badge[data-type="variable"] {
    color: #8be9fd; /* Cyan variable pill */
    background: rgba(139, 233, 253, 0.08);
    border-color: rgba(139, 233, 253, 0.25);
}

/* Line Note List Item in Panel */
.line-note-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
}

.line-note-item:hover {
    border-color: var(--md-sys-color-primary);
    background: rgba(25, 127, 230, 0.04);
}

.line-note-label {
    font-weight: bold;
    color: var(--md-sys-color-tertiary);
    margin-right: 6px;
}

.line-note-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.8;
}

.line-note-delete {
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    margin-left: 6px;
    color: var(--md-sys-color-error);
}

.line-note-delete:hover {
    opacity: 1;
    background: rgba(255, 85, 85, 0.15);
    border-radius: 3px;
}

/* In-Editor Markdown Split Preview Pane styles */
#markdown-preview-pane h1,
#markdown-preview-pane h2,
#markdown-preview-pane h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #ff79c6; /* Dracula Pink */
}
#markdown-preview-pane h1 { font-size: 1.8em; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 6px; }
#markdown-preview-pane h2 { font-size: 1.4em; }
#markdown-preview-pane h3 { font-size: 1.2em; }
#markdown-preview-pane p { line-height: 1.6; margin-bottom: 12px; font-size: 13px; color: #f8f8f2; }
#markdown-preview-pane a { color: #8be9fd; text-decoration: none; border-bottom: 1px dashed rgba(139, 233, 253, 0.5); }
#markdown-preview-pane a:hover { color: #50fa7b; border-bottom-style: solid; }
#markdown-preview-pane blockquote {
    border-left: 4px solid #bd93f9;
    padding-left: 12px;
    margin: 12px 0;
    color: #6272a4;
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
}
#markdown-preview-pane ul, #markdown-preview-pane ol {
    padding-left: 20px;
    margin-bottom: 12px;
}
#markdown-preview-pane li {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 4px;
}
#markdown-preview-pane code.inline-code {
    background: rgba(0, 0, 0, 0.25);
    color: #f1fa8c; /* Dracula Yellow */
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 85%;
}
#markdown-preview-pane table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
#markdown-preview-pane th, #markdown-preview-pane td {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12.5px;
}
#markdown-preview-pane th {
    background: rgba(255, 255, 255, 0.04);
    font-weight: 600;
    color: #bd93f9; /* Dracula Purple */
    text-align: left;
}
#markdown-preview-pane tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}
#markdown-preview-pane .task-list-item {
    list-style-type: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
#markdown-preview-pane .task-checkbox {
    cursor: pointer;
    accent-color: #bd93f9;
}

/* ============================================================
   PHASE 1 — Chat UI/UX Improvements
   ============================================================ */
