/**
 * Custom Theme - Green Color Scheme (#1fad80)
 * Based on HTML5Games default theme
 */

:root {
	--primary: #1fad80;
	--primary-dark: #158b5e;
	--primary-light: #2fcea0;
	--secondary: #0d4d38;
	--accent: #3dd9a3;
	--background: #f0f7f4;
	--surface: #ffffff;
	--text-primary: #0d3d2e;
	--text-secondary: #1a5c47;
	--text-muted: #5a8f7a;
	--border: #c4ddd5;
	--shadow: rgba(31, 173, 128, 0.15);
	--overlay: rgba(31, 173, 128, 0.1);
}

/* Reset and Base */
*, *::before, *::after {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	background-color: var(--background);
	color: var(--text-primary);
}

/* App Container */
.app-container {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--background);
}

#app {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Header Styles */
header.main {
	background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 50%, var(--primary) 100%);
	padding: 0;
	box-shadow: 0 4px 20px var(--shadow);
	position: relative;
}

header.main::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -20%;
	width: 60%;
	height: 200%;
	background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
	pointer-events: none;
}

header.main .main-section {
	max-width: 1400px;
	margin: 0 auto;
	padding: 1rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
	z-index: 1;
}

/* Logo */
.logo {
	display: flex;
	align-items: center;
	text-decoration: none;
	flex-shrink: 0;
}

.logo svg {
	height: 60px;
	width: auto;
}

.logo:hover {
	opacity: 0.9;
}

/* Menu Holder */
.menuHolder {
	display: flex;
	align-items: center;
}

#navigationTrigger {
	display: none;
}

.openIcon {
	display: none;
	cursor: pointer;
	padding: 8px;
	border-radius: 8px;
	transition: background 0.3s;
}

.openIcon:hover {
	background: var(--overlay);
}

.openIcon svg {
	width: 28px;
	height: 28px;
	fill: white;
}

/* Navigation */
nav.main {
	display: none;
	align-items: center;
}

@media (min-width: 769px) {
	nav.main {
		display: flex;
	}
}

nav.main ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

nav.main li {
	margin: 0;
}

nav.main a {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	color: white;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	border-radius: 8px;
	transition: all 0.3s ease;
	background: rgba(255,255,255,0.1);
	border: 1px solid rgba(255,255,255,0.2);
}

nav.main a:hover {
	background: rgba(255,255,255,0.25);
	border-color: rgba(255,255,255,0.4);
	transform: translateY(-2px);
}

nav.main a i {
	width: 18px;
	height: 18px;
}

/* Language Select */
.language-select {
	position: relative;
}

.language-select .value {
	padding: 10px 16px;
	background: rgba(255,255,255,0.15);
	border: 1px solid rgba(255,255,255,0.3);
	border-radius: 8px;
	color: white;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s;
}

.language-select .value:hover {
	background: rgba(255,255,255,0.25);
}

.language-select select {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

/* Content Area */
.content {
	flex: 1;
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem 1.5rem;
	width: 100%;
}

/* Footer */
footer.main {
	background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
	padding: 2rem 1.5rem;
	margin-top: auto;
}

footer.main .main-section {
	max-width: 1400px;
	margin: 0 auto;
}

footer.main nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1rem 2rem;
}

footer.main nav a {
	color: rgba(255,255,255,0.8);
	text-decoration: none;
	font-size: 13px;
	transition: color 0.3s;
}

footer.main nav a:hover {
	color: white;
	text-decoration: underline;
}

footer.main .copyright {
	text-align: center;
	color: rgba(255,255,255,0.6);
	font-size: 12px;
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255,255,255,0.1);
}

/* Games List */
.games {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.5rem;
}

.games li {
	margin: 0;
}

.games a {
	display: block;
	text-decoration: none;
	color: inherit;
	background: var(--surface);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px var(--shadow);
	transition: all 0.3s ease;
	border: 1px solid var(--border);
}

.games a:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px var(--shadow);
	border-color: var(--primary);
}

.games .icon {
	position: relative;
	aspect-ratio: 16/10;
	overflow: hidden;
	background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.games .icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.games a:hover .icon img {
	transform: scale(1.05);
}

.games .clamp {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 40px;
	background: linear-gradient(transparent, rgba(0,0,0,0.3));
}

.games .name-container {
	padding: 1rem;
}

.games .name {
	font-size: 14px;
	font-weight: 600;
	color: var(--text-primary);
	text-align: center;
	margin: 0;
}

/* Tile List */
.tile-list {
	list-style: none;
	margin: 2rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
}

.tile-neutral {
	display: block;
	background: var(--surface);
	border-radius: 12px;
	padding: 1.5rem;
	text-decoration: none;
	color: var(--text-primary);
	text-align: center;
	border: 1px solid var(--border);
	transition: all 0.3s ease;
}

.tile-neutral:hover {
	border-color: var(--primary);
	box-shadow: 0 4px 16px var(--shadow);
	transform: translateY(-2px);
}

.tile-neutral img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin-bottom: 0.75rem;
}

.tile-neutral header {
	font-size: 14px;
	font-weight: 600;
	margin: 0.5rem 0;
	color: var(--primary-dark);
}

.tile-neutral p {
	font-size: 12px;
	color: var(--text-muted);
	margin: 0;
}

/* Section Headers */
h1 {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--secondary);
	margin: 0 0 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 3px solid var(--primary);
}

h1 i {
	width: 32px;
	height: 32px;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

h1 i::before {
	color: white;
	font-size: 18px;
}

/* Hot Badge */
.hot {
	position: absolute;
	top: 8px;
	right: 8px;
	background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
	color: white;
	font-size: 10px;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 20px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 2px 8px rgba(238, 90, 90, 0.4);
	z-index: 2;
}

/* New Badge */
.new {
	position: absolute;
	top: 8px;
	right: 8px;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
	color: white;
	font-size: 10px;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 20px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	box-shadow: 0 2px 8px var(--shadow);
	z-index: 2;
}

/* Responsive */
@media (max-width: 768px) {
	header.main .main-section {
		flex-wrap: wrap;
		gap: 1rem;
	}
	
	.menuHolder {
		order: 2;
	}
	
	.openIcon {
		display: none;
	}

	#menuToggle {
		display: block;
		cursor: pointer;
		padding: 8px;
		border-radius: 8px;
		transition: background 0.3s;
	}

	#menuToggle:hover {
		background: var(--overlay);
	}

	#menuToggle svg {
		width: 28px;
		height: 28px;
		fill: white;
	}

	#mobileNav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--secondary);
		padding: 1rem;
		box-shadow: 0 4px 12px rgba(0,0,0,0.2);
		z-index: 9999;
	}

	#mobileNav ul {
		flex-direction: column;
	}

	#mobileNav a {
		padding: 12px 16px;
	}
	
	.logo {
		order: 1;
		flex: 1;
	}
	
	.logo svg {
		height: 50px;
	}
	
	.language-select {
		order: 3;
	}
	
	.content {
		padding: 1.5rem 1rem;
	}
	
	.games {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 1rem;
	}
	
	h1 {
		font-size: 1.5rem;
	}

	/* Detail page background */
	.game .background {
		width: 100%;
		max-width: 100%;
		background-size: cover;
		background-position: center;
		min-height: 200px;
	}

	.game .background img {
		max-width: 100%;
		height: auto;
	}

	.game .background .icon img {
		max-width: 120px;
		height: auto;
	}
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Icon Styles (Base64 encoded inline) */
.icon-home::before { content: '🏠'; }
.icon-category-new::before { content: '✨'; }
.icon-category-best::before { content: '⭐'; }
.icon-category-match3::before { content: '💎'; }
.icon-category-bubble_shooter::before { content: '🫧'; }
.icon-category-puzzle::before { content: '🧩'; }
.icon-category-quiz::before { content: '❓'; }
.icon-category-cards::before { content: '🎴'; }
.icon-category-girls::before { content: '👧'; }
.icon-category-jumpnrun::before { content: '🏃'; }
.icon-category-spaceshooter::before { content: '🚀'; }
.icon-category-racing::before { content: '🏎️'; }
.icon-category-sport::before { content: '⚽'; }
.icon-category-multiplayer::before { content: '👥'; }
.icon-list::before { content: '📋'; }

/* Powered By */
.powered-by-famobi {
	text-align: center;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid rgba(255,255,255,0.1);
	font-size: 11px;
	color: rgba(255,255,255,0.5);
}

.powered-by-famobi a {
	color: rgba(255,255,255,0.7);
}

/* Meta Navigation */
.meta nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1.5rem;
}

.meta nav a {
	color: rgba(255,255,255,0.7);
	text-decoration: none;
	font-size: 12px;
}

.meta nav a:hover {
	color: white;
	text-decoration: underline;
}
