/* ================================================
   STATUS EFFECTS - Buff/Debuff Visual Indicators
   ================================================ */


/* Status Effects Container (positioned inside battle-card, above portrait and card name) */
.battle-card .status-effect {
	position: absolute;
	top: 4px;
	right: 4px;
	display: flex;
	flex-direction: column;
	gap: 3px;
	pointer-events: none;
	/* Ensure status badges render above animation clones which are placed
		 on a fixed overlay. Use a z-index higher than clone layers so effects
		 (Bleed/Burn/etc.) remain visible when cards animate across the table. */
	z-index: 11001;
	max-width: 60%;
}


.status-effect {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px; /* default padding used when name present */
	border-radius: 6px;
	font-size: 0.7rem;
	font-weight: 600;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
	animation: statusEffectSlideIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
	white-space: nowrap;
	pointer-events: auto;
	cursor: help;
	transition: transform 120ms ease, opacity 180ms ease;
}

/* Icon-only badges (compact) */
.status-effect--icon-only {
	padding: 4px;
	width: 30px;
	height: 30px;
	justify-content: center;
	align-items: center;
	gap: 0;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.status-effect--icon-only .status-effect__icon {
	font-size: 1.0em;
	min-width: auto;
	line-height: 1;
	text-align: center;
}


.status-effect:hover {
  transform: scale(1.05);
}

/* Buff Styling */
.status-effect--buff {
	background: linear-gradient(135deg, rgba(76, 175, 80, 0.85) 0%, rgba(56, 142, 60, 0.9) 100%);
	border: 1px solid rgba(129, 199, 132, 0.6);
	color: #e8f5e9;
}

/* Debuff Styling */
.status-effect--debuff {
	background: linear-gradient(135deg, rgba(244, 67, 54, 0.85) 0%, rgba(211, 47, 47, 0.9) 100%);
	border: 1px solid rgba(239, 154, 154, 0.6);
	color: #ffebee;
}

/* Status Effect Icon */
.status-effect__icon {
	font-size: 0.85em;
	min-width: 12px;
	text-align: center;
	z-index: 2147483647 !important;
}

/* Status Effect Name */
.status-effect__name {
	font-size: 0.65rem;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	font-family: 'Iceberg', monospace, sans-serif;
}

/* Status Effect Stacks */
.status-effect__stacks {
	font-size: 0.75em;
	opacity: 0.9;
	margin-left: 2px;
}

/* Status Effect Duration */
.status-effect__duration {
	font-size: 0.65em;
	opacity: 0.75;
	margin-left: auto;
	padding-left: 4px;
	border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* Specific Effect Types */
.status-effect--bleed {
	background: linear-gradient(135deg, rgba(183, 28, 28, 0.9) 0%, rgba(136, 14, 79, 0.95) 100%);
	border: 1px solid rgba(244, 143, 177, 0.5);
	color: #fce4ec;
}

.status-effect--burn {
	background: linear-gradient(135deg, rgba(255, 87, 34, 0.9) 0%, rgba(230, 74, 25, 0.95) 100%);
	border: 1px solid rgba(255, 171, 145, 0.5);
	color: #fff3e0;
}

.status-effect--poison {
	background: linear-gradient(135deg, rgba(124, 179, 66, 0.9) 0%, rgba(104, 159, 56, 0.95) 100%);
	border: 1px solid rgba(197, 225, 165, 0.5);
	color: #f1f8e9;
}

.status-effect--shield {
	background: linear-gradient(135deg, rgba(66, 165, 245, 0.9) 0%, rgba(30, 136, 229, 0.95) 100%);
	border: 1px solid rgba(144, 202, 249, 0.5);
	color: #e3f2fd;
}

.status-effect--stun {
	background: linear-gradient(135deg, rgba(156, 39, 176, 0.9) 0%, rgba(123, 31, 162, 0.95) 100%);
	border: 1px solid rgba(206, 147, 216, 0.5);
	color: #f3e5f5;
}

/* Animations */
@keyframes statusEffectSlideIn {
	0% {
		opacity: 0;
		transform: translateX(20px) scale(0.8);
	}
	60% {
		transform: translateX(-2px) scale(1.05);
	}
	100% {
		opacity: 1;
		transform: translateX(0) scale(1);
	}
}

.status-effect--removing {
	animation: statusEffectSlideOut 250ms ease-out forwards;
}

@keyframes statusEffectSlideOut {
	0% {
		opacity: 1;
		transform: translateX(0) scale(1);
	}
	100% {
		opacity: 0;
		transform: translateX(30px) scale(0.7);
	}
}

/* Pulse animation for newly applied effects */
.status-effect--new {
	animation: statusEffectSlideIn 300ms cubic-bezier(0.34, 1.56, 0.64, 1), 
	           statusEffectPulse 600ms ease-in-out 300ms;
}

@keyframes statusEffectPulse {
	0%, 100% {
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
	}
	50% {
		box-shadow: 0 0 16px currentColor, 0 2px 8px rgba(0, 0, 0, 0.4);
	}
}

/* Tooltip */
.status-effect__tooltip {
	position: absolute;
	bottom: calc(100% + 8px);
	right: 0;
	background: rgba(30, 30, 40, 0.98);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 0.75rem;
	line-height: 1.4;
	min-width: 160px;
	max-width: 220px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
	z-index: 2147483647 !important;
	pointer-events: none;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 180ms ease, transform 180ms ease;
	white-space: normal;
	text-align: left;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.status-effect:hover .status-effect__tooltip {
	opacity: 1;
	transform: translateY(0);
}

.status-effect__tooltip-title {
	font-weight: 700;
	margin-bottom: 4px;
	color: #fff;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.status-effect__tooltip-desc {
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.7rem;
	margin-bottom: 6px;
}

.status-effect__tooltip-meta {
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.65rem;
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.status-effects {
		top: 3px;
		right: 3px;
		gap: 2px;
	}
	
	.status-effect {
		padding: 2px 4px;
		font-size: 0.6rem;
		gap: 3px;
	}
	
	.status-effect__name {
		font-size: 0.55rem;
	}
	
	.status-effect__tooltip {
		font-size: 0.7rem;
		min-width: 140px;
	}
}

/* Compact card adjustments */
.card--compact .status-effects {
	top: 2px;
	right: 2px;
	gap: 2px;
}

.card--compact .status-effect {
	padding: 2px 5px;
	font-size: 0.6rem;
}

.card--compact .status-effect__name {
	font-size: 0.55rem;
}

/* Dark background variant for better visibility */
.status-effect--overlay {
	background: rgba(0, 0, 0, 0.75);
	border-color: rgba(255, 255, 255, 0.3);
}

/* Turn-end damage indicator (for showing Bleed proc damage) */
.status-damage-float {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 1.8rem;
	font-weight: 900;
	color: #ff4444;
	text-shadow: 
		0 0 12px rgba(255, 68, 68, 1),
		0 0 24px rgba(255, 68, 68, 0.8),
		0 2px 4px rgba(0, 0, 0, 0.9),
		0 0 8px rgba(255, 100, 100, 0.6);
	pointer-events: none;
	z-index: 2147483647 !important;
	animation: statusDamageFloat 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
	font-family: 'Iceberg', monospace, sans-serif;
	will-change: transform, opacity;
	letter-spacing: 0.05em;
}

/* Effect-type-specific colors and glows */
.status-damage-float--bleed {
	color: #ff3333;
	text-shadow: 
		0 0 12px rgba(255, 51, 51, 1),
		0 0 24px rgba(255, 51, 51, 0.8),
		0 2px 4px rgba(0, 0, 0, 0.9),
		0 0 8px rgba(255, 80, 80, 0.6);
}

.status-damage-float--burn {
	color: #ff7722;
	text-shadow: 
		0 0 12px rgba(255, 119, 34, 1),
		0 0 24px rgba(255, 119, 34, 0.8),
		0 2px 4px rgba(0, 0, 0, 0.9),
		0 0 8px rgba(255, 150, 80, 0.6);
}

.status-damage-float--poison {
	color: #44ff44;
	text-shadow: 
		0 0 12px rgba(68, 255, 68, 1),
		0 0 24px rgba(68, 255, 68, 0.8),
		0 2px 4px rgba(0, 0, 0, 0.9),
		0 0 8px rgba(100, 255, 100, 0.6);
}

.status-damage-float--stun {
	color: #ffff44;
	text-shadow: 
		0 0 12px rgba(255, 255, 68, 1),
		0 0 24px rgba(255, 255, 68, 0.8),
		0 2px 4px rgba(0, 0, 0, 0.9),
		0 0 8px rgba(255, 255, 120, 0.6);
}

.status-damage-float--freeze {
	color: #44ccff;
	text-shadow: 
		0 0 12px rgba(68, 204, 255, 1),
		0 0 24px rgba(68, 204, 255, 0.8),
		0 2px 4px rgba(0, 0, 0, 0.9),
		0 0 8px rgba(100, 220, 255, 0.6);
}

.status-damage-float--damage {
	color: #ff6666;
	text-shadow: 
		0 0 12px rgba(255, 102, 102, 1),
		0 0 24px rgba(255, 102, 102, 0.8),
		0 2px 4px rgba(0, 0, 0, 0.9),
		0 0 8px rgba(255, 130, 130, 0.6);
}

/* Enhanced animation: Punchy pop with 3-phase timing matching attack animations */
@keyframes statusDamageFloat {
	0% {
		/* Pop/Impact phase: Scale up dramatically */
		opacity: 0;
		transform: translate(-50%, -50%) scale(0.4);
		filter: brightness(1.2);
	}
	15% {
		/* Impact peak: Maximum scale and brightness */
		opacity: 1;
		transform: translate(-50%, -55%) scale(1.3);
		filter: brightness(1.4);
	}
	30% {
		/* Recovery phase: Settle to normal scale */
		opacity: 1;
		transform: translate(-50%, -65%) scale(1);
		filter: brightness(1.1);
	}
	70% {
		/* Float phase: Continues upward */
		opacity: 1;
		transform: translate(-50%, -95%) scale(1);
		filter: brightness(1.05);
	}
	90% {
		/* Fade out begins: Keep scale but reduce opacity */
		opacity: 0.5;
		transform: translate(-50%, -110%) scale(0.95);
		filter: brightness(0.9);
	}
	100% {
		/* Complete fade: End position */
		opacity: 0;
		transform: translate(-50%, -120%) scale(0.8);
		filter: brightness(0.8);
	}
}
