/**
 * Animation Components
 * Remote Madam Design System
 * Pure CSS animations - no external libraries
 */

/* ============================================
   FADE UP
   ============================================ */

@keyframes fadeUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.animate-fade-up {
	animation: fadeUp 0.6s ease forwards;
}

.animate-fade-up--delay-1 {
	animation-delay: 0.1s;
}

.animate-fade-up--delay-2 {
	animation-delay: 0.2s;
}

.animate-fade-up--delay-3 {
	animation-delay: 0.3s;
}

.animate-fade-up--delay-4 {
	animation-delay: 0.4s;
}

.animate-fade-up--delay-5 {
	animation-delay: 0.5s;
}

/* ============================================
   FADE IN
   ============================================ */

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.animate-fade-in {
	animation: fadeIn 0.5s ease forwards;
}

.animate-fade-in--delay-1 {
	animation-delay: 0.1s;
}

.animate-fade-in--delay-2 {
	animation-delay: 0.2s;
}

.animate-fade-in--delay-3 {
	animation-delay: 0.3s;
}

.animate-fade-in--slow {
	animation-duration: 0.8s;
}

.animate-fade-in--fast {
	animation-duration: 0.3s;
}

/* ============================================
   SCALE IN
   ============================================ */

@keyframes scaleIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.animate-scale-in {
	animation: scaleIn 0.4s ease forwards;
}

.animate-scale-in--delay-1 {
	animation-delay: 0.1s;
}

.animate-scale-in--delay-2 {
	animation-delay: 0.2s;
}

.animate-scale-in--delay-3 {
	animation-delay: 0.3s;
}

/* ============================================
   HOVER LIFT
   ============================================ */

.hover-lift {
	transition: transform var(--transition), box-shadow var(--transition);
}

.hover-lift:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.hover-lift--subtle:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.hover-lift--strong:hover {
	transform: translateY(-6px);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}

/* ============================================
   BUTTON RIPPLE
   ============================================ */

.btn {
	position: relative;
	overflow: hidden;
}

.btn::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	background: rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	transform: translate(-50%, -50%);
	transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::after {
	width: 300px;
	height: 300px;
}

.btn--primary::after {
	background: rgba(255, 255, 255, 0.2);
}

.btn--accent::after {
	background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   CARD HOVER
   ============================================ */

.card-hover {
	transition: all var(--transition);
}

.card-hover:hover {
	transform: translateY(-4px);
	border-color: var(--primary);
	box-shadow: 0 0 30px rgba(245, 93, 174, 0.2);
}

.card-hover--accent:hover {
	border-color: var(--accent);
	box-shadow: 0 0 30px rgba(108, 99, 255, 0.2);
}

.card-hover--glow:hover {
	box-shadow: 0 0 40px rgba(245, 93, 174, 0.3);
}

.card-hover--scale:hover {
	transform: translateY(-4px) scale(1.02);
}

/* ============================================
   SMOOTH TRANSITIONS
   ============================================ */

.transition-smooth {
	transition: all var(--transition);
}

.transition-smooth--fast {
	transition: all 0.15s ease;
}

.transition-smooth--slow {
	transition: all 0.5s ease;
}

.transition-color {
	transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

.transition-transform {
	transition: transform var(--transition);
}

.transition-opacity {
	transition: opacity var(--transition);
}

.transition-shadow {
	transition: box-shadow var(--transition);
}

/* ============================================
   SLIDE IN
   ============================================ */

@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes slideInRight {
	from {
		opacity: 0;
		transform: translateX(30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes slideInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes slideInDown {
	from {
		opacity: 0;
		transform: translateY(-30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.animate-slide-left {
	animation: slideInLeft 0.5s ease forwards;
}

.animate-slide-right {
	animation: slideInRight 0.5s ease forwards;
}

.animate-slide-up {
	animation: slideInUp 0.5s ease forwards;
}

.animate-slide-down {
	animation: slideInDown 0.5s ease forwards;
}

/* ============================================
   BOUNCE
   ============================================ */

@keyframes bounce {
	0%, 20%, 50%, 80%, 100% {
		transform: translateY(0);
	}
	40% {
		transform: translateY(-10px);
	}
	60% {
		transform: translateY(-5px);
	}
}

.animate-bounce {
	animation: bounce 1s ease infinite;
}

.animate-bounce--hover:hover {
	animation: bounce 0.5s ease infinite;
}

/* ============================================
   PULSE
   ============================================ */

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.animate-pulse {
	animation: pulse 2s ease infinite;
}

.animate-pulse--fast {
	animation: pulse 1s ease infinite;
}

/* ============================================
   SPIN
   ============================================ */

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.animate-spin {
	animation: spin 1s linear infinite;
}

.animate-spin--slow {
	animation: spin 2s linear infinite;
}

.animate-spin--fast {
	animation: spin 0.5s linear infinite;
}

/* ============================================
   SHAKE
   ============================================ */

@keyframes shake {
	0%, 100% {
		transform: translateX(0);
	}
	10%, 30%, 50%, 70%, 90% {
		transform: translateX(-5px);
	}
	20%, 40%, 60%, 80% {
		transform: translateX(5px);
	}
}

.animate-shake {
	animation: shake 0.5s ease;
}

/* ============================================
   GLOW
   ============================================ */

@keyframes glow {
	0%, 100% {
		box-shadow: 0 0 5px var(--primary);
	}
	50% {
		box-shadow: 0 0 20px var(--primary), 0 0 30px var(--primary);
	}
}

.animate-glow {
	animation: glow 2s ease infinite;
}

.animate-glow--accent {
	animation-name: glowAccent;
}

@keyframes glowAccent {
	0%, 100% {
		box-shadow: 0 0 5px var(--accent);
	}
	50% {
		box-shadow: 0 0 20px var(--accent), 0 0 30px var(--accent);
	}
}

/* ============================================
   FLOAT
   ============================================ */

@keyframes float {
	0%, 100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-10px);
	}
}

.animate-float {
	animation: float 3s ease infinite;
}

.animate-float--slow {
	animation: float 4s ease infinite;
}

.animate-float--fast {
	animation: float 2s ease infinite;
}

/* ============================================
   INTERSECTION OBSERVER ANIMATIONS
   ============================================ */

.animate-on-scroll {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.animate-on-scroll--left {
	transform: translateX(-30px);
}

.animate-on-scroll--left.is-visible {
	transform: translateX(0);
}

.animate-on-scroll--right {
	transform: translateX(30px);
}

.animate-on-scroll--right.is-visible {
	transform: translateX(0);
}

.animate-on-scroll--scale {
	transform: scale(0.9);
}

.animate-on-scroll--scale.is-visible {
	transform: scale(1);
}

/* ============================================
   STAGGERED CHILDREN
   ============================================ */

.stagger-children > * {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-children.is-visible > *:nth-child(1) {
	transition-delay: 0.05s;
}

.stagger-children.is-visible > *:nth-child(2) {
	transition-delay: 0.1s;
}

.stagger-children.is-visible > *:nth-child(3) {
	transition-delay: 0.15s;
}

.stagger-children.is-visible > *:nth-child(4) {
	transition-delay: 0.2s;
}

.stagger-children.is-visible > *:nth-child(5) {
	transition-delay: 0.25s;
}

.stagger-children.is-visible > *:nth-child(6) {
	transition-delay: 0.3s;
}

.stagger-children.is-visible > * {
	opacity: 1;
	transform: translateY(0);
}

/* ============================================
   LOADING SKELETON
   ============================================ */

@keyframes skeletonShimmer {
	0% {
		background-position: -200% 0;
	}
	100% {
		background-position: 200% 0;
	}
}

.skeleton-loading {
	background: linear-gradient(
		90deg,
		var(--surface) 0%,
		var(--surface-2) 50%,
		var(--surface) 100%
	);
	background-size: 200% 100%;
	animation: skeletonShimmer 1.5s infinite;
}

/* ============================================
   PROGRESS BAR
   ============================================ */

@keyframes progressFill {
	from {
		width: 0;
	}
}

.animate-progress {
	animation: progressFill 1s ease forwards;
}

/* ============================================
   COUNTER
   ============================================ */

@keyframes countUp {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.animate-count {
	animation: countUp 0.3s ease forwards;
}

/* ============================================
   ICON SPIN
   ============================================ */

.icon-spin {
	animation: spin 1s linear infinite;
}

.icon-spin--hover:hover {
	animation: spin 0.5s linear infinite;
}

/* ============================================
   UNDERLINE ANIMATION
   ============================================ */

.underline-animated {
	position: relative;
}

.underline-animated::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 0;
	height: 2px;
	background: var(--gradient-primary);
	transition: width var(--transition);
}

.underline-animated:hover::after {
	width: 100%;
}

/* ============================================
   BACKGROUND FADE
   ============================================ */

@keyframes backgroundFade {
	0%, 100% {
		background-color: var(--surface);
	}
	50% {
		background-color: var(--surface-2);
	}
}

.animate-bg-fade {
	animation: backgroundFade 2s ease infinite;
}

/* ============================================
   BLUR IN
   ============================================ */

@keyframes blurIn {
	from {
		opacity: 0;
		filter: blur(10px);
	}
	to {
		opacity: 1;
		filter: blur(0);
	}
}

.animate-blur-in {
	animation: blurIn 0.5s ease forwards;
}

/* ============================================
   ROTATE IN
   ============================================ */

@keyframes rotateIn {
	from {
		opacity: 0;
		transform: rotate(-180deg) scale(0);
	}
	to {
		opacity: 1;
		transform: rotate(0) scale(1);
	}
}

.animate-rotate-in {
	animation: rotateIn 0.5s ease forwards;
}

/* ============================================
   FLIP
   ============================================ */

@keyframes flip {
	0% {
		transform: perspective(400px) rotateY(0);
	}
	100% {
		transform: perspective(400px) rotateY(360deg);
	}
}

.animate-flip {
	animation: flip 1s ease;
}

/* ============================================
   ZOOM IN
   ============================================ */

@keyframes zoomIn {
	from {
		opacity: 0;
		transform: scale(0.5);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.animate-zoom-in {
	animation: zoomIn 0.4s ease forwards;
}

/* ============================================
   ZOOM OUT
   ============================================ */

@keyframes zoomOut {
	from {
		opacity: 1;
		transform: scale(1);
	}
	to {
		opacity: 0;
		transform: scale(0.5);
	}
}

.animate-zoom-out {
	animation: zoomOut 0.4s ease forwards;
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
