/* Estilos personalizados */

/* Override tui-tree defaults */
.tui-tree-wrap,
.tui-tree-content-wrapper {
    width: auto !important;
}
.tui-tree-wrap { padding-top: 0 !important; }

/* Drag & drop file import visual feedback */
#sidebar.drag-over {
    outline: 3px dashed #4af;
    outline-offset: -4px;
}


@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

:root {
    /* Tema claro (por defecto) */
    --background-color: #333;
    --text-color: #111;
    --editor-background: #f9f9f9;
    --editor-text: #333333;
    --button-background: #FAFAFA;
    --button-text: #333;
	--border-text-color: #efefef;
	
	--link-color: #0000EE;
    --visited-color: #551A8B;
    --hover-color: #0000EE;
    --active-color: #FF0000;
    --focus-color: #0000EE;

    /* Light sidebar defaults */
    --sidebar-bg: #fafbfc;
    --sidebar-header-bg: #f0f2f5;
    --sidebar-border: #e1e4e8;
    --sidebar-text: #24292e;
    --sidebar-text-muted: #6a737d;
    --tree-hover-bg: #f0f3f6;
    --tree-selected-bg: #f1f8ff;
    --tree-selected-text: #0366d6;
    --sidebar-toggle-hover: #e1e4e8;
    --sidebar-scrollbar-thumb: #d1d5da;
    --sidebar-scrollbar-track: transparent;
    --tree-indent-color: #e8eaed;
    --create-btn-bg: #f6f8fa;
}

.dark {
    --background-color: #333;
    --text-color: #e8e6e3;
    --editor-background: #181a1b !important;
    --editor-text: #e8e6e3;
    --button-background: #2a2e2f;
    --button-text: #3391ff;
	--border-text-color: black;
	
	--link-color: #58a6ff;
    --visited-color: #bc8cff;
    --hover-color: #79c0ff;
    --active-color: #ff0000;
    --focus-color: #3391ff;

    /* Sidebar-specific dark vars */
    --sidebar-bg: #1a1c20;
    --sidebar-header-bg: #212429;
    --sidebar-border: #2d3138;
    --sidebar-text: #c5cad3;
    --sidebar-text-muted: #6c727c;
    --tree-hover-bg: #262a30;
    --tree-selected-bg: #182538;
    --tree-selected-text: #68aef7;
    --sidebar-toggle-hover: #333840;
    --sidebar-scrollbar-thumb: #3d434d;
    --sidebar-scrollbar-track: transparent;
    --tree-indent-color: #2b2f36;
    --create-btn-bg: #22262c;
}

/* ─── Dark mode code syntax highlighting ─── */
/* Prism token overrides */
.dark .token.comment,
.dark .token.prolog,
.dark .token.doctype,
.dark .token.cdata { color: #6a9955 !important; }
.dark .token.punctuation { color: #d4d4d4 !important; }
.dark .token.property,
.dark .token.tag,
.dark .token.boolean,
.dark .token.number,
.dark .token.constant,
.dark .token.symbol,
.dark .token.deleted { color: #b5cea8 !important; }
.dark .token.selector,
.dark .token.attr-name,
.dark .token.string,
.dark .token.char,
.dark .token.builtin,
.dark .token.inserted { color: #ce9178 !important; }
.dark .token.operator,
.dark .token.entity,
.dark .token.url { color: #d4d4d4 !important; background: none !important; }
.dark .language-css .token.string,
.dark .style .token.string { color: #ce9178 !important; background: none !important; }
.dark .token.atrule,
.dark .token.attr-value,
.dark .token.keyword { color: #569cd6 !important; }
.dark .token.function,
.dark .token.class-name { color: #dcdcaa !important; }
.dark .token.regex,
.dark .token.important,
.dark .token.variable { color: #d16969 !important; }
.dark .token.bold,
.dark .token.important { font-weight: bold !important; }
.dark .token.italic { font-style: italic !important; }
/* Code block containers */
.dark pre[class*="language-"],
.dark code[class*="language-"],
.dark .toastui-editor-contents pre,
.dark .toastui-editor-contents code,
.dark .toastui-editor-md-preview pre,
.dark .toastui-editor-md-preview code,
.dark .toastui-editor-ww-code-block pre,
.dark .toastui-editor-ww-code-block code {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
    text-shadow: none !important;
}
.dark .toastui-editor-ww-code-block-highlighting:after {
    color: #ccc !important;
    background-color: #333 !important;
}

/* ─── APP LAYOUT: Sidebar + Main ─── */
#app-layout {
    display: flex;
    height: calc(100vh - 5px);
    overflow: hidden;
}

#sidebar {
    width: var(--sidebar-width, 265px);
    min-width: var(--sidebar-width, 265px);
    max-width: var(--sidebar-width, 265px);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 100;
    transform: none;
    box-shadow: 2px 0 8px rgba(0,0,0,0.06);
}

#sidebar.collapsed {
    transform: translateX(calc(var(--sidebar-width, 265px) * -1));
    box-shadow: none;
}

#sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--sidebar-header-bg);
    border-bottom: 1px solid var(--sidebar-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--sidebar-text);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

#sidebar-toggle {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    color: var(--sidebar-text-muted);
    padding: 3px 7px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

#sidebar-toggle:hover {
    background: var(--sidebar-toggle-hover);
    color: var(--sidebar-text);
}

/* Inline sidebar toggle inside heading (visible when sidebar collapsed) */
#inline-sidebar-toggle {
    transition: opacity 0.2s;
}
body.sidebar-collapsed #inline-sidebar-toggle {
    display: inline !important;
}

#sidebar-tree-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    width: 100%;
    box-sizing: border-box;
}

#sidebar-tree-container * {
    max-width: 100%;
    box-sizing: border-box;
}

#sidebar-drop-hint {
    display: block !important;
    padding: 14px;
    font-size: 12px;
    color: var(--sidebar-text-muted);
    text-align: center;
    opacity: 0.55;
    cursor: pointer;
    transition: all 0.2s;
    border-top: 1px solid transparent;
    border-bottom: 1px solid transparent;
    flex-shrink: 0;
    font-style: normal;
    pointer-events: auto;
}
#sidebar-drop-hint:hover {
    opacity: 0.85 !important;
    border-top-color: var(--sidebar-text-muted) !important;
    border-bottom-color: var(--sidebar-text-muted) !important;
    border-top-style: dashed !important;
    border-bottom-style: dashed !important;
    background: var(--tree-hover-bg) !important;
}

/* Custom scrollbar for sidebar */
#sidebar-tree-container::-webkit-scrollbar {
    width: 6px;
}
#sidebar-tree-container::-webkit-scrollbar-track {
    background: var(--sidebar-scrollbar-track);
}
#sidebar-tree-container::-webkit-scrollbar-thumb {
    background: var(--sidebar-scrollbar-thumb);
    border-radius: 3px;
}
#sidebar-tree-container::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-text-muted);
}

#main-content {
    margin-left: var(--sidebar-width, 265px);
    flex: 1;
    min-width: 0;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ─── Image note display ─── */
#image-display {
    padding: 10px;
    background: var(--image-bg, repeating-conic-gradient(#e0e0e0 0% 25%, #f5f5f5 0% 50%) 50% / 20px 20px);
}
.dark #image-display {
    --image-bg: repeating-conic-gradient(#2a2a2a 0% 25%, #333 0% 50%) 50% / 20px 20px;
}
#image-display img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 160px);
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

/* When sidebar is collapsed, main content takes full width */
#app-layout:has(#sidebar.collapsed) #main-content,
body.sidebar-collapsed #main-content {
    margin-left: 0;
}

/* ─── Sidebar pre-collapsed: no animation on initial load ─── */
html.sb-collapsed #sidebar {
    transform: translateX(calc(var(--sidebar-width, 265px) * -1));
    box-shadow: none;
    transition: none !important;
}
html.sb-collapsed #main-content {
    margin-left: 0;
}

/* ─── Responsive: collapse sidebar on narrow screens ─── */
@media (max-width: 600px) {
    #sidebar {
        left: calc(var(--sidebar-width, 265px) * -1);
    }
    #main-content {
        margin-left: 0;
    }
    #sidebar.mobile-open {
        left: 0;
        transform: none !important;
    }
    #inline-sidebar-toggle {
        display: inline !important;
    }
}

/* Delete button — subtle, hidden until hover */
.tree-btn-del {
    display: none !important;
    cursor: pointer;
    font-size: 12px !important;
    font-style: normal !important;
    margin-right: 4px;
    opacity: 0.5;
    transition: opacity 0.15s, color 0.15s;
    vertical-align: middle;
}
.tui-tree-content-wrapper:hover .tree-btn-del {
    display: inline-block !important;
}
.tree-btn-del:hover {
    opacity: 1;
    color: #d73a49;
}

/* Create row — inside subtree, below each folder */
.tree-create-row {
    padding: 2px 0;
    display: flex;
    gap: 6px;
    /* padding-left set dynamically by syncTreeIndents() in tree.js */
}
.tree-btn-create {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--sidebar-text-muted);
    cursor: pointer;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--sidebar-border);
    background: var(--create-btn-bg);
    transition: all 0.15s;
    font-weight: 500;
}
.tree-btn-create:hover {
    background: var(--sidebar-toggle-hover);
    color: var(--sidebar-text);
    border-color: var(--sidebar-text-muted);
}

/* Force subtree visible for nodes with create bar */
.tui-tree-leaf > .tui-tree-subtree {
    display: block !important;
}

/* ─── Tree node styling ─── */
.tui-tree-wrap {
    background: var(--sidebar-bg) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    color: var(--sidebar-text);
    user-select: none;
    overflow: hidden;
    width: 100%;
}

.tui-tree-wrap ul,
.tui-tree-wrap li {
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.tui-tree-content-wrapper {
    overflow: hidden;
    width: 100% !important;
    box-sizing: border-box;
    max-width: 100%;
}

.tui-tree-wrap .tui-tree-content-wrapper {
    padding-top: 2px;
    padding-bottom: 2px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    border-left: 2px solid transparent;
    transition: border-color 0.15s;
    overflow: hidden;
}

/* Root-level nodes: strip unnecessary base indent */
.tui-tree-root > .tui-tree-node > .tui-tree-content-wrapper {
    padding-left: 0 !important;
}

/* Override TUI Tree hardcoded colors */
.tui-tree-wrap .tui-tree-text,
.tui-tree-opened > .tui-tree-content-wrapper .tui-tree-text,
.tui-tree-root > .tui-tree-opened > .tui-tree-content-wrapper .tui-tree-text,
.tui-tree-selected > .tui-tree-content-wrapper .tui-tree-text {
    color: var(--sidebar-text) !important;
    font-weight: 400;
}

.tui-tree-wrap .tui-tree-content-wrapper:hover {
    background: var(--tree-hover-bg);
}

/* Selected tree item — override the generic rule above */
.tui-tree-wrap .tui-tree-selected > .tui-tree-content-wrapper .tui-tree-text {
    color: var(--tree-selected-text) !important;
    font-weight: 600;
}

.tui-tree-wrap .tui-tree-btn {
    padding: 0;
    display: flex;
    align-items: center;
}

.tui-tree-wrap .tui-tree-text {
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.1s;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    width: auto;
}

.tui-tree-wrap .tui-tree-content-wrapper.tui-is-selected > .tree-btn-del + .tui-tree-text,
.tui-tree-wrap .tui-is-selected > .tree-btn-del + .tui-tree-text,
.tui-tree-wrap .tui-tree-text.tui-is-selected,
.tui-tree-wrap .tui-is-selected .tui-tree-text {
    color: var(--tree-selected-text);
}

/* Toggle button */
.tui-tree-wrap .tui-tree-toggle-btn {
    color: var(--sidebar-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 10px;
    width: 18px;
    height: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 3px;
    transition: background 0.12s, color 0.12s;
    margin-right: 2px;
}

.tui-tree-wrap .tui-tree-toggle-btn:hover {
    background: var(--sidebar-toggle-hover);
    color: var(--sidebar-text);
}

/* Hide sprite icons */
.tui-tree-wrap .tui-ico-tree,
.tui-tree-wrap .tui-ico-folder,
.tui-tree-wrap .tui-ico-file {
    display: none;
}

/* CSS toggle arrows (replaces sprite + hides {{stateLabel}}) */
.tui-tree-opened > .tui-tree-content-wrapper .tui-tree-toggle-btn::before {
    content: '▾';
    font-size: 12px;
    line-height: 1;
    color: var(--sidebar-text-muted);
}
.tui-tree-closed > .tui-tree-content-wrapper .tui-tree-toggle-btn::before {
    content: '▸';
    font-size: 12px;
    line-height: 1;
    color: var(--sidebar-text-muted);
}
.tui-tree-wrap .tui-tree-toggle-btn {
    color: transparent;
    font-size: 0;
}

/* Subtree — with vertical guide lines */
.tui-tree-wrap .tui-tree-subtree {
    overflow: hidden;
    box-sizing: border-box;
}

/* ─── Vertical guide lines for expanded folders ─── */
.tui-tree-opened > .tui-tree-subtree {
    position: relative;
}

.tui-tree-opened > .tui-tree-subtree::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--tree-indent-color);
    z-index: 10;
    pointer-events: none;
    /* left set dynamically via --guide-left by syncTreeIndents() in tree.js */
    left: var(--guide-left, 9px);
}

/* Loading indicator */
.tui-tree-loader {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--sidebar-border);
    border-top-color: var(--sidebar-text-muted);
    border-radius: 50%;
    animation: tui-spin 0.8s linear infinite;
    margin: 6px 12px;
}

@keyframes tui-spin {
    to { transform: rotate(360deg); }
}

/* Context menu theme */
.tui-context-menu {
    background: var(--sidebar-header-bg) !important;
    border: 1px solid var(--sidebar-border) !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
    padding: 4px 0 !important;
    min-width: 160px;
}
.tui-context-menu .tui-context-menu-item {
    color: var(--sidebar-text) !important;
    padding: 6px 14px !important;
    font-size: 13px;
    border-radius: 0;
}
.tui-context-menu .tui-context-menu-item:hover {
    background: var(--tree-hover-bg) !important;
}
.tui-context-menu .tui-context-menu-separator {
    border-color: var(--sidebar-border) !important;
    margin: 4px 0 !important;
}

html, body {
    margin: 0;
    height: 100%;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

#last_modified {
    color: var(--text-color);
    transition: color 1s ease;
}

#last_modified.fade {
    animation: fadeAnimation 2s ease-in-out;
}

@keyframes fadeAnimation {
    0% {
        color: var(--text-color);
    }
    50% {
        color: #6464c8;
    }
    100% {
        color: var(--text-color);
    }
}

.aboutInfoClass {
	background-color: var(--button-background) !important;
	color: var(--text-color) !important;
}

/* TOAST UI EDITOR - THEME INTEGRATION */

/* Toolbar del editor - colores del tema */
.toastui-editor-defaultUI {
    margin-top: 30px;
    border: 1px solid var(--border-text-color) !important;
    border-radius: 4px;
    -webkit-box-shadow: 0 0 10px 5px #000;
    -moz-box-shadow: 0 0 10px 5px #000;
    box-shadow: 0 0 10px 5px #000;
    transition: border-color 0.3s, background-color 0.3s;
}

/* ── Responsive width: force all editor children to fill container ── */
#toastui-editor,
#toastui-editor > *,
#toastui-editor .toastui-editor-defaultUI,
#toastui-editor .toastui-editor-main,
#toastui-editor .toastui-editor-main-container,
#toastui-editor .toastui-editor-ww-container,
#toastui-editor .toastui-editor-md-container,
#toastui-editor .ProseMirror {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

/* Overlay que bloquea la edición hasta que SSE cargue la nota */
#editor-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    cursor: wait;
    border-radius: 4px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
#editor-loading-overlay.show {
    opacity: 1;
}
/* Indicador visual con retardo */
#editor-loading-overlay.show::after {
    content: '📄 Loading note...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 18px;
    font-family: sans-serif;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    background: rgba(0,0,0,0.6);
    padding: 12px 24px;
    border-radius: 8px;
}

/* --- SAVE ERROR STATE --- */
@keyframes pulse-alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}
.save-error .toastui-editor-defaultUI {
    border-color: #ff4444 !important;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.5);
}
.save-error .toastui-editor-contents {
    opacity: 0.85;
    user-select: text !important;
    -webkit-user-select: text !important;
}
#save-error-banner {
    background: #cc2222;
    color: #fff;
    text-align: center;
    padding: 8px 16px;
    font-size: 14px;
    font-family: sans-serif;
    border-radius: 4px 4px 0 0;
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: pulse-alert 1.5s ease-in-out infinite;
}
#save-error-banner:hover {
    animation: none;
}
#save-indicator.error-blink {
    animation: blink 0.8s ease-in-out infinite;
}

/* Contador de tamaño en vivo */
#size-counter {
    position: fixed;
    top: 50px;
    right: 30px;
    font-size: 13px;
    font-family: sans-serif;
    padding: 4px 10px;
    border-radius: 6px;
    z-index: 9999;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}
#size-counter.size-counter-ok {
    background: rgba(0,0,0,0.06);
    color: var(--text-color, #333);
}
#size-counter.size-counter-warn {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}
#size-counter.size-counter-over {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    animation: pulse-alert 1.5s ease-in-out infinite;
}
#size-counter.size-counter-over:hover {
    animation: none;
}
.dark #size-counter.size-counter-ok {
    background: rgba(255,255,255,0.08);
    color: #ccc;
}
.dark #size-counter.size-counter-warn {
    background: #3d2e00;
    color: #ffc107;
    border-color: #856404;
}
.dark #size-counter.size-counter-over {
    background: #3d0a0a;
    color: #f5c6cb;
    border-color: #721c24;
}

.toastui-editor-defaultUI-toolbar {
    background-color: var(--button-background) !important;
    border-bottom: 1px solid var(--border-text-color) !important;
    transition: border-color 0.3s, background-color 0.3s;
}

/* Botones del toolbar con borde completo (estilo TOAST UI por defecto) */
.toastui-editor-defaultUI-toolbar button {
    border: 1px solid transparent;
    transition: border-color 0.3s, background-color 0.3s;
}

/* Los botones del dropdown no deben heredar background-color del theme */
.toastui-editor-dropdown-toolbar button {
    background-color: transparent !important;
}

.toastui-editor-toolbar-icons.fa-style {
    background-color: var(--button-background) !important;
}

.toastui-editor-toolbar-icons.fa-style:hover {
    background-color: var(--border-text-color) !important;
}

/* Botones personalizados con emoji (sin FontAwesome) */
.toastui-editor-toolbar-icons.fa-style {
    background-image: none !important;
    font-size: 16px;
    line-height: 1;
}

/* Iconos emoji también en el menú "more" colapsado y popups */
.toastui-editor-popup .toastui-editor-toolbar-icons.fa-style,
.toastui-editor-tooltip .toastui-editor-toolbar-icons.fa-style,
.toastui-editor-dropdown-toolbar .toastui-editor-toolbar-icons.fa-style {
    background-image: none !important;
    font-size: 16px;
    line-height: 32px;
}

/* Los iconos nativos del editor (sprite) en el dropdown necesitan
   fondo transparente para que las áreas transparentes del sprite se vean bien */
.toastui-editor-dropdown-toolbar .toastui-editor-toolbar-icons {
    background-color: transparent !important;
}

/* Iconos en tema oscuro */
.toastui-editor-dark .toastui-editor-toolbar-icons.fa-style,
.toastui-editor-dark .toastui-editor-popup .toastui-editor-toolbar-icons.fa-style,
.toastui-editor-dark .toastui-editor-dropdown-toolbar .toastui-editor-toolbar-icons.fa-style {
    color: #3399FF;
}

/* Popup manual de imagen en tema oscuro */
.toastui-editor-dark #custom-img-popup {
    background: #232428;
    border-color: #303238;
    color: #ddd;
}
.toastui-editor-dark #custom-img-popup input {
    background: #181a1b;
    color: #ddd;
    border-color: #303238;
}

/* Área de contenido del editor */
.toastui-editor-contents {
    background-color: var(--editor-background) !important;
    color: var(--editor-text) !important;
    transition: background-color 0.3s, color 0.3s;
    min-height: 300px;
}

.toastui-editor-contents a:link { color: var(--link-color);}
.toastui-editor-contents a:visited { color: var(--visited-color);}
.toastui-editor-contents a:hover { color: var(--hover-color);}
.toastui-editor-contents a:active { color: var(--active-color);}
.toastui-editor-contents a:focus { color: var(--focus-color);}

/* About popup links */
#custom-about-popup a:link { color: var(--link-color); }
#custom-about-popup a:visited { color: var(--visited-color); }
#custom-about-popup a:hover { color: var(--hover-color); }

/* Dropdowns personalizados en el toolbar */
.toastui-editor-dropdown-toolbar select {
    background: var(--editor-background);
    color: var(--editor-text);
    border: 1px solid var(--border-text-color);
    padding: 4px;
    width: 100%;
    margin-bottom: 8px;
}

/* Typing indicator (other users editing) */
.typing-indicator {
    display: inline-block;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-left: 8px;
    vertical-align: middle;
}
.typing-indicator.visible {
    opacity: 1;
}
.typing-indicator.blink {
    animation: blink 1s infinite;
}

/* page */
.page-wrapper {
    margin: 0;
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
}

#toastui-editor {
    width: 100%;
    box-sizing: border-box;
}

/* box */
.box-content {
    padding-left:20px;
    padding-right:20px;
}

/* textarea solo para el input del nombre de nota en main page */
textarea {
    background-color:var(--editor-background) !important;
    border:#EFEFEF solid 1px;
    color:var(--editor-text) !important;
    height:150px;
    width:100%;
}

/* ─── EMOJI PICKER ─── */
#custom-emoji-popup .emoji-cat-btn.active {
    background: var(--tree-hover-bg, #f0f3f6) !important;
}
#custom-emoji-popup .emoji-cat-btn:hover {
    background: var(--tree-hover-bg, #f0f3f6) !important;
}
#emoji-grid-container {
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-scrollbar-thumb, #d1d5da) transparent;
}
#emoji-grid-container::-webkit-scrollbar {
    width: 5px;
}
#emoji-grid-container::-webkit-scrollbar-track {
    background: transparent;
}
#emoji-grid-container::-webkit-scrollbar-thumb {
    background: var(--sidebar-scrollbar-thumb, #d1d5da);
    border-radius: 3px;
}
#emoji-search::placeholder {
    color: var(--sidebar-text-muted, #6a737d);
    opacity: 0.6;
}