/* Editor surfaces and note content canvas.
   Use this file for note editor layout, embedded editor, preview content and code-copy support. */
.notes-editor-page {
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: #ecf5f2;
  min-height: 0;
  border-top: 1px solid #cfe0dc;
}

.notes-editor-page .ql-toolbar.ql-snow {
  position: sticky;
  top: calc(var(--actions-height, 38px) + var(--title-height, 42px));
  z-index: 880;
  background: white;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  border-left: none;
  border-right: none;
  border-radius: 0;
  padding: 8px 16px;
}

.notes-editor-page .ql-toolbar.ql-snow .ql-stroke {
  stroke: #334155;
}

.notes-editor-page .ql-toolbar.ql-snow .ql-fill,
.notes-editor-page .ql-toolbar.ql-snow .ql-stroke.ql-fill {
  fill: #334155;
}

.notes-editor-page .ql-toolbar.ql-snow .ql-picker,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-label,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-item {
  color: #334155;
}

.notes-editor-page .ql-toolbar.ql-snow button:hover,
.notes-editor-page .ql-toolbar.ql-snow button:focus,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-label:hover,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-label.ql-active,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-item:hover,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-item.ql-selected {
  color: var(--primary);
}

.notes-editor-page .ql-toolbar.ql-snow button:hover .ql-stroke,
.notes-editor-page .ql-toolbar.ql-snow button:focus .ql-stroke,
.notes-editor-page .ql-toolbar.ql-snow button.ql-active .ql-stroke,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-label.ql-active .ql-stroke {
  stroke: var(--primary);
}

.notes-editor-page .ql-toolbar.ql-snow button:hover .ql-fill,
.notes-editor-page .ql-toolbar.ql-snow button:focus .ql-fill,
.notes-editor-page .ql-toolbar.ql-snow button.ql-active .ql-fill,
.notes-editor-page .ql-toolbar.ql-snow button:hover .ql-stroke.ql-fill,
.notes-editor-page .ql-toolbar.ql-snow button:focus .ql-stroke.ql-fill,
.notes-editor-page .ql-toolbar.ql-snow button.ql-active .ql-stroke.ql-fill,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-label:hover .ql-fill,
.notes-editor-page .ql-toolbar.ql-snow .ql-picker-label.ql-active .ql-fill {
  fill: var(--primary);
}

body:not(.no-global-scroll) .notes-editor-page .ql-toolbar.ql-snow {
  top: calc(var(--header-offset, 0) + var(--actions-height, 38px) + var(--title-height, 42px));
}

.editor-toolbar-sticky {
  position: relative;
  top: 0;
  z-index: 40;
  background: #f5f8fa;
  border: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
  border-radius: 8px 8px 0 0;
  padding: 4px 6px;
  margin: 0;
  overflow: visible;
}

body:not(.no-global-scroll) .editor-toolbar-sticky {
  top: 0;
}

.notes-editor-page .ql-container.ql-snow {
  border: none !important;
  border-radius: 0 !important;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-editor-page .ql-editor {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.notes-editor-page #editor.ql-editor {
  border: none;
  outline: none;
  position: relative;
  padding-top: 0px;
  padding-bottom: 24px;
  background: #ffffff;
  color: #0f172a;
  line-height: 1.65;
  white-space: pre-wrap;
  border-left: 1px solid #d7e2ee;
  border-right: 1px solid #d7e2ee;
  border-bottom: 1px solid #d7e2ee;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
  user-select: text;
  -webkit-user-select: text;
}

.notes-editor-page #editor.ql-editor p {
  margin: 0 0 0.3em 0;
  line-height: 1;
}

.notes-editor-page #editor.ql-editor h1,
.notes-editor-page #editor.ql-editor h2,
.notes-editor-page #editor.ql-editor h3 {
  color: #0b2239;
  line-height: 1;
  margin: 0.5em 0 0.35em;
}

.notes-editor-page #saveForm,
.notes-editor-page #createForm {
  flex: 1 1 auto;
  min-height: 0;
}

.note-editor-content-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: #eef3f8;
  border-top: 1px solid #d6e0eb;
}

.note-editor-content-shell #editor {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
}

/* Ensure all elements inside editor allow text selection */
.note-editor-content-shell #editor * {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
}

body.no-global-scroll,
body.no-global-scroll main,
body.no-global-scroll .container-fluid,
body.embedded-editor-host,
body.embedded-editor-host main,
body.embedded-editor-host .container-fluid {
  overflow-x: hidden !important;
}

.note-side-panel {
  min-height: 0;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid #dfe7ef;
  background: white;
}

.note-panel-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  background: white;
  flex: 1 1 auto;
}

.note-panel-frame-trash {
  border-color: #e2b1b1;
  background: #fff8f8;
}

#notePanelPlaceholder {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  background: white;
  color: #64748b;
}

.embedded-editor-host {
  --header-offset: 0px;
  height: 100%;
  overflow: hidden;
  background: white !important;
  background-image: none !important;
  overscroll-behavior: none;
}

.embedded-editor-host .container-fluid {
  padding-left: 0;
  padding-right: 0;
  height: 100%;
  overflow: hidden;
}

.embedded-editor-host main {
  margin-top: 0 !important;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.embedded-editor-host .container-fluid {
  padding-left: 0;
  padding-right: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.embedded-editor-host .editor-container.notes-editor-page {
  height: 100%;
  min-height: 0;
}

.embedded-editor-host #saveForm {
  min-height: 0;
}

.embedded-editor-host .notes-editor-page .ql-container.ql-snow,
.embedded-editor-host .notes-editor-page .ql-editor {
  background: #fff !important;
}

.embedded-editor-host .notes-editor-page .ql-editor {
  overscroll-behavior-y: contain;
}


/* Placeholder para notas cifradas bloqueadas */
.locked-note-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    background: #f8fafc;
    color: #475569;
    user-select: none;
    cursor: default;
    border-radius: 8px;
    margin: 20px;
    border: 1px dashed #cbd5e1;
}

.locked-note-placeholder i.fa-lock {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.locked-note-placeholder:hover i.fa-lock {
    transform: scale(1.1);
}

.locked-note-placeholder h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

.locked-note-placeholder p {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
