/* css/styles.css - Application Custom Animations & Scrollbars */

/* Custom Scrollbar for Narrow Panes */
.narrow-scroll::-webkit-scrollbar { 
    width: 4px; 
}
.narrow-scroll::-webkit-scrollbar-track { 
    background: transparent; 
}
.narrow-scroll::-webkit-scrollbar-thumb { 
    background: #cbd5e1; 
    border-radius: 4px; 
}
.narrow-scroll::-webkit-scrollbar-thumb:hover { 
    background: #94a3b8; 
}

/* Row/post action icons (copy, edit, move, archive, trash): small and grey until hovered */
.action-icon-btn {
    padding: 1px 2px;
    font-size: 10px;
    line-height: 1;
    filter: grayscale(1);
    opacity: 0.45;
    transition: opacity 0.15s ease, filter 0.15s ease;
}
.action-icon-btn:hover {
    filter: none;
    opacity: 1;
}

/* Search: the result ↑ ↓ / Enter is on */
.search-hit.search-active { border-color: #A60404; background: #fff; box-shadow: 0 0 0 1px #A60404; }

/* Reactions under a thread update: chips (emoji + count), the add button and its picker */
.react-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0 6px;
    height: 20px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 12px;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.react-chip span { font-size: 10px; font-weight: 700; color: #6b7280; }
.react-chip:hover { border-color: #9ca3af; background: #fff; }
.react-chip.mine { border-color: #15426D; background: #eef2f7; }
.react-chip.mine span { color: #15426D; }
.react-add-btn {
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    border: 1px dashed #d1d5db;
    font-size: 12px;
    line-height: 1;
    color: #9ca3af;
    opacity: 0.6;
    transition: opacity 0.15s ease, color 0.15s ease;
}
.react-add-btn sup { font-size: 8px; font-weight: 700; }
.react-add-btn:hover { opacity: 1; color: #15426D; border-color: #9ca3af; }
.react-picker {
    display: inline-flex;
    gap: 1px;
    padding: 1px 3px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.react-pick {
    font-size: 15px;
    line-height: 1;
    padding: 2px 3px;
    border-radius: 6px;
    transition: transform 0.1s ease, background 0.1s ease;
}
.react-pick:hover { background: #f3f4f6; transform: scale(1.2); }

/* Thread formatting toolbar (bold, italic, size...) */
.fmt-btn {
    min-width: 22px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 18px;
    color: #4b5563;
}
.fmt-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.fmt-btn.active {
    background: #dbeafe;
    color: #111827;
}

/* Thread editor: formatting shows as you type */
.rt-editor {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-y: auto;
    outline: none;
    cursor: text;
}
.rt-editor:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}
.rt-editor ul { list-style: disc; padding-left: 1.25rem; }
.rt-editor font[size="1"], .rt-editor font[size="2"] { font-size: 10px; }
.rt-editor font[size="4"], .rt-editor font[size="5"] { font-size: 16px; }
.rt-editor font[size="6"], .rt-editor font[size="7"] { font-size: 20px; font-weight: 700; }
.rt-chip {
    display: inline-block;
    padding: 0 4px;
    margin: 0 1px;
    border-radius: 4px;
    background: #eef2ff;
    color: #1e3a5f;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    user-select: all;
    cursor: pointer;
}
.rt-chip.rt-link { position: relative; padding-right: 14px; }
.rt-chip.rt-link:hover { text-decoration: underline; }
.rt-chip-edit {
    position: absolute;
    top: -3px;
    right: 0;
    font-size: 8px;
    line-height: 1;
    opacity: 0.45;
    filter: grayscale(1);
}
.rt-chip-edit:hover { opacity: 1; filter: none; }
.rt-chip.rt-check { background: transparent; padding: 0; font-size: 14px; font-weight: 400; }

/* Dragging tasks (js/task-drag.js): the row following the pointer, where it will land, and the
   "hold still to group" wiggle */
.task-drag-ghost {
    position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none;
    opacity: 0.92; box-shadow: 0 10px 25px rgba(11, 26, 48, 0.25); border-radius: 6px; overflow: visible;
    transition: transform 0.12s ease-out;
}
.task-drag-ghost > .task-item { border-radius: 6px; background: #fff; }
.task-drag-ghost.task-drag-merged { opacity: 0.85; transition: transform 0.18s ease-out; }
.task-drag-label {
    position: absolute; left: 12px; top: 100%; margin-top: 4px; white-space: nowrap;
    background: #15426D; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.task-drag-label.hidden { display: none; }
.task-drag-source { opacity: 0.35; }
.task-drop-line { position: fixed; z-index: 999; height: 3px; background: #A60404; border-radius: 2px; pointer-events: none; }
.task-drop-line.hidden { display: none; }
.task-drop-sub { outline: 2px dashed #15426D; outline-offset: -2px; background: #eef2f7 !important; }
.task-drop-group { outline: 2px dashed #15426D; outline-offset: -2px; }
.task-merge-target { outline: 2px solid #A60404; outline-offset: -2px; background: #fff5f5 !important; }
@keyframes task-wiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-0.8deg); }
    40% { transform: rotate(0.8deg); }
    60% { transform: rotate(-0.5deg); }
    80% { transform: rotate(0.5deg); }
}
.task-wiggle { animation: task-wiggle 0.45s ease-in-out; }
/* While something is being dragged, the notes at the bottom (e.g. "Moved … · Undo") don't block the drop */
body.is-dragging #toast-container, body.is-dragging #toast-container * { pointer-events: none !important; }
/* …and rows don't pop up their hover icons while something is dragged over them */
body.is-dragging .action-icon-btn, body.is-dragging [data-action="toggle-project"] { visibility: hidden; }
