/* ── Notes & Scratchpad Styles ──────────────────────────────────────────── */

/* Note list items */
.notes-list-item {
    padding: 8px 10px;
    border: 1px solid rgba(128,128,128,.15);
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.notes-list-item:hover {
    background: rgba(99,102,241,.06);
    border-color: rgba(99,102,241,.25);
}
.notes-list-item.active {
    background: rgba(99,102,241,.12);
    border-color: rgba(99,102,241,.4);
}

/* Tag filter sidebar */
.notes-tag-filter-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: .82rem;
    transition: background .12s;
}
.notes-tag-filter-item:hover {
    background: rgba(128,128,128,.1);
}
.notes-tag-filter-item.active {
    background: rgba(99,102,241,.12);
    font-weight: 600;
}
.notes-tag-filter-item .notes-tag-delete {
    opacity: 0;
    transition: opacity .15s;
}
.notes-tag-filter-item:hover .notes-tag-delete {
    opacity: 1;
}

/* Tag dot */
.notes-tag-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}

/* Selected tag badges */
.notes-selected-tag {
    font-size: .7rem !important;
    transition: opacity .15s;
}
.notes-selected-tag:hover {
    opacity: .8;
}

/* Color swatches in tag create modal */
.notes-color-swatch {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .15s, transform .12s;
}
.notes-color-swatch:hover {
    transform: scale(1.15);
}
.notes-color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(99,102,241,.6);
}

/* Scratchpad cards */
.notes-scratchpad-card {
    width: 160px;
    border: 1px solid rgba(128,128,128,.2);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
    display: flex;
    flex-direction: column;
}
.notes-scratchpad-card:hover {
    border-color: rgba(99,102,241,.4);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.notes-scratchpad-card-header {
    padding: 4px 6px;
    background: rgba(128,128,128,.06);
    border-bottom: 1px solid rgba(128,128,128,.1);
    display: flex;
    align-items: center;
    font-size: .72rem;
}
.notes-scratchpad-card-body {
    padding: 4px;
    flex: 1;
    min-height: 60px;
    max-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: .7rem;
    word-break: break-word;
    overflow: hidden;
}
.notes-scratchpad-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}
.notes-scratchpad-card-actions {
    padding: 2px 6px;
    border-top: 1px solid rgba(128,128,128,.1);
    display: flex;
    justify-content: center;
    gap: 4px;
}

/* Quill editor theming – adapt to dark/light */
#notes-quill-editor {
    border-radius: 0 0 6px 6px;
    min-height: 300px;
}
#notes-quill-toolbar {
    border-radius: 6px 6px 0 0;
}

/* Dark theme Quill overrides */
[data-bs-theme="dark"] .ql-toolbar.ql-snow,
[data-bs-theme="dark"] .ql-container.ql-snow {
    border-color: rgba(255,255,255,.15);
}
[data-bs-theme="dark"] .ql-editor {
    color: #e2e8f0;
}
[data-bs-theme="dark"] .ql-editor.ql-blank::before {
    color: rgba(255,255,255,.35);
}
[data-bs-theme="dark"] .ql-snow .ql-stroke {
    stroke: #94a3b8;
}
[data-bs-theme="dark"] .ql-snow .ql-fill {
    fill: #94a3b8;
}
[data-bs-theme="dark"] .ql-snow .ql-picker-label {
    color: #94a3b8;
}
[data-bs-theme="dark"] .ql-snow .ql-picker-options {
    background: #1e293b;
    border-color: rgba(255,255,255,.15);
}
[data-bs-theme="dark"] .ql-toolbar.ql-snow {
    background: rgba(255,255,255,.03);
}
[data-bs-theme="dark"] .ql-toolbar.ql-snow .ql-picker-label:hover,
[data-bs-theme="dark"] .ql-toolbar.ql-snow button:hover {
    color: #6366f1;
}
[data-bs-theme="dark"] .ql-toolbar.ql-snow button:hover .ql-stroke {
    stroke: #6366f1;
}
[data-bs-theme="dark"] .ql-toolbar.ql-snow button:hover .ql-fill {
    fill: #6366f1;
}
[data-bs-theme="dark"] .ql-toolbar.ql-snow button.ql-active .ql-stroke {
    stroke: #818cf8;
}
[data-bs-theme="dark"] .ql-toolbar.ql-snow button.ql-active .ql-fill {
    fill: #818cf8;
}

/* Quill images – resizable */
.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 8px 0;
    cursor: pointer;
}
.ql-editor img.notes-img-selected {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Drag & drop overlay */
#notes-quill-editor.notes-drag-over {
    outline: 3px dashed #6366f1;
    outline-offset: -3px;
    background: rgba(99,102,241,.06);
}
#notes-quill-editor.notes-drag-over .ql-editor::after {
    content: 'Drop image here';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #6366f1;
    background: rgba(255,255,255,.7);
    pointer-events: none;
    z-index: 5;
    border-radius: 0 0 6px 6px;
}
[data-bs-theme="dark"] #notes-quill-editor.notes-drag-over .ql-editor::after {
    background: rgba(30,41,59,.8);
    color: #818cf8;
}
/* Image resize overlay */
.notes-img-resize-overlay {
    position: absolute;
    border: 2px solid #6366f1;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 10;
}
.notes-img-resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #6366f1;
    border: 1px solid #fff;
    border-radius: 2px;
    pointer-events: all;
    cursor: nwse-resize;
    z-index: 11;
}
.notes-img-resize-handle.nw { top: -5px; left: -5px; cursor: nwse-resize; }
.notes-img-resize-handle.ne { top: -5px; right: -5px; cursor: nesw-resize; }
.notes-img-resize-handle.sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.notes-img-resize-handle.se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.notes-img-size-tooltip {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: .65rem;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 12;
}

/* Notes card styling for dark theme */
[data-bs-theme="dark"] #notes-tags-card {
    border-color: rgba(255,255,255,.1);
}
[data-bs-theme="dark"] #notes-tags-card .card-header {
    background: rgba(255,255,255,.03);
    border-color: rgba(255,255,255,.1);
}
