/* Simple Editor Container */
.simple-editor-container {
	display: flex;
	flex-direction: column;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	overflow: hidden;
	background: #ffffff;
	height: 100%;
}

/* Title */
.simple-editor-title {
	font-size: 1rem;
	font-weight: 700;
	padding: 0.5rem;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

/* Toolbar - Single line with horizontal scroll */
.simple-editor-toolbar {
	display: flex;
	flex-wrap: nowrap;
	gap: 2px;
	padding: 2px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	align-items: center;
	overflow-x: auto;
	flex-shrink: 0;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.simple-editor-toolbar::-webkit-scrollbar {
	display: none;
}

.simple-editor-toolbar-group {
	display: flex;
	gap: 2px;
	flex-shrink: 0;
}

.simple-editor-toolbar-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: #475569;
	cursor: pointer;
	transition: all 0.15s ease;
	flex-shrink: 0;
}

.simple-editor-toolbar-btn:hover:not(.disabled),
.simple-editor-toolbar-btn.active {
	background: #e2e8f0;
	color: #1e293b;
}

.simple-editor-toolbar-btn.disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Tooltip */
.simple-editor-tooltip-wrapper {
	position: relative;
	display: inline-flex;
}

.simple-editor-tooltip {
	padding: 4px 8px;
	background: hsl(var(--primary, 222.2 47.4% 11.2%));
	color: hsl(var(--primary-foreground, 210 40% 98%));
	font-size: 0.75rem;
	font-weight: 500;
	border-radius: 4px;
	white-space: nowrap;
	z-index: 99999;
	pointer-events: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.simple-editor-tooltip::before {
	content: '';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 4px solid transparent;
	border-bottom-color: hsl(var(--primary, 222.2 47.4% 11.2%));
}

/* Dark Theme Tooltip */
.dark .simple-editor-tooltip {
	background: #e2e8f0;
	color: #1e293b;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark .simple-editor-tooltip::before {
	border-bottom-color: #e2e8f0;
}

.simple-editor-toolbar-divider {
	width: 1px;
	height: 24px;
	background: #e2e8f0;
	margin: 0 6px;
	flex-shrink: 0;
}

/* Editor Content */
.simple-editor-content {
	flex: 1;
	overflow-y: auto;
}

.simple-editor-content .ProseMirror {
	padding: 1rem;
	min-height: var(--editor-min-height, 200px);
	outline: none;
	font-size: 0.875rem;
	line-height: 1.625;
}

.simple-editor-content .ProseMirror:focus {
	outline: none;
}

/* Placeholder */
.simple-editor-content .ProseMirror p.is-editor-empty:first-child::before {
	content: attr(data-placeholder);
	float: left;
	color: #94a3b8;
	pointer-events: none;
	height: 0;
}

/* Typography */
.simple-editor-content .ProseMirror h1 {
	font-size: 1.875rem;
	font-weight: 700;
	margin: 1rem 0 0.5rem;
	line-height: 1.3;
}

.simple-editor-content .ProseMirror h2 {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 1rem 0 0.5rem;
	line-height: 1.35;
}

.simple-editor-content .ProseMirror h3 {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0.75rem 0 0.5rem;
	line-height: 1.4;
}

.simple-editor-content .ProseMirror h4 {
	font-size: 1.125rem;
	font-weight: 600;
	margin: 0.5rem 0 0.5rem;
	line-height: 1.45;
}

.simple-editor-content .ProseMirror p {
	margin: 0.5rem 0;
}

.simple-editor-content .ProseMirror strong {
	font-weight: 600;
}

.simple-editor-content .ProseMirror em {
	font-style: italic;
}

.simple-editor-content .ProseMirror u {
	text-decoration: underline;
}

.simple-editor-content .ProseMirror s {
	text-decoration: line-through;
}

.simple-editor-content .ProseMirror sub {
	vertical-align: sub;
	font-size: 0.75em;
}

.simple-editor-content .ProseMirror sup {
	vertical-align: super;
	font-size: 0.75em;
}

.simple-editor-content .ProseMirror code {
	background: #f1f5f9;
	color: #e11d48;
	padding: 0.2em 0.4em;
	border-radius: 4px;
	font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Menlo', monospace;
	font-size: 0.9em;
}

.simple-editor-content .ProseMirror mark {
	background: #fef08a;
	padding: 0.1em 0.2em;
	border-radius: 2px;
}

/* Lists */
.simple-editor-content .ProseMirror ul,
.simple-editor-content .ProseMirror ol {
	padding-left: 1.5rem;
	margin: 0.5rem 0;
}

.simple-editor-content .ProseMirror ul {
	list-style-type: disc;
}

.simple-editor-content .ProseMirror ol {
	list-style-type: decimal;
}

.simple-editor-content .ProseMirror li {
	margin: 0.25rem 0;
}

.simple-editor-content .ProseMirror li p {
	margin: 0;
}

/* Task List / Checklist */
.simple-editor-content .ProseMirror ul[data-type='taskList'] {
	list-style: none;
	padding-left: 0;
	margin: 0.5rem 0;
}

.simple-editor-content .ProseMirror ul[data-type='taskList'] li {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0.25rem 0;
}

.simple-editor-content .ProseMirror ul[data-type='taskList'] li > label {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 0.125rem;
}

.simple-editor-content
	.ProseMirror
	ul[data-type='taskList']
	li
	> label
	input[type='checkbox'] {
	width: 1rem;
	height: 1rem;
	cursor: pointer;
	accent-color: #3b82f6;
}

.simple-editor-content .ProseMirror ul[data-type='taskList'] li > div {
	flex: 1;
}

.simple-editor-content
	.ProseMirror
	ul[data-type='taskList']
	li[data-checked='true']
	> div {
	text-decoration: line-through;
	color: #94a3b8;
}

/* Nested Task List */
.simple-editor-content
	.ProseMirror
	ul[data-type='taskList']
	ul[data-type='taskList'] {
	padding-left: 1.5rem;
}

/* Blockquote */
.simple-editor-content .ProseMirror blockquote {
	border-left: 3px solid #3b82f6;
	padding-left: 1rem;
	margin: 0.75rem 0;
	color: #64748b;
	font-style: italic;
}

/* Horizontal Rule */
.simple-editor-content .ProseMirror hr {
	border: none;
	border-top: 2px solid #e2e8f0;
	margin: 1rem 0;
}

/* Links */
.simple-editor-content .ProseMirror a,
.simple-editor-link {
	color: #3b82f6;
	text-decoration: underline;
	cursor: pointer;
}

.simple-editor-content .ProseMirror a:hover,
.simple-editor-link:hover {
	color: #2563eb;
}

/* Dark Theme - via explicit class */
.simple-editor-dark {
	background: hsl(var(--background, 222.2 84% 4.9%));
	border-color: hsl(var(--border, 222 8% 24%));
}

.simple-editor-dark .simple-editor-title {
	border-color: hsl(var(--border, 222 8% 24%));
	color: hsl(var(--foreground, 210 40% 98%));
}

.simple-editor-dark .simple-editor-toolbar {
	background: hsl(var(--background, 222.2 84% 4.9%));
	border-color: hsl(var(--border, 222 8% 24%));
}

.simple-editor-dark .simple-editor-toolbar-btn {
	color: hsl(var(--foreground, 210 40% 98%));
}

.simple-editor-dark .simple-editor-toolbar-btn:hover:not(.disabled) {
	background: hsl(var(--muted, 217.2 32.6% 17.5%));
}

.simple-editor-dark .simple-editor-toolbar-divider {
	background: hsl(var(--border, 222 8% 24%));
}

/* Dark Theme - via parent .dark class (for theme providers) */
.dark .simple-editor-container,
.dark .simple-editor-light {
	background: hsl(var(--background));
	border-color: hsl(var(--border));
}

.dark .simple-editor-container .simple-editor-title,
.dark .simple-editor-light .simple-editor-title {
	border-color: hsl(var(--border));
	color: hsl(var(--foreground));
}

.dark .simple-editor-container .simple-editor-toolbar,
.dark .simple-editor-light .simple-editor-toolbar {
	background: hsl(var(--background));
	border-color: hsl(var(--border));
}

.dark .simple-editor-container .simple-editor-toolbar-btn,
.dark .simple-editor-light .simple-editor-toolbar-btn {
	color: hsl(var(--foreground));
}

.dark .simple-editor-container .simple-editor-toolbar-btn:hover:not(.disabled),
.dark .simple-editor-light .simple-editor-toolbar-btn:hover:not(.disabled),
.dark .simple-editor-container .simple-editor-toolbar-btn.active,
.dark .simple-editor-light .simple-editor-toolbar-btn.active {
	background: hsl(var(--muted));
}

.dark .simple-editor-container .simple-editor-toolbar-divider,
.dark .simple-editor-light .simple-editor-toolbar-divider {
	background: hsl(var(--border));
}

.simple-editor-dark .simple-editor-content .ProseMirror {
	color: hsl(var(--foreground, 210 40% 98%));
}

.simple-editor-dark .simple-editor-content .ProseMirror code {
	background: hsl(var(--muted, 217.2 32.6% 17.5%));
	color: #f472b6;
}

.simple-editor-dark .simple-editor-content .ProseMirror mark {
	background: #854d0e;
	color: #fef08a;
}

.simple-editor-dark .simple-editor-content .ProseMirror blockquote {
	border-color: #60a5fa;
	color: hsl(var(--muted-foreground, 215 20.2% 65.1%));
}

.simple-editor-dark .simple-editor-content .ProseMirror hr {
	border-color: hsl(var(--border, 222 8% 24%));
}

.simple-editor-dark .simple-editor-content .ProseMirror a,
.simple-editor-dark .simple-editor-link {
	color: #60a5fa;
}

/* Dark Theme Content - via parent .dark class */
.dark .simple-editor-container .simple-editor-content .ProseMirror,
.dark .simple-editor-light .simple-editor-content .ProseMirror {
	color: hsl(var(--foreground));
}

.dark .simple-editor-container .simple-editor-content .ProseMirror code,
.dark .simple-editor-light .simple-editor-content .ProseMirror code {
	background: hsl(var(--muted));
	color: #f472b6;
}

.dark .simple-editor-container .simple-editor-content .ProseMirror mark,
.dark .simple-editor-light .simple-editor-content .ProseMirror mark {
	background: #854d0e;
	color: #fef08a;
}

.dark .simple-editor-container .simple-editor-content .ProseMirror blockquote,
.dark .simple-editor-light .simple-editor-content .ProseMirror blockquote {
	border-color: #60a5fa;
	color: hsl(var(--muted-foreground));
}

.dark .simple-editor-container .simple-editor-content .ProseMirror hr,
.dark .simple-editor-light .simple-editor-content .ProseMirror hr {
	border-color: hsl(var(--border));
}

.dark .simple-editor-container .simple-editor-content .ProseMirror a,
.dark .simple-editor-light .simple-editor-content .ProseMirror a,
.dark .simple-editor-link {
	color: #60a5fa;
}

.dark
	.simple-editor-container
	.simple-editor-content
	.ProseMirror
	ul[data-type='taskList']
	li[data-checked='true']
	> div,
.dark
	.simple-editor-light
	.simple-editor-content
	.ProseMirror
	ul[data-type='taskList']
	li[data-checked='true']
	> div {
	color: hsl(var(--muted-foreground));
}

/* Scrollbar Styling for Content */
.simple-editor-content::-webkit-scrollbar {
	width: 8px;
}

.simple-editor-content::-webkit-scrollbar-track {
	background: transparent;
}

.simple-editor-content::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 4px;
}

.simple-editor-content::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

.simple-editor-dark .simple-editor-content::-webkit-scrollbar-thumb {
	background: hsl(var(--border, 222 8% 24%));
}

.simple-editor-dark .simple-editor-content::-webkit-scrollbar-thumb:hover {
	background: hsl(var(--muted-foreground, 215 20.2% 65.1%));
}

/* Dark Theme Scrollbar - via parent .dark class */
.dark .simple-editor-container .simple-editor-content::-webkit-scrollbar-thumb,
.dark .simple-editor-light .simple-editor-content::-webkit-scrollbar-thumb {
	background: hsl(var(--border));
}

.dark
	.simple-editor-container
	.simple-editor-content::-webkit-scrollbar-thumb:hover,
.dark
	.simple-editor-light
	.simple-editor-content::-webkit-scrollbar-thumb:hover {
	background: hsl(var(--muted-foreground));
}

/* Dark Theme Placeholder */
.dark
	.simple-editor-container
	.simple-editor-content
	.ProseMirror
	p.is-editor-empty:first-child::before,
.dark
	.simple-editor-light
	.simple-editor-content
	.ProseMirror
	p.is-editor-empty:first-child::before {
	color: hsl(var(--muted-foreground));
}
