/* Reader Layout */
.reader-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
/* header {
    position: sticky;
    top: 0;
    z-index: 100;
	background-color: var(--bg-body);
	border-bottom: var(--border);
} */

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
	margin-bottom: 0;
}

.header-content {
    max-width: var(--maxwidth);
    margin: 0 auto;
    padding: 1rem;
}

.header-content .book-selector {
	width: 100%;
	max-width: 800px;
    margin: 0 auto;
}

.menu a {
	color: var(--menu-color);
	font-weight: bold;
	font-size: .8rem;
	text-decoration: none;
	padding: .5rem .75rem;
    border-radius: 1rem;
	transition: all .2s ease;
}

menu a:hover {
	background-color: var(--menu-hover-color);
}


/* Book and Chapter Navigation */

.navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
}

.chapter-nav {
    display: flex;
    gap: 1rem;
}

#content {
    min-height: 40dvh;
}

/* ===== Buttons ===== */

.btn-primary {
	background-color: var(--primary-color);
	color: white;
}

.btn-primary:hover {
	background-color: var(--primary-hover);
}

.btn-secondary {
	background-color: var(--secondary-color);
	color: white;
}

.btn-secondary:hover {
	background-color: #1976D2;
}

.btn-danger {
	background-color: var(--danger-color);
	color: white;
}

.btn-danger:hover {
	background-color: #d32f2f;
}

.btn:disabled {
	background-color: #cccccc;
	cursor: not-allowed;
	opacity: 0.7;
}

/* ===== Form Elements ===== */
select,
input[type="text"],
input[type="number"],
textarea {
	padding: 8px 12px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
	font-family: inherit;
	font-size: 15px;
	width: 100%;
}

select:disabled,
input:disabled,
textarea:disabled {
	background-color: #f5f5f5;
	cursor: not-allowed;
}

.selector-group {
	display: flex;
	align-items: center;
	gap: 10px;
}

label {
	font-weight: 500;
	color: #555;
}

/* ===== Status Messages ===== */
.status-message {
	padding: 10px;
	margin: 10px 0;
	border-radius: 4px;
	display: none;
}

.success {
	background-color: #d4edda;
	color: #155724;
	display: block !important;
}

.error {
	background-color: #f8d7da;
	color: #721c24;
	display: block !important;
}

.warning {
	background-color: #fff3cd;
	color: #856404;
	display: block !important;
}

.action-buttons {
	display: flex;
	gap: 10px;
}

.btn:hover {
	background: var(--primary-hover);
}

.btn-secondary {
	background: var(--secondary-color);
}

.btn-secondary:hover {
	background: #1976D2;
}

.btn:disabled {
	background: #cccccc;
	cursor: not-allowed;
	opacity: 0.7;
}

.selector-group {
	display: flex;
	align-items: center;
	gap: 10px;
}

label {
	font-weight: 500;
	color: #555;
}

select {
	padding: 8px 12px;
	border-radius: 4px;
	border: 1px solid var(--border-color);
	min-width: 200px;
	font-size: 15px;
	background: white;
	cursor: pointer;
}

select:disabled {
	background: #f5f5f5;
	cursor: not-allowed;
}

.chapter-navigation {
	position: fixed;
    inset: 50% 0;
}

.navigation-buttons {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: calc(var(--maxwidth) - 100px);
	margin: auto;
}

.chapter-content {
	width: 100%;
	max-width: calc(var(--maxwidth) / 2);
	margin: 0 auto;
	padding-top: 2rem;
	line-height: 1.8;
}

.chapter-title {
	font-size: 22px;
    font-weight: normal;
	margin-bottom: 20px;
	padding-bottom: 10px;
}

.loading, .error, .empty-state {
	text-align: center;
	padding: 40px 20px;
	margin: 20px 0;
	border-radius: 8px;
	background: white;
	box-shadow: var(--shadow);
}

.loading {
	color: #666;
}

.error {
	color: var(--danger-color);
	background: #ffebee;
	border-left: 3px solid var(--danger-color);
}

/* ===== Chapter and Verse Styling ===== */

.verse {
    position: relative;
    display: flex;
    line-height: 1.5;
    margin: 0 0.2em;
	gap: 0 1rem;
    padding: 0.1em 0.2em 0.1em 0.2em;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

/* .verse.selected {
    background-color: rgba(76, 175, 80, 0.2);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
} */

.verse-paragraph {
    margin-bottom: 1.2em;
    line-height: 1.8;
    text-align: justify;
}

/* Note Icon Styles */
.note-icon {
    display: inline-block;
    margin-right: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    font-size: 0.9em;
    vertical-align: middle;
}

.note-icon:hover {
    opacity: 1;
}

/* Note Popup Styles */
.note-popup {
    display: none;
    position: absolute;
    width: 300px;
    max-height: 300px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.2s ease;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 5px;
    border: 1px solid #e0e0e0;
}

.note-popup.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.note-header h4 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.close-note {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    padding: 0 8px;
    line-height: 1;
}

.close-note:hover {
    color: #333;
}

.note-content {
	flex: 1;
    padding: 1rem;
    overflow-y: auto;
    min-height: fit-content;
    border: none;
    resize: none;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.5;
}

.note-content:focus {
    outline: none;
}

.note-actions {
    padding: 6px 12px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.save-note {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.save-note:hover {
    background-color: #45a049;
}

/* Status message */
.status-message {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    background-color: #4CAF50;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
    font-size: 0.95em;
}

.status-message.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Overlay for when popup is active */
.note-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.note-popup.active + .note-popup-overlay {
    display: block;
}

/* Empty state */
/* Loading state */
.loading-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading-state .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(76, 175, 80, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 2rem;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 1rem 0;
}

footer {
	text-align: center;
	margin-top: 50px;
	padding: 20px;
	color: #777;
	font-size: 0.9em;
	border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
	.book-selector {
		flex-direction: column;
		align-items: flex-start;
	}

	.selector-group {
		width: 100%;
		margin-bottom: 10px;
	}

	select {
		width: 100%;
	}

	.action-buttons {
		width: 100%;
		justify-content: space-between;
	}

	.navigation-buttons {
		width: 100%;
		justify-content: space-between;
	}

	.chapter-content {
		padding: 15px;
	}
}

select {
	padding: 5px;
	font-size: 16px;
}

.upload-section {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
}

.notification {
	flex: 1 1 100%;
	height: 40px;
	font-size: .8rem;
}

input[type="file"] {
	margin: 10px;
}

.slider-container {
	position: relative;
	max-width: 800px;
	margin: 0 auto;
	overflow: hidden;
	border: 1px solid #ddd;
	background: white;
}

.slide {
	display: none;
	padding: 20px;
	min-height: 400px;
	box-sizing: border-box;
}

.slide.active {
	display: block;
}

.verse {
	margin: 1rem 0;
	font-size: var(--font-verse-size);
}

.prev,
.next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.5);
	color: white;
	border: none;
	padding: 10px;
	cursor: pointer;
	font-size: 18px;
}

.prev {
	left: 10px;
}

.next {
	right: 10px;
}

.error {
	max-width: 800px;
	margin: 20px auto;
	padding: 10px;
	background: #fff;
	border: 1px solid #ddd;
	color: red;
	text-align: center;
}