/**
 * Stylesheet for IGDB Weekly Releases
 * Premium, modern, responsive aesthetics
 */

:root {
	/* Colors */
	--igdb-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	/* Uniform deep violet and orange theme */
	--igdb-bg: #0f0023;
	--igdb-card-bg: #1a0933;
	--igdb-text: #ffffff;
	--igdb-text-muted: #b2a1cc;
	--igdb-border: rgba(255, 78, 0, 0.15);
	--igdb-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
	
	/* Badges & Accents */
	--igdb-rating-high: #10b981;
	--igdb-rating-med: #f59e0b;
	--igdb-rating-low: #ef4444;
	
	/* Platforms Colors */
	--igdb-badge-pc: #475569;
	--igdb-badge-ps5: #0070d1;
	--igdb-badge-xbox: #107c10;
	--igdb-badge-switch: #e60012;
}

/* Main Wrapper */
.igdb-wr-wrapper {
	font-family: var(--igdb-font-family);
	color: var(--igdb-text);
	background: var(--igdb-bg);
	padding: 24px;
	border-radius: 20px;
	border: 1px solid var(--igdb-border);
	box-shadow: var(--igdb-shadow);
	margin: 20px 0;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.igdb-wr-header {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 24px;
	gap: 16px;
}

.igdb-wr-week-label {
	font-size: 1.25rem;
	font-weight: 700;
	margin: 0;
	text-align: center;
	color: var(--igdb-text);
	letter-spacing: -0.025em;
}

/* Grid Container */
.igdb-wr-grid-container {
	position: relative;
	min-height: 300px;
	transition: opacity 0.25s ease;
}

.igdb-wr-grid-container.loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Grid System changed to single column layout */
.igdb-wr-grid {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Game Card in List Style */
.igdb-wr-card {
	background: var(--igdb-card-bg);
	border: 1px solid var(--igdb-border);
	border-radius: var(--igdb-radius-card);
	box-shadow: var(--igdb-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: row; /* Horizontal */
	height: 350px;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	position: relative;
	box-sizing: border-box;
}

.igdb-wr-card:hover {
	transform: translateY(-2px) scale(1.005);
	border-color: rgba(var(--igdb-primary-rgb), 0.5);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.7);
}

/* Image Wrapper & Badges */
.igdb-wr-card-image-wrapper {
	position: relative;
	width: 280px; /* Increased from 250px */
	height: 100%;
	flex-shrink: 0;
	background: #190a33;
	overflow: hidden;
}

.igdb-wr-card-image {
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	border-radius: 0 !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	display: block !important;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.igdb-wr-card:hover .igdb-wr-card-image {
	transform: scale(1.05);
}

.igdb-wr-card-image-placeholder {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #1d0f3c;
	color: var(--igdb-text-muted);
	font-weight: 600;
	font-size: 0.8rem;
	text-align: center;
}

/* Ratings Badge */
.igdb-wr-card-rating {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-weight: 700;
	font-size: 0.8rem;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
	z-index: 2;
}

.igdb-wr-card-rating.high { background-color: var(--igdb-rating-high); }
.igdb-wr-card-rating.medium { background-color: var(--igdb-rating-med); }
.igdb-wr-card-rating.low { background-color: var(--igdb-rating-low); }

/* Date Badge */
.igdb-wr-card-date-badge {
	position: absolute;
	bottom: 10px;
	left: 10px;
	background: rgba(15, 23, 42, 0.85);
	backdrop-filter: blur(4px);
	color: #ffffff;
	padding: 4px 8px;
	border-radius: 6px;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	z-index: 2;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Card Info */
.igdb-wr-card-info {
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	justify-content: space-between;
	box-sizing: border-box;
	overflow: hidden;
}

.igdb-wr-card-title {
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 4px 0;
	color: var(--igdb-text);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.igdb-wr-card-genres {
	font-size: 0.8rem;
	color: var(--igdb-text-muted);
	margin-bottom: 0;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.igdb-wr-card-summary {
	font-size: 0.85rem;
	color: var(--igdb-text-muted);
	margin-top: 8px;
	margin-bottom: auto;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Card Footer */
.igdb-wr-card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
	gap: 12px;
}

.igdb-wr-card-platforms {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	max-height: 24px;
	overflow: hidden;
}

/* Platform Badges */
.igdb-wr-platform-badge {
	font-size: 0.65rem;
	font-weight: 700;
	padding: 3px 6px;
	border-radius: 4px;
	background: var(--igdb-border);
	color: var(--igdb-text);
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.igdb-wr-platform-badge.pc { background: rgba(255,255,255,0.08); color: #b2a1cc; }
.igdb-wr-platform-badge.ps5, .igdb-wr-platform-badge.playstation-5 { background: rgba(0, 112, 209, 0.15); color: #3b82f6; }
.igdb-wr-platform-badge.xbox-series-x-s, .igdb-wr-platform-badge.series-x { background: rgba(16, 124, 16, 0.15); color: #22c55e; }
.igdb-wr-platform-badge.nintendo-switch, .igdb-wr-platform-badge.switch { background: rgba(230, 0, 18, 0.15); color: #f87171; }
.igdb-wr-platform-badge.plus { background: var(--igdb-primary); color: #ffffff; }

/* Details Button */
.igdb-wr-details-btn {
	background: rgba(var(--igdb-primary-rgb), 0.1);
	border: none;
	color: var(--igdb-primary);
	width: 28px;
	height: 28px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.igdb-wr-card:hover .igdb-wr-details-btn {
	background: var(--igdb-primary);
	color: #ffffff;
}

/* Skeleton Loading State */
.igdb-wr-skeleton {
	animation: igdb-pulsing 1.5s infinite ease-in-out;
	background: linear-gradient(
		90deg,
		var(--igdb-border) 25%,
		var(--igdb-card-bg) 37%,
		var(--igdb-border) 63%
	);
	background-size: 400% 100%;
}

@keyframes igdb-pulsing {
	0% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

.igdb-wr-skeleton-image {
	width: 280px;
	height: 100%;
}

.igdb-wr-skeleton-title {
	height: 18px;
	border-radius: 4px;
	margin-bottom: 8px;
	width: 80%;
}

.igdb-wr-skeleton-genres {
	height: 12px;
	border-radius: 4px;
	width: 50%;
	margin-bottom: 20px;
}

.igdb-wr-skeleton-badge {
	height: 18px;
	width: 40px;
	border-radius: 4px;
}

/* No Releases Style */
.igdb-wr-no-releases {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 60px 20px;
	border: 2px dashed var(--igdb-border);
	border-radius: var(--igdb-radius-card);
	color: var(--igdb-text-muted);
}

.igdb-wr-no-releases-icon {
	color: var(--igdb-text-muted);
	margin-bottom: 16px;
	opacity: 0.6;
}

.igdb-wr-no-releases h3 {
	font-size: 1.2rem;
	font-weight: 700;
	color: var(--igdb-text);
	margin: 0 0 8px 0;
}

.igdb-wr-no-releases p {
	margin: 0;
	font-size: 0.9rem;
}

.igdb-wr-error {
	background: #fef2f2;
	border-left: 4px solid #ef4444;
	color: #b91c1c;
	padding: 16px;
	border-radius: 8px;
	font-size: 0.95rem;
	margin: 20px 0;
	font-weight: 500;
}

body.dark-theme .igdb-wr-error,
body.dark .igdb-wr-error {
	background: rgba(239, 68, 68, 0.1);
	border-color: #ef4444;
	color: #fca5a5;
}

/* ------------------------------------------------------------- */
/* CARD GALLERY SYSTEM                                           */
/* ------------------------------------------------------------- */
.igdb-wr-card-gallery {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding: 15px 20px 20px 20px;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	scrollbar-color: var(--igdb-border) transparent;
	background: rgba(0, 0, 0, 0.15);
	margin-top: 15px;
}

.igdb-wr-card-gallery::-webkit-scrollbar {
	height: 6px;
}

.igdb-wr-card-gallery::-webkit-scrollbar-thumb {
	background: var(--igdb-border);
	border-radius: 4px;
}

.igdb-wr-card-gallery .igdb-wr-gallery-img {
	width: 220px;
	height: 124px; /* 16:9 aspect ratio */
	object-fit: cover;
	border-radius: 8px;
	scroll-snap-align: start;
	flex-shrink: 0;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s ease;
	cursor: pointer;
}

.igdb-wr-card-gallery .igdb-wr-gallery-img:hover {
	transform: scale(1.03);
}

/* Gutenberg Editor Placeholder Styles */
.igdb-block-editor-placeholder {
	display: flex;
	align-items: center;
	gap: 20px;
	background: var(--igdb-card-bg, #ffffff);
	border: 2px dashed var(--igdb-border, #e2e8f0);
	border-radius: 16px;
	padding: 24px;
	color: var(--igdb-text, #0f172a);
	box-shadow: var(--igdb-shadow, 0 10px 15px -3px rgba(0, 0, 0, 0.05));
	margin: 15px 0;
	box-sizing: border-box;
}

.igdb-block-editor-placeholder .placeholder-icon {
	font-size: 36px;
	width: 36px;
	height: 36px;
	color: var(--igdb-primary, #6366f1);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.85;
}

.igdb-block-editor-placeholder .placeholder-text-wrap {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.igdb-block-editor-placeholder .placeholder-title {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0;
	color: var(--igdb-text, #0f172a);
	line-height: 1.2;
}

.igdb-block-editor-placeholder .placeholder-desc {
	font-size: 0.85rem;
	margin: 0;
	color: var(--igdb-text-muted, #64748b);
	line-height: 1.4;
}

/* Responsive Stack for Horizontal List Layout */
@media (max-width: 550px) {
	.igdb-wr-card {
		flex-direction: column;
		height: auto;
	}
	.igdb-wr-card-image-wrapper {
		width: 100%;
		padding-top: 133.33%; /* 3:4 Aspect Ratio for Covers */
		height: auto;
		position: relative;
	}
	.igdb-wr-card-image-wrapper img,
	.igdb-wr-card-image-wrapper .igdb-wr-card-image-placeholder {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
	}
	.igdb-wr-skeleton-image {
		width: 100%;
		padding-top: 133.33%;
		height: auto;
	}
	.igdb-wr-card-title {
		-webkit-line-clamp: 2; /* 2 lines on mobile stack */
	}
}


/* Card & Modal Store Squircles matching the screenshot exactly */
.igdb-wr-card-stores {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}

.igdb-wr-stores-label {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--igdb-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.igdb-wr-store-icons {
	display: flex;
	align-items: center;
	gap: 8px;
}

.igdb-wr-store-icon, .igdb-wr-store-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	color: #ffffff !important;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
	box-sizing: border-box;
	border: none !important;
}

.igdb-wr-store-icon svg, .igdb-wr-store-btn svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
	transition: transform 0.2s ease;
}

.igdb-wr-store-icon:hover, .igdb-wr-store-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 8px rgba(0, 0, 0, 0.5);
	filter: brightness(1.2); /* make the colored squares pop */
}

.igdb-wr-store-icon:hover svg, .igdb-wr-store-btn:hover svg {
	transform: scale(1.1);
}

/* Branded Background Colors matching the screenshot */
.igdb-wr-store-icon.steam, .igdb-wr-store-btn.steam { background-color: #000000; }
.igdb-wr-store-icon.playstation, .igdb-wr-store-btn.playstation { background-color: #003087; }
.igdb-wr-store-icon.xbox, .igdb-wr-store-btn.xbox { background-color: #107c10; }
.igdb-wr-store-icon.nintendo, .igdb-wr-store-btn.nintendo { background-color: #e60012; }
.igdb-wr-store-icon.epic-games, .igdb-wr-store-btn.epic-games { background-color: #2a2a2a; }
.igdb-wr-store-icon.gog, .igdb-wr-store-btn.gog { background-color: #5c2a8c; }
.igdb-wr-store-icon.google-play, .igdb-wr-store-btn.google-play { background-color: #2b394a; }
.igdb-wr-store-icon.app-store, .igdb-wr-store-btn.app-store { background-color: #111111; }
.igdb-wr-store-icon.official, .igdb-wr-store-btn.official { background-color: #4f46e5; }

/* ------------------------------------------------------------- */
/* LIGHTBOX SYSTEM                                               */
/* ------------------------------------------------------------- */
.igdb-wr-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 9999999;
	display: flex;
	align-items: center;
	justify-content: center;
	visibility: hidden;
	opacity: 0;
	transition: all 0.3s ease;
}

.igdb-wr-lightbox.open {
	visibility: visible;
	opacity: 1;
}

.igdb-wr-lightbox-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(10px);
	cursor: pointer;
}

.igdb-wr-lightbox-img {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 20px 40px rgba(0,0,0,0.5);
	z-index: 2;
	transform: scale(0.95);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.igdb-wr-lightbox.open .igdb-wr-lightbox-img {
	transform: scale(1);
}

.igdb-wr-lightbox-close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: rgba(255, 255, 255, 0.1);
	border: none;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #ffffff;
	z-index: 3;
	transition: all 0.2s ease;
}

.igdb-wr-lightbox-close:hover {
	background: var(--igdb-primary, #6366f1);
	transform: rotate(90deg);
}

.igdb-wr-lightbox-prev,
.igdb-wr-lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.1);
	border: none;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #ffffff;
	z-index: 3;
	transition: all 0.2s ease;
}

.igdb-wr-lightbox-prev {
	left: 20px;
}

.igdb-wr-lightbox-next {
	right: 20px;
}

.igdb-wr-lightbox-prev:hover,
.igdb-wr-lightbox-next:hover {
	background: var(--igdb-primary, #6366f1);
	transform: translateY(-50%) scale(1.1);
}
