/* ============================================================
   NOTES PAGE
   ============================================================ */
.notes-page-header { margin: 0 0 20px; }
.notes-page-title { margin: 0 0 4px; }
.notes-page-subtitle {
    font-size: 1.05rem;
    color: #6b7280;
    font-style: italic;
    margin: 0;
    line-height: 1.35;
}

/* ============================================================
   NOTES TOOLBAR
   ============================================================ */
.notes-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.notes-toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.notes-icon-btn {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
    line-height: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}
.notes-icon-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.notes-icon-btn:active { transform: translateY(0); }
.notes-icon-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    opacity: 0.75;
    transition: opacity 0.15s;
}
.notes-icon-btn:hover img { opacity: 1; }
.notes-icon-btn-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
}
.notes-icon-btn-danger:hover img {
    opacity: 1;
    filter: hue-rotate(330deg) saturate(1.5);
}

.notes-page-info {
    flex: 0 1 620px;
    min-width: 260px;
    text-align: left;
    padding: 0 0 0 4px;
    font-size: 0.85rem;
    line-height: 1.3;
    color: #4b5563;
    margin-left: 6px;
}
.notes-page-info .notes-info-list {
    margin: 0;
    padding: 0 0 0 18px;
    list-style-position: outside;
    text-align: left;
    line-height: 1.3;
}
.notes-page-info .notes-info-list li {
    margin: 0 0 2px;
    padding: 0;
    line-height: 1.3;
}
.notes-page-info .notes-info-list li:last-child { margin-bottom: 0; }
.notes-page-info .notes-info-list li::marker {
    color: var(--primary-color);
}
html[dir="rtl"] .notes-page-info {
    text-align: right;
    padding: 0 4px 0 0;
    margin-left: 0;
    margin-right: 6px;
}
html[dir="rtl"] .notes-page-info .notes-info-list {
    padding: 0 18px 0 0;
    text-align: right;
}

/* ============================================================
   NOTE MODAL
   ============================================================ */
.note-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.note-modal[hidden] { display: none; }
.note-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    animation: fadeIn 0.2s ease;
    backdrop-filter: blur(2px);
}
.note-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: noteModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes noteModalIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.note-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.note-modal-header strong {
    font-size: 1.1rem;
    color: #111827;
}
.note-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.note-modal-close:hover { color: #374151; }
.note-modal-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 12px;
    font-weight: 600;
}
.note-modal-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.note-modal-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.note-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.btn-note {
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    border: none;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
}
.btn-note:active { transform: scale(0.97); }
.btn-note-save { background: #4f46e5; color: #fff; }
.btn-note-save:hover { background: #4338ca; }
.btn-note-delete { background: #ef4444; color: #fff; }
.btn-note-delete:hover { background: #dc2626; }
.btn-note-cancel { background: #e5e7eb; color: #374151; }
.btn-note-cancel:hover { background: #d1d5db; }

/* ============================================================
   NOTES LIST
   ============================================================ */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.note-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 14px 18px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.note-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 10px;
    flex-wrap: wrap;
}
.note-card-meta {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
}
.note-card-meta a {
    color: var(--primary-color);
    text-decoration: none;
}
.note-card-meta a:hover { text-decoration: underline; }
.note-card-date {
    font-size: 0.75rem;
    color: #9ca3af;
}
.note-card-text {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.note-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}
.note-card-actions button {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.15s;
    font-family: inherit;
}
.note-card-actions button:hover {
    background: #f9fafb;
    color: #374151;
}
.note-card-actions button.note-delete-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* ============================================================
   NOTE-CLICKABLE
   ============================================================ */
.note-clickable {
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    outline: none;
}
.note-clickable:hover,
.note-clickable:focus-visible {
    background: rgba(79, 70, 229, 0.12);
}
.note-clickable.has-note {
    color: #b45309;
    font-weight: 600;
}
.note-clickable.subject-number-badge:hover,
.note-clickable.chapter-number-badge:hover {
    background: var(--primary-color);
    transform: scale(1.08);
    filter: brightness(1.15);
}

/* Ronde badges voor subject-number-badge en subject-block-number */
.note-clickable.subject-number-badge,
.note-clickable.subject-block-number {
    border-radius: 50%;
    padding: 0;
    min-width: 34px;
    height: 34px;
}
.note-clickable.subject-block-number {
    min-width: 26px;
    height: 26px;
}

/* Chapter number badge: bij een notitie geen oranje tekst maar een oranje ring */
.note-clickable.chapter-number-badge.has-note {
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 0 1px #f59e0b;
}

.article-number.note-clickable {
    padding: 0 4px;
}
.note-admin-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-left: 6px;
    padding: 3px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
    vertical-align: middle;
    flex-shrink: 0;
}
.note-admin-edit:hover {
    opacity: 1;
    background: #f3f4f6;
}
.note-admin-edit-icon {
    height: 14px;
    width: auto;
    display: block;
}
html[dir="rtl"] .note-admin-edit {
    margin-left: 0;
    margin-right: 6px;
}

/* ============================================================
   SOURCE EDIT MODAL (frontend, admin-only)
   ============================================================ */
.source-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.source-edit-modal[hidden] { display: none; }
.source-edit-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}
.source-edit-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 640px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: noteModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.source-edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.source-edit-modal-header strong {
    font-size: 1.1rem;
    color: #111827;
}
.source-edit-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #9ca3af;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.source-edit-modal-close:hover { color: #374151; }
.source-edit-modal-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 14px;
    font-weight: 600;
}

.source-edit-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
    flex-wrap: wrap;
}
.source-edit-tab {
    padding: 6px 14px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.source-edit-tab:hover { background: #f3f4f6; color: #374151; }
.source-edit-tab.active { background: #4f46e5; color: #fff; }

.source-edit-pane { display: none; }
.source-edit-pane.active { display: block; }

.source-edit-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin: 10px 0 4px;
}
.source-edit-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}
.source-edit-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.source-edit-footnote { font-size: 0.9rem; min-height: 70px; }

.source-edit-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.source-edit-status {
    flex: 1;
    font-size: 0.85rem;
    color: #6b7280;
    min-height: 1em;
}

@media (max-width: 600px) {
    .source-edit-modal-content { padding: 18px; }
    .source-edit-modal-actions { justify-content: stretch; }
    .source-edit-modal-actions .btn-note { flex: 1; }
    .source-edit-status { flex: 1 1 100%; order: -1; text-align: center; }
}