/* ============================================
   MDV Comments System — Styles
   Uses CSS variables from theme.css
   ============================================ */

.comment-highlight {
	background-color: var(--warning-muted);
	color: var(--text-primary);
	cursor: pointer;

	padding: 1px 0;
	border-radius: 2px;
	transition: background-color var(--transition-fast);
}

.comment-highlight:hover {
	background-color: rgba(245, 158, 11, 0.25);
}

.comment-highlight-flash {
	animation: comment-flash 0.9s ease-out;
}

@keyframes comment-flash {
	0% {
		background-color: var(--warning);
	}

	40% {
		background-color: rgba(245, 158, 11, 0.4);
	}

	100% {
		background-color: var(--warning-muted);
	}
}

.comment-bubble-btn {
	position: fixed;
	z-index: 100;
	display: none;
	background: var(--accent);
	color: white;
	border: none;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: var(--shadow-md);
	transition: transform 0.15s, box-shadow 0.15s;
	font-family: var(--font-sans);
}

.comment-bubble-btn:hover {
	transform: scale(1.05);
	box-shadow: var(--shadow-lg);
}

.comment-panel {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 90;
	background: var(--bg-surface);
	border-top: 1px solid var(--border-default);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
	padding: 16px 20px;
	transform: translateY(100%);
	transition: transform var(--transition-slow);
}

.comment-panel.visible {
	transform: translateY(0);
}

.comment-panel-quote {
	font-size: 12px;
	color: var(--text-secondary);
	margin-bottom: 8px;
	padding: 6px 10px;
	border-left: 3px solid var(--warning);
	background: var(--warning-muted);
	border-radius: 0 6px 6px 0;
	max-height: 60px;
	overflow-y: auto;
}

.comment-panel-textarea {
	width: 100%;
	min-height: 60px;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid var(--border-default);
	border-radius: var(--radius-md);
	font-family: var(--font-sans);
	font-size: 14px;
	resize: vertical;
	outline: none;
	transition: border-color var(--transition-fast);
	background: var(--bg-surface);
	color: var(--text-primary);
}

.comment-panel-textarea:focus {
	border-color: var(--accent);
}

.comment-panel-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 10px;
}

.comment-tooltip {
	position: fixed;
	z-index: 95;
	max-width: 280px;
	background: var(--bg-surface-raised);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-lg);
	padding: 12px 14px;
	box-shadow: var(--shadow-lg);
	font-family: var(--font-sans);
	display: none;
}

.comment-tooltip-text {
	font-size: 13px;
	color: var(--text-primary);
	line-height: 1.5;
	white-space: pre-wrap;
	word-break: break-word;
	padding-right: 16px;
}

.comment-tooltip-meta {
	font-size: 10px;
	color: var(--text-tertiary);
	margin-top: 6px;
}

.comment-tooltip-delete {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	color: var(--text-tertiary);
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
	padding: 2px 4px;
}

.comment-tooltip-delete:hover {
	color: var(--danger);
}

.comment-count-badge {
	background: var(--warning);
	color: #1a1a1a;
	font-size: 10px;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 10px;
	margin-left: 4px;
}

.comment-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(80px);
	z-index: 200;
	background: var(--bg-surface-raised);
	color: var(--text-primary);
	padding: 10px 20px;
	border-radius: var(--radius-lg);
	font-size: var(--font-size-sm);
	font-family: var(--font-sans);
	font-weight: 500;
	box-shadow: var(--shadow-lg);
	border: 1px solid var(--border-default);
	transition: transform var(--transition-slow);
	pointer-events: none;
}

.comment-toast.visible {
	transform: translateX(-50%) translateY(0);
}

/* Sidebar comment list items */
.sidebar-comment-item {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 8px 10px;
	border-radius: var(--radius-md);
	cursor: pointer;
	transition: background-color var(--transition-fast);
	border: 1px solid transparent;
}

.sidebar-comment-item:hover {
	background: var(--accent-muted);
	border-color: var(--accent);
}

.sidebar-comment-item-quote {
	font-size: 10px;
	color: var(--text-secondary);
	font-style: italic;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	border-left: 2px solid var(--warning);
	padding-left: 6px;
}

.sidebar-comment-item-text {
	font-size: 12px;
	color: var(--text-primary);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.sidebar-comment-item-meta {
	font-size: 10px;
	color: var(--text-tertiary);
}

/* Save dropdown */
.save-dropdown-menu {
	position: absolute;
	top: 100%;
	right: 0;
	margin-top: 4px;
	min-width: 220px;
	background: var(--bg-surface-raised);
	border: 1px solid var(--border-default);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	z-index: 80;
	display: none;
	overflow: hidden;
}

.save-dropdown-menu.visible {
	display: block;
}

.save-dropdown-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	text-align: left;
	padding: 10px 14px;
	font-size: 13px;
	color: var(--text-primary);
	border: none;
	background: none;
	cursor: pointer;
	transition: background-color var(--transition-fast);
	font-family: var(--font-sans);
}

.save-dropdown-item:hover {
	background: var(--bg-surface-hover);
}

.save-dropdown-item svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	color: var(--text-secondary);
}

.save-dropdown-divider {
	height: 1px;
	background: var(--border-subtle);
}