/* User-configurable font styles for main content area */

/* Sources heading - use sans font */
.section-header {
    font-family: var(--font-sans) !important;
}

/* Source labels - use sans font */
#sources-content span[data-source-key] {
    font-family: var(--font-sans) !important;
}

#sources-content .text-sm {
    font-family: var(--font-sans) !important;
}

/* Control text in editor - use serif font */
#editor .ql-editor,
#primary-text-container .ql-editor {
    font-family: var(--font-serif) !important;
}

/* Apparatus (Variants) section heading */
#apparatus-container h2,
#apparatus-container .section-header {
    font-family: var(--font-sans) !important;
}

/* Apparatus list base font */
#apparatus-list {
    font-family: var(--font-sans);
}

/* Apparatus note structure:
   Typically: <segment>. <lemma> ] <variant> <sources>
   Where segment and lemma should be mono, variant serif, sources sans
*/

/* Bold text at start is usually segment number - monospace */
#apparatus-list li b:first-child,
#apparatus-list li strong:first-child {
    font-family: var(--font-mono) !important;
}

/* Italic text in apparatus (variants) - serif */
#apparatus-list li i,
#apparatus-list li em {
    font-family: var(--font-serif) !important;
}

/* Default apparatus text (sources, etc) - sans */
#apparatus-list li {
    font-family: var(--font-sans) !important;
}

/* Sigla (source abbreviations) in apparatus - sans */
#apparatus-list li .sigla,
#apparatus-list .sigla {
    font-family: var(--font-sans) !important;
}

/* Dynamic Quill Toolbar Styles */
.dynamic-quill-toolbar {
    position: absolute;
    z-index: 9999;
    background: white;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px;
}

.dark .dynamic-quill-toolbar {
    background: #27272a;
    border-color: #3f3f46;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Small caps formatting for Quill editor */
.ql-small-caps {
    font-variant: small-caps;
}

/* Dirty cell indicator - subtle border highlight */
.collation-cell.is-dirty {
    border-left-color: #3b82f6 !important;
    border-left-width: 3px !important;
}

.dark .collation-cell.is-dirty {
    border-left-color: #60a5fa !important;
}

/* Ensure collation cell content is editable */
.collation-cell-content {
    display: block;
    width: 100%;
    height: 100%;
}

/* Remove padding from collation cells */
.collation-cell {
    padding: 0 !important;
    vertical-align: top;
}

/* Override Quill's default border */
.collation-cell .ql-container.ql-snow,
.collation-cell-content .ql-container.ql-snow,
.ql-container.ql-snow {
    border: 0 !important;
}

.collation-cell-content .ql-container {
    border: none !important;
    background: transparent;
    height: 100%;
    font-size: inherit !important;
}

.collation-cell-content .ql-editor {
    padding: 12px 16px !important;
    font-family: var(--font-serif);
    font-size: 1.0625rem !important;
    line-height: 1.6 !important;
    background: transparent;
    min-height: auto;
    height: 100%;
}

/* Remove default paragraph margins in Quill editor */
.collation-cell-content .ql-editor p {
    margin: 0 !important;
}

/* Ensure Quill editor is focused state is subtle */
.collation-cell-content .ql-editor:focus {
    outline: none;
}

/* Add subtle focus indication to the cell itself */
.collation-cell:has(.ql-editor:focus) {
    background-color: rgba(59, 130, 246, 0.05);
}

.dark .collation-cell:has(.ql-editor:focus) {
    background-color: rgba(96, 165, 250, 0.1);
}

/* Style for empty cells - make them interactive */
.collation-cell-empty {
    display: block;
    padding: 12px 16px;
    color: #a1a1aa;
    font-style: italic;
    transition: background-color 0.15s ease;
}

.dark .collation-cell-empty {
    color: #71717a;
}

.collation-cell:has(.collation-cell-empty):hover {
    background-color: rgba(59, 130, 246, 0.03);
}

.dark .collation-cell:has(.collation-cell-empty):hover {
    background-color: rgba(96, 165, 250, 0.05);
}

/* Context Menu Styles */
.collation-context-menu {
    position: absolute;
    z-index: 10000;
    background: white;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    padding: 4px 0;
}

.dark .collation-context-menu {
    background: #27272a;
    border-color: #3f3f46;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #18181b;
    transition: background-color 0.15s ease;
}

.dark .context-menu-item {
    color: #e4e4e7;
}

.context-menu-item:hover {
    background-color: #f4f4f5;
}

.dark .context-menu-item:hover {
    background-color: #3f3f46;
}

.context-menu-delete {
    color: #dc2626;
}

.dark .context-menu-delete {
    color: #f87171;
}

.context-menu-delete:hover {
    background-color: #fef2f2;
}

.dark .context-menu-delete:hover {
    background-color: #3f1f1f;
}

.context-menu-item svg {
    flex-shrink: 0;
}
