/**
 * Archive Codex Styles
 * Tabbed filter system and entry list styling for codex archive page
 *
 * @package Nullbound
 * @since 1.0.0
 */

/* Archive Container */
.archive-codex-main {
	min-height: 100vh;
	background-color: transparent;
	background: transparent;
	padding: 2rem 0;
}

.archive-codex-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 2rem;
	background: transparent;
}

/* Archive Header */
.archive-codex-header {
	text-align: center;
	margin-bottom: 3rem;
}

.archive-codex-title {
	font-family: 'JetBrains Mono', monospace;
	font-size: 2.5rem;
	font-weight: 700;
	color: #00FFFF;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	text-shadow: 
		0 0 10px rgba(0, 255, 255, 0.5),
		0 0 20px rgba(0, 255, 255, 0.3);
	margin: 0;
	animation: glitch-title-load 1s ease-in-out;
}

/* Filter Tabs */
.codex-filter-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 3rem;
	border-bottom: 2px solid rgba(0, 255, 255, 0.2);
	padding-bottom: 1rem;
}

.codex-tab {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.875rem;
	font-weight: 600;
	color: rgba(0, 255, 255, 0.6);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	text-decoration: none;
	border: 2px solid transparent;
	border-radius: 4px;
	background-color: transparent;
	transition: all 0.3s ease;
	cursor: pointer;
}

.codex-tab:hover {
	color: #00FFFF;
	border-color: rgba(0, 255, 255, 0.3);
	background-color: rgba(0, 255, 255, 0.05);
	text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.codex-tab.active {
	color: #00FFFF;
	border-color: #00FFFF;
	background-color: rgba(0, 255, 255, 0.1);
	text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
	box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

/* Result Count */
.codex-result-count {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.875rem;
	color: rgba(0, 255, 255, 0.6);
	margin-bottom: 2rem;
	text-align: center;
	padding: 0.5rem 0;
}

/* Loading Overlay */
.codex-loading {
	position: relative;
	display: none;
	justify-content: center;
	align-items: center;
	min-height: 200px;
	margin: 2rem 0;
}

.codex-loading.active {
	display: flex;
}

.codex-loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(0, 255, 255, 0.2);
	border-top-color: #00FFFF;
	border-radius: 50%;
	animation: codex-spin 1s linear infinite;
}

@keyframes codex-spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Codex Entries List */
.codex-entries-list {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	position: relative;
	transition: opacity 0.3s ease;
}

.codex-entries-list.loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Codex Entry Card */
.codex-entry-card {
	position: relative;
	background-color: rgba(0, 255, 255, 0.02);
	border: 2px solid rgba(0, 255, 255, 0.1);
	border-radius: 8px;
	padding: 2rem;
	transition: all 0.3s ease;
}

.codex-entry-card:hover:not(.locked) {
	border-color: rgba(0, 255, 255, 0.3);
	box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

.codex-entry-card.locked {
	cursor: not-allowed;
	opacity: 0.7;
}

/* Locked Entry Overlay */
.codex-entry-locked-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.8);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	border-radius: 8px;
	backdrop-filter: blur(4px);
}

.locked-content {
	text-align: center;
}

.locked-label {
	display: block;
	font-family: 'JetBrains Mono', monospace;
	font-size: 1.25rem;
	font-weight: 700;
	color: #00FFFF;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	text-shadow: 
		0 0 10px rgba(0, 255, 255, 0.8),
		0 0 20px rgba(0, 255, 255, 0.5);
	margin-bottom: 0.5rem;
}

.unlock-date {
	display: block;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 1rem;
	color: rgba(0, 255, 255, 0.8);
}

/* Blurred Content */
.codex-entry-content.blurred {
	filter: blur(4px);
	pointer-events: none;
	user-select: none;
}

/* Document Header */
.codex-document-header {
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.75rem;
	font-weight: 600;
	color: rgba(0, 255, 255, 0.7);
	text-transform: uppercase;
	letter-spacing: 0.15em;
	margin-bottom: 1rem;
	opacity: 0.8;
}

/* Entry Title */
.codex-entry-title {
	font-family: 'JetBrains Mono', monospace;
	font-size: 1.75rem;
	font-weight: 600;
	color: #00FFFF;
	margin: 0 0 1rem 0;
	text-transform: uppercase;
	letter-spacing: 0.1em;
}

.codex-entry-title a {
	color: inherit;
	text-decoration: none;
	transition: all 0.3s ease;
}

.codex-entry-title a:hover {
	color: #00FFFF;
	text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
	animation: chromaticAberrationGlitch 0.6s ease-out forwards;
}

/* Classification Badge */
.codex-classification-badge {
	display: inline-block;
	padding: 0.5rem 1rem;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	border-radius: 4px;
	border: 2px solid;
	margin-bottom: 1rem;
	background-color: rgba(0, 0, 0, 0.3);
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Classification Color Coding */
.classification-public {
	color: #00FF00;
	border-color: #00FF00;
	box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.classification-restricted {
	color: #FFFF00;
	border-color: #FFFF00;
	box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

.classification-redacted {
	color: #FF0000;
	border-color: #FF0000;
	box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

/* Entry Excerpt */
.codex-entry-excerpt {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.9375rem;
	color: rgba(0, 255, 255, 0.7);
	line-height: 1.6;
	margin-bottom: 1rem;
}

/* Entry Meta */
.codex-entry-meta {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 0.875rem;
	color: rgba(0, 255, 255, 0.5);
	margin-bottom: 1.5rem;
}

.codex-timestamp {
	color: rgba(0, 255, 255, 0.6);
}

/* Access Button */
.codex-entry-actions {
	margin-top: 1.5rem;
}

.codex-access-button {
	display: inline-block;
	padding: 0.75rem 2rem;
	font-family: 'JetBrains Mono', monospace;
	font-size: 0.875rem;
	font-weight: 700;
	color: #00FFFF;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	text-decoration: none;
	border: 2px solid #00FFFF;
	border-radius: 4px;
	background-color: transparent;
	transition: all 0.3s ease;
	cursor: pointer;
	text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
	box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.codex-access-button:hover {
	background-color: rgba(0, 255, 255, 0.1);
	box-shadow: 0 0 30px rgba(0, 255, 255, 0.4);
	text-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
	animation: chromaticAberrationGlitch 0.6s ease-out forwards;
}

.codex-access-button:focus {
	outline: 2px solid #00FFFF;
	outline-offset: 4px;
}

/* No Entries Message */
.no-codex-entries-message {
	text-align: center;
	padding: 4rem 2rem;
	color: rgba(0, 255, 255, 0.6);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 1.125rem;
}

/* Glitch Title Animation on Load */
@keyframes glitch-title-load {
	0% {
		transform: translate(0, 0);
		text-shadow: 
			0 0 10px rgba(0, 255, 255, 0.5),
			0 0 20px rgba(0, 255, 255, 0.3);
	}
	10% {
		transform: translate(-2px, 2px);
		text-shadow: 
			-2px 2px 10px rgba(255, 0, 255, 0.8),
			2px -2px 10px rgba(0, 255, 255, 0.8);
	}
	20% {
		transform: translate(2px, -2px);
		text-shadow: 
			2px -2px 10px rgba(0, 255, 255, 0.8),
			-2px 2px 10px rgba(255, 0, 255, 0.8);
	}
	30% {
		transform: translate(-1px, 1px);
		text-shadow: 
			-1px 1px 10px rgba(255, 0, 255, 0.8),
			1px -1px 10px rgba(0, 255, 255, 0.8);
	}
	40% {
		transform: translate(1px, -1px);
		text-shadow: 
			1px -1px 10px rgba(0, 255, 255, 0.8),
			-1px 1px 10px rgba(255, 0, 255, 0.8);
	}
	50%, 100% {
		transform: translate(0, 0);
		text-shadow: 
			0 0 10px rgba(0, 255, 255, 0.5),
			0 0 20px rgba(0, 255, 255, 0.3);
	}
}

/* Chromatic Aberration Glitch Effect on Hover */
@keyframes chromaticAberrationGlitch {
	0% {
		filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.6));
	}
	15% {
		filter: drop-shadow(3px 0 0 rgba(255, 0, 0, 0.9))
				drop-shadow(-3px 0 0 rgba(0, 255, 255, 0.9))
				drop-shadow(0 0 20px rgba(0, 255, 255, 0.6));
	}
	30% {
		filter: drop-shadow(-2px 0 0 rgba(255, 0, 0, 0.8))
				drop-shadow(2px 0 0 rgba(0, 255, 255, 0.8))
				drop-shadow(0 0 20px rgba(0, 255, 255, 0.6));
	}
	45% {
		filter: drop-shadow(2px 0 0 rgba(255, 0, 0, 0.7))
				drop-shadow(-2px 0 0 rgba(0, 255, 255, 0.7))
				drop-shadow(0 0 20px rgba(0, 255, 255, 0.6));
	}
	60% {
		filter: drop-shadow(1px 0 0 rgba(255, 0, 0, 0.5))
				drop-shadow(-1px 0 0 rgba(0, 255, 255, 0.5))
				drop-shadow(0 0 20px rgba(0, 255, 255, 0.6));
	}
	100% {
		filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.6));
	}
}

/* Legacy glitch-text animation removed - replaced with chromaticAberrationGlitch */

/* Tablet Responsive */
@media screen and (min-width: 768px) {
	.archive-codex-container {
		padding: 0 3rem;
	}

	.archive-codex-title {
		font-size: 3rem;
	}

	.codex-filter-tabs {
		gap: 1.5rem;
	}

	.codex-tab {
		font-size: 1rem;
		padding: 1rem 2rem;
	}

	.codex-entry-card {
		padding: 2.5rem;
	}

	.codex-entry-title {
		font-size: 2rem;
	}
}

/* Desktop Responsive */
@media screen and (min-width: 1024px) {
	.archive-codex-main {
		padding: 3rem 0;
	}

	.archive-codex-container {
		padding: 0 4rem;
	}

	.archive-codex-header {
		margin-bottom: 4rem;
	}

	.archive-codex-title {
		font-size: 3.5rem;
	}

	.codex-filter-tabs {
		margin-bottom: 4rem;
	}
}

/* Mobile Responsive */
@media screen and (max-width: 767px) {
	.archive-codex-main {
		padding: 1.5rem 0;
	}

	.archive-codex-container {
		padding: 0 1.5rem;
	}

	.archive-codex-header {
		margin-bottom: 2rem;
	}

	.archive-codex-title {
		font-size: 1.75rem;
		letter-spacing: 0.1em;
	}

	.codex-filter-tabs {
		flex-direction: column;
		gap: 0.75rem;
		margin-bottom: 2rem;
	}

	.codex-tab {
		width: 100%;
		text-align: center;
		padding: 0.875rem 1rem;
	}

	.codex-entry-card {
		padding: 1.5rem;
	}

	.codex-entry-title {
		font-size: 1.5rem;
	}

	.locked-label {
		font-size: 1rem;
	}
}

