/* Frontend Styles */

.sharpbrain-games-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 20px;
	margin: 20px 0;
}

.sharpbrain-games-gallery[data-cols="2"] {
	grid-template-columns: repeat(2, 1fr);
}

.sharpbrain-games-gallery[data-cols="3"] {
	grid-template-columns: repeat(3, 1fr);
}

.sharpbrain-games-gallery[data-cols="4"] {
	grid-template-columns: repeat(4, 1fr);
}

.game-card {
	background: white;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 20px;
	transition: all 0.3s ease;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.game-card:hover {
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
	transform: translateY(-5px);
}

.game-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 15px;
}

.game-header h3 {
	margin: 0;
	font-size: 18px;
	color: #333;
}

.category-badge {
	background: #0073aa;
	color: white;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: bold;
}

.game-description {
	color: #666;
	font-size: 14px;
	margin-bottom: 15px;
	line-height: 1.5;
}

.btn-launch-game,
.btn-play {
	background: #0073aa;
	color: white;
	border: none;
	padding: 10px 20px;
	border-radius: 5px;
	cursor: pointer;
	font-size: 14px;
	font-weight: bold;
	transition: all 0.3s ease;
	width: 100%;
	text-align: center;
	display: inline-block;
	text-decoration: none;
}

.btn-launch-game:hover,
.btn-play:hover {
	background: #005a87;
	transform: scale(1.02);
}

/* Games Gallery */
.sharpbrain-games-wrapper {
	margin: 20px 0;
}

.category-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 30px;
}

.filter-btn {
	background: #f1f1f1;
	border: 2px solid #ddd;
	padding: 8px 16px;
	border-radius: 25px;
	cursor: pointer;
	font-weight: 500;
	transition: all 0.3s ease;
}

.filter-btn:hover {
	border-color: #0073aa;
}

.filter-btn.active {
	background: #0073aa;
	color: white;
	border-color: #0073aa;
}

.games-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 20px;
}

.games-grid[data-cols="2"] {
	grid-template-columns: repeat(2, 1fr);
}

.games-grid[data-cols="3"] {
	grid-template-columns: repeat(3, 1fr);
}

.game-item {
	background: white;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.game-item.hidden {
	display: none;
}

.game-thumbnail {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 30px 20px;
	text-align: center;
}

.game-thumbnail h4 {
	margin: 0 0 10px 0;
	font-size: 18px;
}

.game-category {
	margin: 0;
	font-size: 12px;
	opacity: 0.9;
}

.game-info {
	padding: 15px;
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}

.game-info p {
	margin: 0 0 15px 0;
	color: #666;
	font-size: 14px;
	flex-grow: 1;
}

/* Modal Styles */
.sharpbrain-game-modal {
	position: fixed;
	z-index: 9999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
}

.modal-content {
	background: white;
	margin: 5% auto;
	padding: 20px;
	border-radius: 8px;
	width: 90%;
	max-width: 900px;
	position: relative;
	max-height: 80vh;
	overflow-y: auto;
}

.close-modal {
	position: absolute;
	right: 20px;
	top: 20px;
	font-size: 28px;
	font-weight: bold;
	cursor: pointer;
	color: #333;
}

.close-modal:hover {
	color: #000;
}

#game-container {
	text-align: center;
}

#game-container iframe {
	width: 100%;
	max-width: 100%;
	height: 600px;
	border: none;
	border-radius: 5px;
}

.game-modal-gallery {
	position: fixed;
	z-index: 9999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.8);
	display: flex;
	flex-direction: column;
}

.modal-header {
	background: white;
	padding: 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.modal-header h2 {
	margin: 0;
	font-size: 24px;
}

.close-btn {
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: #333;
}

.modal-body {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
}

#game-iframe {
	border: none;
}

/* Widget Styles */
.sharpbrain-widget-games {
	background: #f5f5f5;
	padding: 15px;
	border-radius: 5px;
}

.widget-game-item {
	margin-bottom: 15px;
	padding-bottom: 15px;
	border-bottom: 1px solid #ddd;
}

.widget-game-item:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.widget-game-item h5 {
	margin: 0 0 5px 0;
	font-size: 14px;
	color: #333;
}

.game-cat {
	margin: 0 0 10px 0;
	font-size: 12px;
	color: #999;
}

.widget-game-link {
	display: inline-block;
	background: #0073aa;
	color: white;
	padding: 5px 15px;
	border-radius: 3px;
	text-decoration: none;
	font-size: 12px;
	font-weight: bold;
	transition: all 0.3s ease;
}

.widget-game-link:hover {
	background: #005a87;
	text-decoration: none;
}

/* Embed Styles */
.sharpbrain-game-embed {
	position: relative;
	width: 100%;
	margin: 20px 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sharpbrain-game-embed iframe {
	border: none;
	border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.sharpbrain-games-gallery,
	.games-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	}

	.games-grid[data-cols="2"],
	.games-grid[data-cols="3"],
	.games-grid[data-cols="4"] {
		grid-template-columns: 1fr;
	}

	.game-card,
	.game-item {
		padding: 15px;
	}

	.category-filters {
		flex-wrap: wrap;
	}

	.filter-btn {
		padding: 6px 12px;
		font-size: 13px;
	}

	.modal-content {
		width: 95%;
		margin: 20% auto;
	}

	#game-container iframe {
		height: 400px;
	}

	.modal-body {
		padding: 10px;
	}
}

@media (max-width: 480px) {
	.modal-content {
		width: 98%;
		padding: 10px;
		margin: 30% auto;
	}

	#game-container iframe {
		height: 300px;
	}

	.game-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.category-badge {
		margin-top: 10px;
	}
}
