/**
 * Achievement system styles
 */

/* Achievement Tracker Widget */
#achievement-tracker {
	position: fixed;
	top: 20px;
	left: 20px;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(10px);
	padding: 12px 20px;
	border-radius: 8px;
	border: 1px solid rgba(255, 107, 53, 0.3);
	color: white;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	cursor: pointer;
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 8px;
	transition: all 0.3s ease;
	user-select: none;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#achievement-tracker:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 24px rgba(255, 107, 53, 0.4);
	border-color: rgba(255, 107, 53, 0.6);
}

#achievement-tracker:focus-visible {
	outline: 2px solid #ff6b35;
	outline-offset: 2px;
}

.tracker-icon {
	font-size: 18px;
}

.tracker-text {
	font-weight: 600;
	color: #ff6b35;
}

.tracker-expand {
	font-size: 10px;
	opacity: 0.6;
	transition: transform 0.3s ease;
}

#achievement-tracker:hover .tracker-expand {
	transform: translateY(2px);
}

/* Achievement Toast Notification */
.achievement-toast {
	position: fixed;
	top: 80px;
	right: 20px;
	width: 320px;
	background: linear-gradient(135deg, rgba(22, 22, 22, 0.98) 0%, rgba(38, 38, 38, 0.98) 100%);
	backdrop-filter: blur(10px);
	border-radius: 8px;
	border-left: 4px solid #ff6b35;
	box-shadow: 0 8px 24px rgba(255, 107, 53, 0.25);
	padding: 16px;
	z-index: 9999;
	transform: translateX(400px);
	opacity: 0;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	gap: 12px;
	color: white;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.achievement-toast.show {
	transform: translateX(0);
	opacity: 1;
}

.toast-icon {
	font-size: 32px;
	flex-shrink: 0;
}

.toast-content {
	flex: 1;
}

.toast-title {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #ff6b35;
	margin-bottom: 4px;
	font-weight: 600;
}

.toast-achievement {
	font-size: 16px;
	font-weight: 700;
	margin-bottom: 4px;
	color: #fff;
}

.toast-description {
	font-size: 13px;
	color: #a3a3a3;
	margin-bottom: 8px;
	line-height: 1.4;
}

.toast-footer {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	padding-top: 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-xp {
	color: #FFD700;
	font-weight: 600;
}

.toast-progress {
	color: #a3a3a3;
}

/* Achievement Panel Backdrop */
#achievement-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
	z-index: 1998;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

#achievement-backdrop.show {
	opacity: 1;
	pointer-events: all;
}

/* Achievement Panel */
#achievement-panel {
	position: fixed;
	top: 0;
	right: 0;
	width: 90%;
	max-width: 500px;
	height: 100vh;
	background: var(--card, #161616);
	border-left: 1px solid var(--border, #262626);
	box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
	z-index: 1999;
	transform: translateX(100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

#achievement-panel.show {
	transform: translateX(0);
}

.panel-header {
	padding: 24px;
	border-bottom: 1px solid var(--border, #262626);
	background: rgba(0, 0, 0, 0.3);
}

.panel-title-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.panel-title {
	font-size: 20px;
	font-weight: 700;
	color: var(--text, #e5e5e5);
	margin: 0;
}

.panel-close {
	background: transparent;
	border: none;
	color: var(--muted, #a3a3a3);
	font-size: 24px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	transition: all 0.2s;
	line-height: 1;
}

.panel-close:hover {
	background: rgba(255, 107, 53, 0.1);
	color: #ff6b35;
}

.panel-close:focus-visible {
	outline: 2px solid #ff6b35;
	outline-offset: 2px;
}

.panel-progress-bar {
	width: 100%;
	height: 8px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 8px;
}

.panel-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #ff6b35 0%, #ff8c61 100%);
	transition: width 0.5s ease;
	border-radius: 4px;
}

.panel-subtitle {
	font-size: 14px;
	color: var(--muted, #a3a3a3);
	text-align: center;
}

.panel-achievements {
	flex: 1;
	overflow-y: auto;
	padding: 16px 24px;
}

.achievement-card {
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid var(--border, #262626);
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 12px;
	display: flex;
	gap: 12px;
	transition: all 0.3s ease;
}

.achievement-card.unlocked {
	border-color: rgba(255, 107, 53, 0.3);
	background: rgba(255, 107, 53, 0.05);
}

.achievement-card.unlocked:hover {
	transform: translateX(4px);
	border-color: rgba(255, 107, 53, 0.5);
}

.achievement-card.locked {
	opacity: 0.6;
}

.achievement-icon {
	font-size: 32px;
	flex-shrink: 0;
}

.achievement-content {
	flex: 1;
}

.achievement-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 4px;
}

.achievement-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--text, #e5e5e5);
}

.achievement-xp {
	font-size: 12px;
	color: #FFD700;
	font-weight: 600;
}

.achievement-description {
	font-size: 13px;
	color: var(--muted, #a3a3a3);
	margin-bottom: 8px;
	line-height: 1.4;
}

.achievement-progress-bar {
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 2px;
	overflow: hidden;
	margin-bottom: 4px;
}

.achievement-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #ff6b35 0%, #ff8c61 100%);
	transition: width 0.5s ease;
	border-radius: 2px;
}

.achievement-progress-text {
	font-size: 11px;
	color: var(--muted, #a3a3a3);
}

.panel-footer {
	padding: 16px 24px;
	border-top: 1px solid var(--border, #262626);
	background: rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.panel-stats {
	font-size: 12px;
	color: var(--muted, #a3a3a3);
	text-align: center;
}

.panel-reset {
	width: 100%;
	padding: 10px 16px;
	background: rgba(255, 107, 53, 0.1);
	border: 1px solid rgba(255, 107, 53, 0.3);
	color: #ff6b35;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
}

.panel-reset:hover {
	background: rgba(255, 107, 53, 0.2);
	border-color: rgba(255, 107, 53, 0.5);
	transform: translateY(-1px);
}

.panel-reset:focus-visible {
	outline: 2px solid #ff6b35;
	outline-offset: 2px;
}

.panel-reset:active {
	transform: translateY(0);
}

/* Completionist Modal */
.completionist-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(10px);
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
	padding: 20px;
}

.completionist-modal.show {
	opacity: 1;
}

.completionist-content {
	background: linear-gradient(135deg, #161616 0%, #262626 100%);
	border: 2px solid #ff6b35;
	border-radius: 16px;
	padding: 40px;
	max-width: 500px;
	width: 100%;
	text-align: center;
	box-shadow: 0 20px 60px rgba(255, 107, 53, 0.4);
	transform: scale(0.9);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.completionist-modal.show .completionist-content {
	transform: scale(1);
}

.completionist-title {
	font-size: 28px;
	font-weight: 700;
	color: #ff6b35;
	margin-bottom: 20px;
}

.completionist-text {
	font-size: 16px;
	color: #e5e5e5;
	line-height: 1.6;
	margin-bottom: 16px;
}

.completionist-subtext {
	font-size: 14px;
	color: #a3a3a3;
}

.completionist-email {
	background: rgba(255, 107, 53, 0.1);
	border: 1px solid rgba(255, 107, 53, 0.3);
	border-radius: 8px;
	padding: 16px;
	margin: 20px 0;
}

.completionist-email-link {
	font-size: 18px;
	font-weight: 600;
	color: #ff6b35;
	text-decoration: none;
	transition: color 0.2s;
}

.completionist-email-link:hover {
	color: #ff8c61;
	text-decoration: underline;
}

.completionist-close {
	background: #ff6b35;
	color: white;
	border: none;
	border-radius: 8px;
	padding: 12px 32px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	margin-top: 20px;
}

.completionist-close:hover {
	background: #ff8c61;
	transform: scale(1.05);
}

.completionist-close:focus-visible {
	outline: 2px solid #ff6b35;
	outline-offset: 2px;
}

/* Light mode support */
@media (prefers-color-scheme: light) {
	#achievement-tracker {
		background: rgba(255, 255, 255, 0.9);
		color: #1a1a1a;
	}

	.achievement-toast {
		background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
		color: #1a1a1a;
	}

	.toast-description,
	.toast-progress {
		color: #6b7280;
	}

	.achievement-card {
		background: rgba(255, 255, 255, 0.5);
	}

	.achievement-card.unlocked {
		background: rgba(255, 107, 53, 0.1);
	}

	.completionist-content {
		background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	}

	.completionist-text {
		color: #1a1a1a;
	}
}

/* Mobile responsive */
@media (max-width: 768px) {
	#achievement-tracker {
		top: 10px;
		left: 10px;
		padding: 10px 16px;
		font-size: 13px;
	}

	.tracker-icon {
		font-size: 16px;
	}

	.achievement-toast {
		width: calc(100% - 20px);
		right: 10px;
		top: 60px;
	}

	#achievement-panel {
		width: 100%;
		max-width: 100%;
	}

	.panel-header,
	.panel-achievements,
	.panel-footer {
		padding: 16px;
	}

	.achievement-card {
		padding: 12px;
	}

	.completionist-content {
		padding: 24px;
	}

	.completionist-title {
		font-size: 22px;
	}

	.completionist-text {
		font-size: 14px;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	#achievement-tracker,
	.achievement-toast,
	#achievement-panel,
	#achievement-backdrop,
	.achievement-card,
	.completionist-modal,
	.completionist-content,
	.achievement-reset-modal,
	.reset-modal-content {
		transition-duration: 0.01ms;
		animation: none;
	}
}

/* Reset Modal */
.achievement-reset-modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(4px);
	z-index: 10001;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.achievement-reset-modal.show {
	opacity: 1;
}

.reset-modal-content {
	background: #1a1a1a;
	border-radius: 16px;
	padding: 32px;
	max-width: 360px;
	text-align: center;
	transform: scale(0.9);
	transition: transform 0.3s ease;
	border: 1px solid rgba(255, 107, 53, 0.3);
}

.achievement-reset-modal.show .reset-modal-content {
	transform: scale(1);
}

.reset-modal-icon {
	font-size: 48px;
	margin-bottom: 16px;
}

.reset-modal-title {
	color: #fff;
	font-size: 20px;
	margin: 0 0 12px 0;
}

.reset-modal-text {
	color: #aaa;
	font-size: 14px;
	margin: 0 0 24px 0;
	line-height: 1.5;
}

.reset-modal-buttons {
	display: flex;
	gap: 12px;
	justify-content: center;
}

.reset-modal-btn {
	padding: 10px 24px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
}

.reset-modal-cancel {
	background: #333;
	color: #fff;
}

.reset-modal-cancel:hover {
	background: #444;
}

.reset-modal-confirm {
	background: #ff4444;
	color: #fff;
}

.reset-modal-confirm:hover {
	background: #ff5555;
}
