/* ============================================================================ */
/* NOTE MODAL */
/* ============================================================================ */

.note-modal {
    display: none;
    position: fixed;
    background: var(--bg-card);
    z-index: calc(var(--z-layer-menu) + 2);
    flex-direction: column;
}

.note-modal.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.note-modal.fullscreen {
    left: 68px;
    right: 0;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    transform: none;
    transition: opacity var(--transition-smooth);
    box-shadow: none;
}

.note-modal.fullscreen.visible {
    transform: none;
}

/* Expanded mode - shows both left columns (main nav + notes panel) */
/* Position: 68px sidebar + 220px notes panel = 288px */
.note-modal.expanded {
    left: 288px;
    right: 0;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    max-width: none;
    border-radius: 0;
    transform: none;
    box-shadow: none;
    border: none;
    border-left: 1px solid var(--border-light);
    transition: left var(--duration-normal) var(--ease-in-out),
                opacity var(--transition-smooth);
}

.note-modal.expanded.visible {
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.note-modal-header {
    display: flex;
    align-items: flex-start;
    padding: var(--space-7) var(--space-7) var(--space-5);
    gap: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.note-modal.expanded .note-modal-header {
    padding-top: 36px;
}

.note-modal-title-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.note-modal-title {
    width: 100%;
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    border: none;
    outline: none;
    background: transparent;
    padding: 0;
}

.note-modal-title:empty::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
    pointer-events: none;
}

.note-modal-title br {
    display: none;
}

.note-modal-title * {
    display: inline;
}

.note-modal-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

.note-modal-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* Note Modal Content - Two Column Layout for Meeting Notes */
.note-modal-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.note-modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 28px;
    overflow-y: auto;
    min-height: 390px;
}

.note-modal.has-sidebar .note-modal-main {
    /* Main content shrinks when sidebar is visible */
}

/* Note Modal Sidebar (for meeting notes) */
.note-modal-sidebar {
    width: 280px;
    padding: var(--space-5);
    background: var(--bg-main);
    border-left: 1px solid var(--border-light);
    overflow-y: auto;
    display: none;
    flex-direction: column;
    gap: var(--space-5);
}

.note-modal.has-sidebar .note-modal-sidebar {
    display: flex;
}

.note-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.note-sidebar-label {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
}

/* Meeting Info in Sidebar */
.note-meeting-title {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.note-meeting-datetime {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* View Event Button in Sidebar */
.note-view-event-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.note-view-event-btn:hover {
    background: var(--bg-hover);
    border-color: #357ABD;
    color: #357ABD;
}

.note-view-event-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    flex-shrink: 0;
}

/* Attendees in Sidebar */
.note-attendees-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.note-attendee {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.note-attendee .attendee-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.note-attendee .attendee-name {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attendee-rsvp-status {
    margin-left: auto;
    font-size: 0.85em;
    font-weight: 700;
    line-height: 1;
}

.attendee-rsvp-summary {
    font-size: 0.8em;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 6px;
}

/* Context (Area/Project) in Sidebar */
.note-context-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.note-context-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.note-context-item svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-tertiary);
    flex-shrink: 0;
}

.note-editor {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--text-primary);
    min-height: 300px;
    padding-bottom: 200px;
    outline: none;
}

/* File drag-and-drop insertion line — a thin horizontal indicator that tracks
   the cursor between blocks while a file is being dragged over an editor.
   Tells the user "your file lands HERE" precisely. Replaces the old all-editor
   outline which only said "this is a drop zone" (information they already had).
   Position is set inline by EditorFileDrop.showInsertionLine in viewport coords
   plus scroll offset; visibility is toggled by the .visible class. */
.editor-drop-insertion-line {
    position: absolute;
    height: 2px;
    background: var(--accent-blue);
    border-radius: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease-in-out);
    z-index: var(--z-layer-modal);
}
.editor-drop-insertion-line.visible {
    opacity: 1;
}
/* Leading dot reads as an insertion marker, distinguishing this from a
   horizontal divider/separator. */
.editor-drop-insertion-line::before {
    content: '';
    position: absolute;
    left: -4px;
    top: -3px;
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: var(--radius-circle);
}

/* Ensure there's always clickable space after content for cursor placement */
.note-editor::after {
    content: '';
    display: block;
    height: 150px;
    width: 100%;
}

.note-editor ul,
.note-editor ol {
    margin: 0.5em 0;
    padding-left: var(--editor-list-indent);
}

.note-editor ul {
    list-style-type: disc;
}

.note-editor ul ul {
    list-style-type: circle;
}

.note-editor ul ul ul {
    list-style-type: square;
}

.note-editor ol {
    list-style-type: decimal;
}

.note-editor ol ol {
    list-style-type: lower-alpha;
}

.note-editor ol ol ol {
    list-style-type: lower-roman;
}

.note-editor ul ul,
.note-editor ul ol,
.note-editor ol ul,
.note-editor ol ol {
    margin: 0.25em 0;
}

.note-editor li {
    margin: 0.25em 0;
}

.note-editor blockquote {
    border-left: 3px solid var(--accent-blue);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.note-editor h1,
.note-editor h2,
.note-editor h3 {
    font-weight: 600;
    margin: 16px 0 8px 0;
}

.note-editor h1 {
    font-size: 1.75em;
}

.note-editor h2 {
    font-size: 1.5em;
}

.note-editor h3 {
    font-size: 1.25em;
}

.note-editor hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 16px 0;
}

.note-editor:empty::before {
    content: 'Start writing...';
    color: var(--text-tertiary);
}

/* Hide bullets for list items containing checkboxes */
.note-editor li:has(input[type="checkbox"]) {
    list-style: none;
}

/* Table styling */
.note-editor table,
.task-note-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

.note-editor table th,
.note-editor table td,
.task-note-editor table th,
.task-note-editor table td {
    padding: var(--space-3) var(--space-3);
    text-align: left;
    border: 1px solid var(--border-light);
}

.note-editor table th,
.task-note-editor table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.note-editor table tbody tr:hover,
.task-note-editor table tbody tr:hover {
    background: var(--bg-hover);
}
