/* Kumbukum — App Styles */

:root {
	--bs-body-font-size: .93rem;
	--bs-badge-font-weight: 400;
	--sidebar-bg: #f8f9fa;
	--chat-bg: #f8f9fa;
	--tag-color: #495057;
}

body {
	height: 100vh;
}

body:has(.sidebar) {
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

b, 
strong {
	font-weight: 500;
}

small,
.small {
	font-size: 0.8rem;
}

.list-group-item-action {
	color: initial !important;
}

.fs-7 {
	font-size: 0.7rem;
}

.fs-9 {
	font-size: 0.9rem;
}

.card {
	border-radius: 0.5rem;
}

.bg-hover-light:hover {
	background-color: var(--bs-light) !important;
	cursor: pointer;
}

.sidebar {
	overflow-y: auto;
	height: 100%;
}

#main-content {
	overflow-y: auto;
	height: 100%;
}

#chat-sidebar {
	overflow-y: hidden;
	height: 100%;
}

.chat-sidebar {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* Chat messages */
.chat-message {
	margin-bottom: 0.75rem;
	padding: 0.5rem 0.75rem;
	border-radius: 0.5rem;
	max-width: 90%;
}

.chat-message.user {
	background: #0d6efd;
	color: white;
	margin-left: auto;
}

.chat-message.assistant {
	background: #e9ecef;
	color: #212529;
}

/* Chat thinking indicator */
.chat-thinking span {
	display: inline-block;
	animation: chatBlink 1.4s infinite;
	font-size: 1.25rem;
	line-height: 1;
}
.chat-thinking span:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatBlink {
	0%, 20% { opacity: 0.2; }
	50% { opacity: 1; }
	80%, 100% { opacity: 0.2; }
}

/* Chat history items */
.chat-history-item {
	background: #f8f9fa;
	border: 1px solid #dee2e6;
	transition: background 0.15s;
}

.chat-history-item:hover {
	background: #e9ecef;
}

/* Chat results panel */
#chat-results-panel {
	border: 1px solid #dee2e6;
	border-radius: 0.5rem;
	padding: 1rem;
	background: #fafbfc;
}

#chat-results-list .card {
	border-left: 3px solid #0d6efd;
	transition: box-shadow 0.15s;
}

#chat-results-list .card:hover {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Note list items */
.note-item {
	cursor: pointer;
	transition: background 0.15s;
}

.note-item:hover {
	background: #f0f0f0;
}

.memory-item {
	cursor: pointer;
	transition: background 0.15s;
}

.memory-item:hover {
	background: #f0f0f0;
}

/* Project list */
.project-item {
	padding: 0;
}

.project-item-name {
	font-weight: 600;
	margin-left: 0.5rem;
}

.project-color {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	display: inline-block;
}

/* Section links in sidebar */
.section-link {
	display: flex;
	font-size: 0.85rem;
	color: var(--text);
	text-decoration: none;
}

.section-count {
	margin-left: auto;
	font-size: 0.75rem;
	color: #6c757d;
	font-weight: 500;
}

/* URL cards */
.url-card .og-image,
.url-item .og-image {
	max-height: 120px;
	object-fit: cover;
}

.og-image-thumb {
	width: 80px;
	height: 80px;
	object-fit: cover;
}

/* Memory tags */
.tag-badge {
	font-size: 0.65rem;
}
.text-bg-secondary {
	color: var(--tag-color) !important;
	background-color: #dfdfdf !important;
}
.btn-close-white {
	--bs-btn-close-filter: var(--tag-color) !important;
}

/* Editor container */
#editor-container .ProseMirror {
	min-height: 400px;
	padding: 1rem;
	border: 1px solid #dee2e6;
	border-radius: 0.375rem;
	outline: none;
}

#editor-container .ProseMirror:focus {
	border-color: #86b7fe;
	box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#editor-container .ProseMirror p.is-editor-empty:first-child::before,
#memory-editor-container .ProseMirror p.is-editor-empty:first-child::before,
#rm-note-editor .ProseMirror p.is-editor-empty:first-child::before,
#rm-memory-editor .ProseMirror p.is-editor-empty:first-child::before {
	content: attr(data-placeholder);
	color: #adb5bd;
	float: left;
	height: 0;
	pointer-events: none;
}

#memory-editor-container .ProseMirror {
	min-height: 400px;
	padding: 1rem;
	border: 1px solid #dee2e6;
	border-radius: 0.375rem;
	outline: none;
}

#memory-editor-container .ProseMirror:focus {
	border-color: #86b7fe;
	box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#rm-note-editor .ProseMirror,
#rm-memory-editor .ProseMirror {
	min-height: 300px;
	padding: 1rem;
	border: 1px solid #dee2e6;
	border-radius: 0.375rem;
	outline: none;
}

#rm-note-editor .ProseMirror:focus,
#rm-memory-editor .ProseMirror:focus {
	border-color: #86b7fe;
	box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.logo-form img {
	max-height: 80px;
}

.navbar-brand img {
	max-height: 20px;
	margin-left: .3rem;
}

/* Ghost-style source search field */
.source-search-wrap {
	position: relative;
}

.source-search-wrap .source-search-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: #adb5bd;
	font-size: 14px;
	pointer-events: none;
}

.source-search-wrap input {
	padding-left: 36px;
	border: 1px solid #e1e5e9;
	border-radius: 6px;
	background: #f9fafb;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.source-search-wrap input:focus {
	background: #fff;
	border-color: #15171a;
	box-shadow: none;
}

.source-dropdown {
	border: 1px solid #e1e5e9;
	border-radius: 6px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
	background: #fff;
}

.source-dropdown .list-group-item.active {
	background-color: var(--bs-list-group-action-hover-bg, rgba(0,0,0,.075));
	color: inherit;
	border-color: var(--bs-list-group-border-color);
}

#chat-result-modal .modal-body {
	overflow: visible;
}

/* Batch action toolbar */
#batch-toolbar {
	padding: 0.25rem 0;
}

.batch-actions {
	padding: 0;
}

.batch-cb-wrap {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.batch-cb {
	cursor: pointer;
}

/* ---- Drop overlay for file import ---- */

#notes-drop-zone {
	min-height: 200px;
}

.drop-overlay {
	position: absolute;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(108, 117, 125, 0.35);
	border-radius: 0.5rem;
}

.drop-overlay-card {
	background: #fff;
	border-radius: 0.75rem;
	padding: 2.5rem 4rem;
	text-align: center;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.drop-overlay-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 1rem;
	border-radius: 50%;
	background: rgba(253, 126, 20, 0.1);
	display: flex;
	align-items: center;
	justify-content: center;
}

.drop-overlay-icon i {
	font-size: 1.75rem;
	color: #fd7e14;
}

/* FilePond — hidden by default, slides in during uploads */
#notes-drop-zone .filepond--root {
	height: 0;
	overflow: hidden;
	opacity: 0;
	transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease;
	margin-bottom: 0;
}

#notes-drop-zone .filepond--root.filepond--active {
	height: auto;
	overflow: visible;
	opacity: 1;
	margin-bottom: 1rem;
}

/* Preview / Edit tab containers */
.preview-container {
	overflow-y: auto;
	background: #fff;
	word-wrap: break-word;
}

.preview-container img {
	max-width: 100%;
	height: auto;
}

.preview-container pre {
	background: #f8f9fa;
	padding: 0.75rem;
	border-radius: 0.375rem;
	overflow-x: auto;
}

.preview-container code {
	font-size: 0.875em;
}

.preview-container blockquote {
	border-left: 3px solid #dee2e6;
	padding-left: 1rem;
	color: #6c757d;
}

/* ---- Initials avatar ---- */
.avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	font-weight: 600;
	text-transform: uppercase;
	color: #fff;
	flex-shrink: 0;
	line-height: 1;
	user-select: none;
}

.avatar-xs {
	width: 24px;
	height: 24px;
	font-size: 0.625rem;
}

.avatar-sm {
	width: 32px;
	height: 32px;
	font-size: 0.75rem;
}

.avatar-md {
	width: 40px;
	height: 40px;
	font-size: 0.875rem;
}

.avatar-lg {
	width: 64px;
	height: 64px;
	font-size: 1.25rem;
}

.avatar-xl {
	width: 96px;
	height: 96px;
	font-size: 1.75rem;
}

/* Chat message with avatar */
.chat-msg-row {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.chat-msg-row.user {
	flex-direction: row-reverse;
}

.chat-msg-row .chat-message {
	margin-bottom: 0;
}

/* SweetAlert2 — prevent body height override from collapsing flex layout.
   Double-class selector raises specificity above SweetAlert2's injected <style>,
   which otherwise wins when both use !important at equal specificity. */
body.swal2-height-auto.swal2-height-auto {
	height: 100vh !important;
}

/* SweetAlert2 — keep the overlay from breaking body flex layout */
body:has(.sidebar) > .swal2-container {
	position: fixed !important;
}

/* SweetAlert2 — navbar must stay above the overlay so the dropdown still works */
body.swal2-shown .navbar {
	z-index: 1070;
}

/* SweetAlert2 — after dialog closes the leftover container must not block clicks */
body:not(.swal2-shown) > .swal2-container {
	pointer-events: none !important;
}

/* SweetAlert2 — confirm button always on the right */
.swal2-actions {
	flex-direction: row-reverse;
}

/* SweetAlert2 — form styling */
.swal2-input {
	height: auto !important;
	padding: .375rem .75rem !important;
	font-size: .875rem !important;
	margin: .15em 1em !important;
	width: calc(100% - 2em) !important;
}
.swal2-html-container label.swal-label {
	display: block;
	text-align: left;
	font-size: .8rem;
	font-weight: 600;
	color: #495057;
	margin: .6rem 1em .1rem;
}
.swal2-html-container .swal-hint {
	display: block;
	text-align: left;
	font-size: .75rem;
	color: #868e96;
	margin: .05rem 1em 0;
}
.swal2-html-container .input-group {
	margin: .15em 1em;
	width: calc(100% - 2em);
}
.swal2-html-container .input-group .form-control {
	font-size: .875rem;
}
