/* Gamified Exercises CSS */

.game-exercise-wrapper {
	margin: 2.5rem 0;
	background-color: var(--background);
	border: 1px solid var(--border);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
	transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.game-exercise-wrapper:hover {
	box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.1), 0 8px 15px -6px rgba(99, 102, 241, 0.05);
	border-color: rgba(99, 102, 241, 0.3);
}

.game-exercise-header {
	background-color: #1e293b; /* Dark theme looking header */
	color: #fff;
	padding: 1rem 1.5rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.game-exercise-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.game-exercise-title svg {
	color: #eab308; /* yellow for game icon */
}

.game-xp-badge {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 99px;
	padding: 4px 10px;
	font-size: 0.75rem;
	font-weight: 700;
	color: #fbbf24;
	display: flex;
	align-items: center;
	gap: 4px;
}

.game-exercise-body {
	padding: 1.5rem;
	background-color: #0f172a; /* Code block dark bg */
	color: #e2e8f0;
	font-family: 'Fira Code', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
	font-size: 0.95rem;
	line-height: 1.8;
	overflow-x: auto;
}

.game-exercise-instruction {
	margin-bottom: 1.5rem;
	background: rgba(99, 102, 241, 0.1);
	border-left: 4px solid #6366f1;
	padding: 12px 16px;
	border-radius: 4px;
	color: #fff;
	font-family: var(--font-sans);
}

.game-input {
	background: #1e293b;
	border: 1px solid #475569;
	color: #38bdf8;
	font-family: inherit;
	font-size: inherit;
	padding: 2px 8px;
	border-radius: 4px;
	text-align: center;
	outline: none;
	width: auto;
	min-width: 40px;
	transition: all 0.2s ease;
	vertical-align: middle;
}

.game-input:focus {
	border-color: #38bdf8;
	box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.game-input.correct {
	background: rgba(34, 197, 94, 0.1);
	border-color: #22c55e;
	color: #22c55e;
}

.game-input.wrong {
	background: rgba(239, 68, 68, 0.1);
	border-color: #ef4444;
	color: #ef4444;
	animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
	10%, 90% { transform: translate3d(-1px, 0, 0); }
	20%, 80% { transform: translate3d(2px, 0, 0); }
	30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
	40%, 60% { transform: translate3d(4px, 0, 0); }
}

.game-exercise-footer {
	padding: 1rem 1.5rem;
	background-color: var(--muted);
	border-top: 1px solid var(--border);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.game-btn {
	padding: 8px 16px;
	border-radius: 6px;
	font-weight: 600;
	font-size: 0.875rem;
	cursor: pointer;
	border: none;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.game-btn-submit {
	background-color: #22c55e;
	color: white;
	box-shadow: 0 4px 0 #16a34a;
}

.game-btn-submit:hover {
	background-color: #16a34a;
}

.game-btn-submit:active {
	box-shadow: 0 0 0 #16a34a;
	transform: translateY(4px);
}

.game-btn-show {
	background-color: transparent;
	color: var(--muted-foreground);
}

.game-btn-show:hover {
	color: var(--foreground);
	background-color: rgba(0,0,0,0.05);
}

.game-feedback {
	font-size: 0.875rem;
	font-weight: 600;
	margin-left: 10px;
	opacity: 0;
	transform: translateX(-10px);
	transition: all 0.3s ease;
}

.game-feedback.show-correct {
	opacity: 1;
	transform: translateX(0);
	color: #22c55e;
}

.game-feedback.show-wrong {
	opacity: 1;
	transform: translateX(0);
	color: #ef4444;
}

/* Global Level floating widget */
#global-level-widget {
	position: fixed;
	bottom: 20px;
	left: 20px;
	background: rgba(15, 23, 42, 0.9);
	backdrop-filter: blur(8px);
	border: 1px solid rgba(255, 255, 255, 0.1);
	color: white;
	padding: 10px 16px;
	border-radius: 12px;
	box-shadow: 0 10px 25px rgba(0,0,0,0.2);
	display: flex;
	align-items: center;
	gap: 12px;
	z-index: 50;
	transform: translateY(100px);
	opacity: 0;
	transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#global-level-widget.visible {
	transform: translateY(0);
	opacity: 1;
}

.gl-icon {
	background: linear-gradient(135deg, #f59e0b, #d97706);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: white;
}

.gl-text {
	display: flex;
	flex-direction: column;
}

.gl-title {
	font-size: 0.75rem;
	color: #cbd5e1;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
}

.gl-xp {
	font-size: 0.9rem;
	font-weight: 700;
	color: #38bdf8;
}
