/* Mobile-friendly modal styles */
.modal {
	display: none;
	position: fixed;
	z-index: 1000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(2px);
}

.modal-content {
	background-color: #fefefe;
	margin: 10% auto;
	padding: 20px;
	border: none;
	border-radius: 12px;
	width: 90%;
	max-width: 500px;
	max-height: 70vh;
	overflow-y: auto;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	position: relative;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
	border-bottom: 1px solid #eee;
	padding-bottom: 10px;
}

.modal-title {
	font-size: 1.2em;
	font-weight: bold;
	color: #2c3e50;
}

.close-btn {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	padding: 0;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.close-btn:hover {
	background-color: #f0f0f0;
}

.verse-item {
	margin-bottom: 15px;
	padding: 12px;
	background-color: #f8f9fa;
	border-radius: 8px;
	border-left: 4px solid #3498db;
}

.verse-ref {
	font-weight: bold;
	color: #2c3e50;
	margin-bottom: 5px;
	font-size: 0.9em;
}

.verse-text {
	line-height: 1.5;
	color: #34495e;
}

.verse-count {
	color: #7f8c8d;
	font-size: 0.9em;
	margin-bottom: 10px;
}

/* Make highlighted words more clickable on mobile */
.bible-word {
	cursor: pointer;
	padding: 2px 4px;
	border-radius: 3px;
	transition: all 0.2s ease;
	touch-action: manipulation;
}

.bible-word:hover,
.bible-word:active {
	transform: scale(1.05);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Mobile optimizations */
@media (max-width: 768px) {
	.modal-content {
		margin: 5% auto;
		width: 95%;
		max-height: 80vh;
		padding: 15px;
	}

	.verse-item {
		margin-bottom: 12px;
		padding: 10px;
	}

	.modal-title {
		font-size: 1.1em;
	}

	.textarea-container textarea {
		min-height: 120px;
	}

	.stats {
		flex-direction: column;
		gap: 10px;
	}

	.stat-item {
		flex: 1;
	}
}

.rarity-common {
	background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
	/* Soft light gray */
	color: #333;
	font-weight: 500;
	text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
	box-shadow: 0 2px 6px rgba(155, 155, 155, 0.2);
}

.rarity-uncommon {
	background: linear-gradient(135deg, #c3f7d2, #ebffeb);
	/* Sky blue tones */
	color: #022705;
	font-weight: 600;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
	box-shadow: 0 2px 8px rgba(0, 160, 48, 0.25);
}

.rarity-rare {
	background: linear-gradient(135deg, #fff8e5, #ffe9b9);
	/* Elegant pink-purple gradient */
	color: #753f00;
	font-weight: 600;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
	box-shadow: 0 2px 10px rgba(255, 184, 53, 0.3);
}

.rarity-cursed {
	background: linear-gradient(135deg, #fccfcf, #ffbfbf);
	/* Soft light gray */
	color: #ff0707;
	font-weight: 500;
	text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
	box-shadow: 0 2px 6px rgb(228, 171, 171);
}

.rarity-legendary {
	background: linear-gradient(135deg, #e6f3ff, #b8daff, #87ceeb, #ffffff);
	/* Holy celestial gradient */
	color: #2c5282;
	font-weight: 700;
	text-shadow:
		0 0 5px rgba(255, 255, 255, 1),
		0 0 10px rgba(173, 216, 230, 0.8),
		0 1px 2px rgba(0, 0, 0, 0.2);
	box-shadow:
		0 3px 12px rgba(135, 206, 235, 0.4),
		0 0 20px rgba(173, 216, 230, 0.5),
		inset 0 1px 0 rgba(255, 255, 255, 0.4);
	border: 1px solid rgba(173, 216, 230, 0.6);
	position: relative;
	overflow: hidden;
	animation: legendaryPulse 0.8s ease-in-out infinite alternate;
}

.rarity-legendary::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: linear-gradient(45deg,
			transparent,
			rgba(255, 255, 255, 0.1),
			transparent);
	animation: legendaryShine 1.2s ease-in-out infinite;
	pointer-events: none;
}

.rarity-legendary::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: radial-gradient(circle at center,
			rgba(173, 216, 230, 0.2) 0%,
			transparent 70%);
	animation: legendaryGlow 0.6s ease-in-out infinite alternate;
	pointer-events: none;
}




@keyframes legendaryPulse {
	0% {
		box-shadow:
			0 3px 12px rgba(135, 206, 235, 0.4),
			0 0 20px rgba(173, 216, 230, 0.5),
			inset 0 1px 0 rgba(255, 255, 255, 0.4);
	}

	100% {
		box-shadow:
			0 3px 15px rgba(135, 206, 235, 0.6),
			0 0 30px rgba(173, 216, 230, 0.8),
			inset 0 1px 0 rgba(255, 255, 255, 0.5);
	}
}

@keyframes legendaryShine {
	0% {
		transform: translateX(-100%) translateY(-100%) rotate(45deg);
	}

	100% {
		transform: translateX(100%) translateY(100%) rotate(45deg);
	}
}

@keyframes legendaryGlow {
	0% {
		opacity: 0.3;
	}

	100% {
		opacity: 0.6;
	}
}


/* Enhanced bible word styling */
.bible-word {
	cursor: pointer;
	padding: 3px 6px;
	border-radius: 6px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	touch-action: manipulation;
	display: inline-block;
	margin: 1px;
	position: relative;
	font-family: inherit;
	vertical-align: top;
}

/* Frequency legend */
.frequency-legend {
	margin: 20px 0;
	padding: 20px;
	background: linear-gradient(135deg, #f8f9fa, #e9ecef);
	border-radius: 12px;
	border: 1px solid #dee2e6;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.legend-title {
	font-weight: bold;
	margin-bottom: 15px;
	color: #2c3e50;
	font-size: 1.1em;
	text-align: center;
}

.legend-items {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 10px;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px;
	border-radius: 6px;
	transition: background-color 0.2s;
}

.legend-item:hover {
	background-color: rgba(255, 255, 255, 0.5);
}

.legend-color {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	display: inline-block;
	flex-shrink: 0;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-item span:last-child {
	font-size: 0.9em;
	color: #495057;
}

/* Basic styles for the demo */
body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	margin: 0;
	padding: 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
}

.container {
	max-width: 800px;
	margin: 0 auto;
	background: white;
	border-radius: 12px;
	padding: 0;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.header {
	background: #3498db;
	color: white;
	padding: 30px;
	text-align: center;
}

.header h1 {
	color: white;
	margin-bottom: 10px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
	color: rgba(255, 255, 255, 0.9);
	margin-bottom: 0;
}

.input-section {
	margin-bottom: 30px;
	padding: 30px;
}

.textarea-container {
	margin: 10px 0;
}

.textarea-container textarea {
	width: 100%;
	min-height: 100px;
	padding: 15px;
	border: 2px solid #ddd;
	border-radius: 8px;
	font-size: 16px;
	resize: vertical;
	box-sizing: border-box;
}

.analyze-btn {
	background-color: #3498db;
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 16px;
	cursor: pointer;
	transition: background-color 0.3s;
}

.analyze-btn:hover {
	background-color: #2980b9;
}

.analyze-btn code {
	background: rgba(255, 255, 255, 0.15);
	padding: 1px 4px;
	border-radius: 3px;
	font-size: 0.75em;
	margin-left: 6px;
	opacity: 0.8;
}

.results-section {
	margin-top: 30px;
	padding: 0 30px 30px;
}

.results-title {
	font-size: 1.2em;
	font-weight: bold;
	margin-bottom: 15px;
	color: #2c3e50;
}

.highlighted-text {
	background-color: #f8f9fa;
	padding: 20px;
	border-radius: 8px;
	line-height: 1.6;
	margin-bottom: 20px;
	min-height: 60px;
}

.stats {
	display: flex;
	gap: 20px;
	margin-top: 20px;
}

.stat-item {
	background-color: #f8f9fa;
	padding: 15px;
	border-radius: 8px;
	text-align: center;
	flex: 1;
}

.stat-number {
	font-size: 1.5em;
	font-weight: bold;
	color: #2c3e50;
}

.stat-label {
	color: #7f8c8d;
	font-size: 0.9em;
}

.loading {
	text-align: center;
	color: #7f8c8d;
	font-style: italic;
}

.loadMoreBtn {
	width: 100%;
	padding: 10px;
	background: #3498db;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	margin-top: 10px;
}