/**
 * Animations & Parallax
 */

/* Respect prefers-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;
	}
}

/* Animation keyframes */
@keyframes animate-fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

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

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

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

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

@keyframes animate-zoom-in {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes animate-flip {
	from {
		opacity: 0;
		transform: perspective(400px) rotateY(90deg);
	}
	to {
		opacity: 1;
		transform: perspective(400px) rotateY(0);
	}
}

/* Animation classes */
[data-animate] {
	opacity: 0;
}

.animate-fade-in {
	animation: animate-fade-in forwards;
}

.animate-slide-up {
	animation: animate-slide-up forwards;
}

.animate-slide-down {
	animation: animate-slide-down forwards;
}

.animate-slide-left {
	animation: animate-slide-left forwards;
}

.animate-slide-right {
	animation: animate-slide-right forwards;
}

.animate-zoom-in {
	animation: animate-zoom-in forwards;
}

.animate-flip {
	animation: animate-flip forwards;
}

/* Parallax support */
[data-parallax] {
	will-change: transform;
}

/* Back to top button */
.sf-back-to-top {
	position: fixed;
	bottom: 30px;
	right: 30px;
	width: 50px;
	height: 50px;
	background-color: rgba(0, 0, 0, 0.8);
	color: white;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: all 0.3s ease;
	z-index: var(--sf-z-notification);
	font-size: 0;
}

.sf-back-to-top:hover {
	background-color: rgba(0, 0, 0, 0.95);
	transform: translateY(-3px);
}

.sf-back-to-top.show {
	opacity: 1;
	visibility: visible;
}

.sf-back-to-top svg {
	width: 24px;
	height: 24px;
	stroke-width: 2;
}

/* Scroll progress bar */
.sf-scroll-progress {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 3px;
	background-color: rgba(0, 0, 0, 0.1);
	z-index: var(--sf-z-max);
}

.sf-scroll-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #007bff, #0056b3);
	width: 0%;
	transition: width 0.1s ease;
}

/* Smooth scroll behavior */
html {
	scroll-behavior: smooth;
}

/* Animation text selection */
::selection {
	background-color: rgba(0, 0, 0, 0.1);
}

::-moz-selection {
	background-color: rgba(0, 0, 0, 0.1);
}

/* Responsive back to top button */
@media (max-width: 768px) {
	.sf-back-to-top {
		bottom: 20px;
		right: 20px;
		width: 45px;
		height: 45px;
	}

	.sf-back-to-top svg {
		width: 20px;
		height: 20px;
	}
}

/* ==============================================
   MICRO-INTERACTIONS (Pflichtenheft 2026)
   ============================================== */

/* -----------------------------------------------
   BUTTON RIPPLE EFFECT
   ----------------------------------------------- */
.btn-ripple,
.wp-block-button__link,
button.sf-btn {
	position: relative;
	overflow: hidden;
}

.btn-ripple::after,
.wp-block-button__link::after {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
	opacity: 0;
	transform: scale(0);
	transition: opacity 0.4s ease, transform 0.5s ease;
	pointer-events: none;
}

.btn-ripple:active::after,
.wp-block-button__link:active::after {
	opacity: 1;
	transform: scale(2.5);
	transition: none;
}

/* -----------------------------------------------
   LINK HOVER — ANIMATED UNDERLINE
   ----------------------------------------------- */
.entry-content a:not(.button):not(.btn),
.widget a:not(.button):not(.btn),
.comment-body a {
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 0% 100%;
	background-repeat: no-repeat;
	background-size: 0% 1px;
	transition: background-size 0.25s ease, color 0.2s ease;
}

.entry-content a:not(.button):not(.btn):hover,
.widget a:not(.button):not(.btn):hover,
.comment-body a:hover {
	background-size: 100% 1px;
}

/* -----------------------------------------------
   NAV LINK HOVER UNDERLINE
   ----------------------------------------------- */
.main-navigation #primary-menu > li > a {
	position: relative;
}

.main-navigation #primary-menu > li > a::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 0;
	height: 2px;
	background: var(--sf-color-primary, #0073aa);
	border-radius: 1px;
	transition: width 0.25s ease;
}

.main-navigation #primary-menu > li > a:hover::after,
.main-navigation #primary-menu > li.current-menu-item > a::after {
	width: 100%;
}

/* -----------------------------------------------
   FORM INPUT FOCUS ANIMATIONS
   ----------------------------------------------- */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
	border-color: var(--sf-color-primary, #0073aa);
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.sf-form-group {
	position: relative;
}

.sf-form-group label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 6px;
	transition: color 0.2s ease;
}

.sf-form-group:focus-within label {
	color: var(--sf-color-primary, #0073aa);
}

/* -----------------------------------------------
   CARD HOVER EFFECTS
   ----------------------------------------------- */
.post-card,
.sf-card,
[class*="elementor-widget-"] .elementor-widget-container {
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.post-card:hover,
.sf-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Image zoom inside card */
.post-card .post-thumbnail img,
.sf-card .card-image img {
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
}

.post-card:hover .post-thumbnail img,
.sf-card:hover .card-image img {
	transform: scale(1.04);
}

.post-card .post-thumbnail,
.sf-card .card-image {
	overflow: hidden;
}

/* -----------------------------------------------
   SKELETON LOADING
   ----------------------------------------------- */
@keyframes sf-skeleton-pulse {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.4; }
}

@keyframes sf-skeleton-shimmer {
	0%   { background-position: -200% 0; }
	100% { background-position: 200% 0; }
}

.sf-skeleton {
	background: linear-gradient(
		90deg,
		rgba(0, 0, 0, 0.06) 25%,
		rgba(0, 0, 0, 0.1) 37%,
		rgba(0, 0, 0, 0.06) 63%
	);
	background-size: 200% 100%;
	animation: sf-skeleton-shimmer 1.5s infinite;
	border-radius: 4px;
}

.sf-skeleton-text {
	height: 1em;
	margin-bottom: 8px;
	border-radius: 4px;
}

.sf-skeleton-title {
	height: 1.5em;
	width: 70%;
	margin-bottom: 12px;
	border-radius: 4px;
}

.sf-skeleton-image {
	padding-top: 56.25%; /* 16:9 ratio */
	width: 100%;
	border-radius: var(--sf-border-radius-default, 6px);
}

/* Dark mode skeleton */
body.dark-mode .sf-skeleton {
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0.04) 25%,
		rgba(255, 255, 255, 0.08) 37%,
		rgba(255, 255, 255, 0.04) 63%
	);
	background-size: 200% 100%;
	animation: sf-skeleton-shimmer 1.5s infinite;
}

/* -----------------------------------------------
   NOTIFICATION / TOAST ANIMATIONS
   ----------------------------------------------- */
@keyframes sf-toast-in {
	from { transform: translateX(110%); opacity: 0; }
	to   { transform: translateX(0);    opacity: 1; }
}

@keyframes sf-toast-out {
	from { transform: translateX(0);    opacity: 1; }
	to   { transform: translateX(110%); opacity: 0; }
}

.sf-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 9998;
	min-width: 280px;
	max-width: 360px;
	padding: 14px 20px;
	border-radius: var(--sf-border-radius-default, 6px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	font-size: 0.9rem;
	display: flex;
	align-items: center;
	gap: 10px;
	animation: sf-toast-in 0.35s cubic-bezier(0.34, 1.1, 0.64, 1) forwards;
}

.sf-toast.sf-toast--exiting {
	animation: sf-toast-out 0.3s ease forwards;
}

.sf-toast--success { background: #22c55e; color: white; }
.sf-toast--error   { background: #ef4444; color: white; }
.sf-toast--info    { background: var(--sf-color-primary, #0073aa); color: white; }
.sf-toast--warning { background: #f59e0b; color: white; }

/* Mobile toast */
@media (max-width: 480px) {
	.sf-toast {
		left: 16px;
		right: 16px;
		bottom: 80px; /* above mobile sticky CTA */
		min-width: unset;
		max-width: unset;
	}
}

/* -----------------------------------------------
   STAGGER DELAY UTILITIES
   ----------------------------------------------- */
[data-animate-delay="100"] { animation-delay: 100ms; }
[data-animate-delay="200"] { animation-delay: 200ms; }
[data-animate-delay="300"] { animation-delay: 300ms; }
[data-animate-delay="400"] { animation-delay: 400ms; }
[data-animate-delay="500"] { animation-delay: 500ms; }
[data-animate-delay="600"] { animation-delay: 600ms; }
[data-animate-delay="700"] { animation-delay: 700ms; }
[data-animate-delay="800"] { animation-delay: 800ms; }

/* CSS stagger for child elements */
.sf-stagger > *:nth-child(1) { transition-delay: 0ms; }
.sf-stagger > *:nth-child(2) { transition-delay: 80ms; }
.sf-stagger > *:nth-child(3) { transition-delay: 160ms; }
.sf-stagger > *:nth-child(4) { transition-delay: 240ms; }
.sf-stagger > *:nth-child(5) { transition-delay: 320ms; }
.sf-stagger > *:nth-child(6) { transition-delay: 400ms; }

/* -----------------------------------------------
   HAMBURGER — ANIMATED X
   ----------------------------------------------- */
.menu-toggle .menu-toggle-icon span {
	display: block;
	width: 22px;
	height: 2px;
	border-radius: 2px;
	transition: transform 0.3s ease, opacity 0.2s ease;
	transform-origin: center;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
	opacity: 0;
	transform: scaleX(0);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* -----------------------------------------------
   PULSE / BADGE ANIMATIONS
   ----------------------------------------------- */
@keyframes sf-pulse {
	0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 115, 170, 0.4); }
	50%       { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(0, 115, 170, 0); }
}

.sf-cta-pulse {
	animation: sf-pulse 2.5s infinite;
}

@keyframes sf-badge-bounce {
	0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
	40% { transform: translateY(-4px); }
	60% { transform: translateY(-2px); }
}

.sf-badge-new {
	display: inline-block;
	animation: sf-badge-bounce 2s ease 1s 1;
}

/* -----------------------------------------------
   PAGE TRANSITION LOADER
   ----------------------------------------------- */
@keyframes sf-page-reveal {
	from { clip-path: inset(0 100% 0 0); }
	to   { clip-path: inset(0 0% 0 0); }
}

.sf-page-transition {
	animation: sf-page-reveal 0.5s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

/* -----------------------------------------------
   COUNTER NUMBER ANIMATION
   ----------------------------------------------- */
.sf-counter[data-target] {
	display: inline-block;
	transition: opacity 0.3s ease;
}

/* ==============================================
   END MICRO-INTERACTIONS
   ============================================== */
