﻿html {
	font-size: 14px;
}

/* Lexical editor surface: when user prefers a light canvas, use .editor-light */
#lexical-editor-root.editor-light {
	background: white !important;
	color: #111 !important;
}

/* Toolbar switch adjustments */
.lexical-toolbar .form-check {
	margin: 0;
}

.lexical-toolbar .form-check-input {
	width: 2rem;
	height: 1rem;
}

/* Make the switch knob use the primary color for better visibility.
   This forces the knob (the pseudo-element) and the checked track to use --bs-primary. */
.form-check-input:checked {
	background-color: var(--bs-primary) !important;
	border-color: var(--bs-primary) !important;
}
.form-check-input:focus {
	box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.15) !important;
}
.form-check-input::before {
	/* knob */
	background-color: var(--bs-primary) !important;
	border-color: var(--bs-primary) !important;
}
.form-check-input:checked::before {
	background-color: var(--bs-primary) !important;
}

@media (min-width: 768px) {
	html {
		font-size: 16px;
	}
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
	box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
	position: relative;
	min-height: 100%;
}

body {
	margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
	color: var(--bs-secondary-color);
	text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
	text-align: start;
}

/* -----------------------------------------
   Global Layout & Typography
----------------------------------------- */

body {
	font-family: system-ui, sans-serif;
	margin: 0;
	padding: 0;
	background: #f5f7fa;
	color: #333;
}

h1, h2 {
	font-weight: 600;
	margin: 0;
}

/* -----------------------------------------
   Page Header
----------------------------------------- */

.page-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.5rem;
}

	.page-header h1 {
		font-size: 2rem;
	}

/* -----------------------------------------
   Buttons
----------------------------------------- */

.btn-primary {
	background: #4a6cf7;
	color: white;
	padding: 0.6rem 1.2rem;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 500;
	border: none;
	cursor: pointer;
	transition: background 0.2s ease;
}

	.btn-primary:hover {
		background: #3a57d9;
	}

.btn-secondary {
	background: #e5e7eb;
	color: #333;
	padding: 0.6rem 1.2rem;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 500;
	border: none;
	cursor: pointer;
	transition: background 0.2s ease;
}

	.btn-secondary:hover {
		background: #d5d7da;
	}

/* -----------------------------------------
   Tables (Books Index)
----------------------------------------- */

.book-table {
	width: 100%;
	border-collapse: collapse;
	background: #ffffff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

	.book-table th {
		background: #f5f7fa;
		text-align: left;
		padding: 0.75rem 1rem;
		font-weight: 600;
		color: #333;
		border-bottom: 1px solid #e5e7eb;
	}

	.book-table td {
		padding: 0.75rem 1rem;
		border-bottom: 1px solid #f0f0f0;
	}

	.book-table tr:last-child td {
		border-bottom: none;
	}

.actions .link {
	color: #4a6cf7;
	text-decoration: none;
	font-weight: 500;
}

	.actions .link:hover {
		text-decoration: underline;
	}

/* -----------------------------------------
   Empty State
----------------------------------------- */

.empty-state {
	text-align: center;
	padding: 3rem 1rem;
	background: #f9fafb;
	border-radius: 8px;
	border: 1px dashed #d1d5db;
}

	.empty-state h2 {
		margin-bottom: 0.5rem;
		font-size: 1.5rem;
	}

	.empty-state p {
		margin-bottom: 1rem;
		color: #555;
	}

/* -----------------------------------------
   Forms (Create Book)
----------------------------------------- */

.form-card {
	padding: 1.5rem;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
	max-width: 500px;
}

.form-group {
	margin-bottom: 1.2rem;
	display: flex;
	flex-direction: column;
}

label {
	font-weight: 600;
	margin-bottom: 0.3rem;
}

.input {
	padding: 0.6rem 0.8rem;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 1rem;
	transition: border-color 0.2s ease;
}

	.input:focus {
		border-color: #4a6cf7;
		outline: none;
	}

.validation {
	color: #d9534f;
	font-size: 0.9rem;
	margin-top: 0.2rem;
}

.actions {
	margin-top: 1.5rem;
	display: flex;
	gap: 1rem;
}


/* -----------------------------------------
   Goal Bar
----------------------------------------- */

.goal-bar {
	display: flex;
	align-items: center;
	gap: 8px;
}

.goal-progress {
	flex-grow: 1;
	height: 6px;
	background-color: #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	align-items: center;
}

.goal-progress-fill {
	height: 100%;
	width: 0%;
	background-color: #4caf50;
	transition: width 0.25s ease-in-out;
}

.goal-text {
	font-size: 0.85rem;
	color: #555;
	line-height: 1;
	white-space: nowrap;
}


/* -----------------------------------------
   Speed Reader
----------------------------------------- */
.reader-display {
	text-align: center;
	margin-top: 40px;
}

.reader-word {
	font-size: 2.8rem;
	font-weight: 600;
	letter-spacing: 1px;
}

	.reader-word .orp {
		color: #ff5252;
	}

/* Mobile tweaks */
@media (max-width: 600px) {
	.reader-word {
		font-size: 2.2rem;
	}
}

.spritz-word {
	position: relative;
	width: 100%;
	white-space: pre;
	display: flex;
	justify-content: center;
	align-items: center;
}

	.spritz-word .left,
	.spritz-word .right {
		flex: 1 1 0;
		overflow: hidden;
	}

	.spritz-word .orp {
		flex: 0 0 1ch; /* fixed ORP column */
		text-align: center;
		color: #ff5252;
	}

	.spritz-word .left {
		text-align: right;
		white-space: pre;
	}

	.spritz-word .right {
		text-align: left;
		white-space: pre;
	}

.reader-word {
	width: 100%;
	height: 200px;
	position: relative;
	background: #111;
}

#readerCanvas {
	width: 100%;
	height: 100px;
	display: block;
	background: #222;
}