/**
 * Gymworx Holographic Card Styles
 *
 * Based on Brand Bible Variant D — Holographic.
 * Prefixed with .gw-holo to avoid collisions.
 */

/* ========== Base Card ========== */
.gw-holo {
	display: flex;
	flex-direction: column;
	position: relative;
	background: #0c0c0c;
	border-radius: 12px;
	overflow: hidden;
	transform-style: preserve-3d;
	transition: transform 0.3s ease;
}

/* Aspect ratios */
.gw-holo--4-5 {
	aspect-ratio: 4 / 5;
}

.gw-holo--square {
	aspect-ratio: 1 / 1;
}

.gw-holo--auto {
	aspect-ratio: auto;
}

/* ========== Holographic shimmer (::before) ========== */
.gw-holo::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 12px;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(
		135deg,
		rgba(132, 117, 78, 0.0) 0%,
		rgba(168, 151, 106, 0.08) 20%,
		rgba(200, 180, 140, 0.12) 30%,
		rgba(132, 117, 78, 0.0) 45%,
		rgba(180, 160, 120, 0.06) 55%,
		rgba(220, 200, 160, 0.1) 65%,
		rgba(132, 117, 78, 0.0) 80%,
		rgba(168, 151, 106, 0.08) 100%
	);
	background-size: 300% 300%;
	animation: gwHoloShimmer 6s ease-in-out infinite;
	mix-blend-mode: screen;
}

/* ========== Mouse-follow glow (::after) ========== */
.gw-holo::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 12px;
	z-index: 3;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.4s ease;
	background: radial-gradient(
		circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
		rgba(168, 151, 106, 0.25) 0%,
		rgba(200, 180, 140, 0.12) 20%,
		rgba(220, 200, 160, 0.06) 40%,
		transparent 60%
	);
}

.gw-holo:hover::after {
	opacity: 1;
}

/* ========== Animated border ========== */
.gw-holo-border {
	position: absolute;
	inset: 0;
	border-radius: 12px;
	z-index: 4;
	pointer-events: none;
	padding: 1px;
	background: linear-gradient(
		var(--holo-angle, 135deg),
		rgba(132, 117, 78, 0.15),
		rgba(168, 151, 106, 0.4),
		rgba(220, 200, 160, 0.5),
		rgba(255, 255, 255, 0.3),
		rgba(220, 200, 160, 0.5),
		rgba(168, 151, 106, 0.4),
		rgba(132, 117, 78, 0.15)
	);
	background-size: 400% 400%;
	animation: gwHoloBorder 5s ease-in-out infinite;
	-webkit-mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
}

/* ========== Keyframes ========== */
@keyframes gwHoloShimmer {
	0%   { background-position: 0% 50%; }
	50%  { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

@keyframes gwHoloBorder {
	0%   { background-position: 100% 100%, 0% 50%; }
	50%  { background-position: 100% 100%, 100% 50%; }
	100% { background-position: 100% 100%, 0% 50%; }
}

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

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

/* ========== Static mode (holo effect disabled) ========== */
.gw-holo--static::before,
.gw-holo--static::after {
	display: none;
}

.gw-holo--static .gw-holo-border {
	animation: none;
}

.gw-holo--static .gw-holo-name {
	background: none;
	-webkit-background-clip: unset;
	-webkit-text-fill-color: #ffffff;
	background-clip: unset;
	animation: none;
}

.gw-holo--static .gw-holo-line {
	background: rgba(132, 117, 78, 0.4);
	animation: none;
}

.gw-holo--static .gw-holo-avatar {
	animation: none;
}

.gw-holo--static .gw-holo-spec-box::before {
	animation: none;
}

/* ========== Shared atoms ========== */
.gw-holo-pill {
	font-family: var(--gw-font-body);
	font-weight: 500;
	font-size: 0.55rem;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	padding: 5px 14px;
	border-radius: 20px;
	display: inline-block;
	background: linear-gradient(135deg, rgba(132, 117, 78, 0.15), rgba(220, 200, 160, 0.15));
	color: #a8976a;
	border: 1px solid rgba(168, 151, 106, 0.25);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.gw-holo-name {
	font-family: var(--gw-font-heading);
	font-weight: 700;
	font-size: 3.2rem;
	letter-spacing: 3px;
	text-transform: uppercase;
	line-height: 1;
	margin-bottom: 16px;
	background: linear-gradient(
		135deg,
		#ffffff 0%,
		#a8976a 40%,
		#ffffff 60%,
		#a8976a 100%
	);
	background-size: 200% 200%;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	animation: gwHoloText 4s ease-in-out infinite;
}

.gw-holo-line {
	width: 40px;
	height: 1.5px;
	margin-bottom: 16px;
	background: linear-gradient(90deg, #84754E, rgba(220, 200, 160, 0.6), #84754E);
	background-size: 200% 100%;
	animation: gwHoloLine 3s ease-in-out infinite;
	border-radius: 1px;
}

.gw-holo-handle {
	font-family: var(--gw-font-body);
	font-weight: 400;
	font-size: 0.68rem;
	color: rgba(168, 151, 106, 0.4);
}

.gw-holo-label {
	font-family: var(--gw-font-heading);
	font-weight: 500;
	font-size: 0.9rem;
	letter-spacing: 5px;
	text-transform: uppercase;
	color: rgba(168, 151, 106, 0.6);
	line-height: 1;
	margin-bottom: 4px;
}

/* ========== INTRO variant (photo card with gradient) ========== */
.gw-holo-intro {
	justify-content: flex-end;
}

.gw-holo-intro .gw-holo-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	z-index: 0;
}

.gw-holo-grad {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		to top,
		#0c0c0c 0%,
		rgba(12, 12, 12, 0.85) 30%,
		rgba(12, 12, 12, 0.4) 60%,
		rgba(12, 12, 12, 0.15) 100%
	);
}

.gw-holo-top-bar {
	position: absolute;
	top: 24px;
	left: 28px;
	right: 28px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 5;
}

.gw-holo-content {
	position: relative;
	z-index: 5;
	padding: 28px;
}

.gw-holo-creds {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 16px;
}

/* ========== ABOUT variant (detail card) ========== */
.gw-holo-about {
	padding: 32px 28px;
	background: linear-gradient(160deg, #0c0c0c 0%, #111110 50%, #0c0c0c 100%);
}

.gw-holo-about > :not(.gw-holo-border) {
	position: relative;
	z-index: 5;
}

.gw-holo-about-header {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 24px;
}

.gw-holo-avatar {
	width: 54px !important;
	height: 54px !important;
	min-width: 54px;
	min-height: 54px;
	aspect-ratio: 1 / 1;
	border-radius: 50% !important;
	object-fit: cover;
	object-position: center top;
	flex-shrink: 0;
	border: 2px solid transparent;
	background:
		linear-gradient(#0c0c0c, #0c0c0c) padding-box,
		linear-gradient(135deg, #84754E, #a8976a, rgba(220, 200, 160, 0.8), #84754E) border-box;
	background-size: 100% 100%, 300% 300%;
	animation: gwHoloBorder 5s ease-in-out infinite;
}

.gw-holo-header-name {
	font-family: var(--gw-font-heading);
	font-weight: 700;
	font-size: 1.2rem;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #ffffff;
	line-height: 1;
}

.gw-holo-header-role {
	font-family: var(--gw-font-body);
	font-weight: 400;
	font-size: 0.65rem;
	color: #84754E;
	margin-top: 4px;
}

.gw-holo-body {
	font-family: var(--gw-font-body);
	font-weight: 300;
	font-size: 0.76rem;
	color: #b0b0b0;
	line-height: 1.75;
	margin-bottom: 24px;
}

.gw-holo-spec-box {
	position: relative;
	border-radius: 10px;
	padding: 18px 20px;
	margin-bottom: auto;
	background: rgba(12, 12, 12, 0.6);
	border: 1px solid transparent;
	background-clip: padding-box;
	overflow: hidden;
}

.gw-holo-spec-box::before {
	content: '';
	position: absolute;
	inset: -1px;
	border-radius: 11px;
	z-index: -1;
	background: linear-gradient(
		135deg,
		rgba(132, 117, 78, 0.2),
		rgba(168, 151, 106, 0.35),
		rgba(220, 200, 160, 0.2),
		rgba(132, 117, 78, 0.15)
	);
	background-size: 300% 300%;
	animation: gwHoloShimmer 6s ease-in-out infinite;
}

.gw-holo-spec-title {
	font-family: var(--gw-font-heading);
	font-weight: 600;
	font-size: 0.68rem;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #a8976a;
	margin-bottom: 8px;
}

.gw-holo-spec-box p {
	font-family: var(--gw-font-body);
	font-weight: 300;
	font-size: 0.72rem;
	color: #b0b0b0;
	line-height: 1.6;
	margin: 0;
}

.gw-holo-about-footer {
	margin-top: auto;
	padding-top: 20px;
	border-top: 1px solid rgba(132, 117, 78, 0.12);
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* ========== GENERIC variant (no overlay, just image + title) ========== */
.gw-holo-generic {
	justify-content: flex-end;
	text-decoration: none;
}

.gw-holo-generic .gw-holo-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	z-index: 0;
}

.gw-holo-generic-content {
	position: relative;
	z-index: 5;
	padding: 28px;
	margin-top: auto;
	background: linear-gradient(
		to top,
		rgba(12, 12, 12, 0.95) 0%,
		rgba(12, 12, 12, 0.7) 60%,
		transparent 100%
	);
}

.gw-holo-generic .gw-holo-pill {
	margin-bottom: 12px;
}

.gw-holo-generic .gw-holo-name {
	font-size: 2rem;
	margin-bottom: 12px;
}

/* ========== FLIP CARD (Trainer) ========== */
.gw-holo-flip {
	perspective: 1200px;
	cursor: pointer;
}

/* Aspect ratios on the flip container */
.gw-holo-flip.gw-holo--4-5 {
	aspect-ratio: 4 / 5;
}

.gw-holo-flip.gw-holo--square {
	aspect-ratio: 1 / 1;
}

.gw-holo-flip.gw-holo--auto {
	aspect-ratio: auto;
}

.gw-holo-flip-front,
.gw-holo-flip-back {
	position: absolute;
	inset: 0;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	transition: transform 0.7s cubic-bezier(0.4, 0.0, 0.2, 1);
	border-radius: 12px;
}

/* Make inner .gw-holo fill the face completely */
.gw-holo-flip-front .gw-holo,
.gw-holo-flip-back .gw-holo {
	width: 100%;
	height: 100%;
}

/* Front face — visible by default */
.gw-holo-flip-front {
	z-index: 2;
	transform: rotateY(0deg);
}

/* Back face — pre-rotated, hidden */
.gw-holo-flip-back {
	z-index: 1;
	transform: rotateY(180deg);
}

/* Flipped state */
.gw-holo-flip.is-flipped .gw-holo-flip-front {
	transform: rotateY(-180deg);
}

.gw-holo-flip.is-flipped .gw-holo-flip-back {
	transform: rotateY(0deg);
}

/* Container needs relative + sized to hold absolute children */
.gw-holo-flip {
	position: relative;
	transform-style: preserve-3d;
}

/* Disable the 3D tilt from holo JS while inside a flip card —
   the flip container handles the 3D perspective instead. */
.gw-holo-flip .gw-holo {
	transform: none !important;
	overflow: visible;
}

/* Clip overflow on the flip face instead of the inner card */
.gw-holo-flip-front,
.gw-holo-flip-back {
	overflow: hidden;
}

/* ========== SLIDER LAYOUT ========== */
.gw-holo-slider {
	position: relative;
	overflow: visible;
}

.gw-holo-slider-track {
	display: flex;
	gap: var(--gw-slider-gap, 24px);
	overflow-x: auto;
	overflow-y: visible;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
	cursor: grab;
}

.gw-holo-slider-track::-webkit-scrollbar {
	display: none;
}

.gw-holo-slider-track.is-dragging {
	scroll-behavior: auto;
	cursor: grabbing;
}

/* Prevent flip during drag */
.gw-holo-slider-track.is-dragging [data-holo-flip] {
	pointer-events: none;
}

.gw-holo-slider-slide {
	flex: 0 0 var(--gw-slider-card-width, 340px);
	width: var(--gw-slider-card-width, 340px);
}

/* Section header (title + arrows on one line) */
.gw-holo-slider-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	gap: 16px;
}

.gw-holo-slider-title {
	font-family: var(--gw-font-heading);
	font-weight: 700;
	font-size: 2rem;
	letter-spacing: 3px;
	text-transform: uppercase;
	color: #ffffff;
	margin: 0;
	line-height: 1.2;
}

/* Arrows */
.gw-holo-slider-arrows {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
	margin-left: auto;
}

.gw-holo-slider-arrow {
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--gw-surface, #181818);
	border: 1px solid var(--gw-border, rgba(255, 255, 255, 0.06));
	border-radius: 50% !important;
	color: var(--gw-text-muted, #78716C);
	cursor: pointer;
	transition: border-color 0.3s, color 0.3s;
}

.gw-holo-slider-arrow:hover {
	border-color: var(--gw-border-gold, rgba(132, 117, 78, 0.2));
	color: #a8976a;
}

/* ========== GRID LAYOUT ========== */
.gw-holo-grid-track {
	display: grid;
	grid-template-columns: repeat(var(--gw-grid-columns, 4), 1fr);
	gap: var(--gw-slider-gap, 24px);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
	.gw-holo-grid-track {
		grid-template-columns: repeat(min(var(--gw-grid-columns, 4), 3), 1fr);
	}
}

@media (max-width: 767px) {
	.gw-holo-name {
		font-size: 2.4rem;
	}

	.gw-holo-generic .gw-holo-name {
		font-size: 1.6rem;
	}

	.gw-holo-grid-track {
		grid-template-columns: repeat(2, 1fr);
	}

	.gw-holo-slider-slide {
		flex: 0 0 280px;
		width: 280px;
	}
}

@media (max-width: 480px) {
	.gw-holo-grid-track {
		grid-template-columns: 1fr;
	}
}
