﻿html {
	font-size: 14px;
}

@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 {
	/*background: #ffffff;*/
	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;
}

/* -----------------------------------------
   Workspace
----------------------------------------- */
.workspace-container {
	display: grid;
	grid-template-columns: 250px 1fr 300px;
	height: calc(100vh - 60px);
	gap: 1rem;
}

.chapters-pane,
.notes-pane {
	/*background: #fff;*/
	border-radius: 8px;
	padding: 1rem;
	overflow-y: auto;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.editor-pane {
	/*background: #fff;*/
	border-radius: 8px;
	padding: 1.5rem;
	overflow-y: auto;
	box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.chapter-item {
	cursor: pointer;
}

.drag-handle {
	cursor: grab;
	color: #888;
}

.notes-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.note-card {
	background: #fff8c6;
	padding: 1rem;
	border-radius: 6px;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.drag-handle {
	cursor: grab;
	font-size: 1.2rem;
	color: #999;
	user-select: none;
}

	.drag-handle:active {
		cursor: grabbing;
	}

.dragging {
	opacity: 0.5;
}

.goal-bar {
	display: flex;
	align-items: center; /* <-- centers vertically */
	gap: 8px; /* optional: adds breathing room */
}

.goal-progress {
	flex-grow: 1;
	height: 6px;
	background-color: #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
	display: flex; /* <-- ensures the fill centers properly */
	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; /* <-- prevents the text from sitting low */
	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;
}

	/* ORP highlighting */
	.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; /* or whatever feels good */
	position: relative;
	background: #111; /* debug */
}

#readerCanvas {
	width: 100%;
	height: 100px;
	display: block;
	background: #222; /* temporary debug */
}

/* -----------------------------------------
   Darkmode
----------------------------------------- */
@media (prefers-color-scheme: dark) {
	body {
		background-color: #121212;
		color: #e0e0e0;
	}

	.list-group-item {
		background-color: #1e1e1e;
		color: #e0e0e0;
	}

	.chapter-item.chapter-selected {
		background-color: #2a2a2a;
		color: #fff;
	}

	textarea, input, select {
		background-color: #1e1e1e;
		color: #e0e0e0;
		border-color: #444;
	}

	.note-card {
		/*background-color: #1e1e1e;*/
		/*border-color: #333;*/
		color: black;
	}

	input,
	textarea,
	select,
	nav {
		background-color: darkgray !important;
	}

	.modal-body,
	.modal-footer,
	.modal-header {
		background-color: black !important;
	}
}
