/**
 * Design Enhancements - Animations, Transitions & Effects
 *
 * @package Krasen_Slavov
 * @since 1.0.0
 */

/* ==========================================================================
   Enhanced Animations & Keyframes
   ========================================================================== */

@keyframes fadeInUp {
	0% {
		opacity: 0;
		transform: translateY(30px);
	}

	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	0% {
		opacity: 0;
	}

	100% {
		opacity: 1;
	}
}

@keyframes slideDown {
	0% {
		opacity: 0;
		transform: translateY(-20px);
	}

	100% {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes pulse {

	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.05);
	}
}

@keyframes shimmer {
	0% {
		background-position: -1000px 0;
	}

	100% {
		background-position: 1000px 0;
	}
}

@keyframes glow {

	0%,
	100% {
		box-shadow: 0 0 5px rgba(45, 142, 255, 0.5);
	}

	50% {
		box-shadow: 0 0 20px rgba(45, 142, 255, 0.8), 0 0 30px rgba(0, 224, 255, 0.6);
	}
}

/* ==========================================================================
   Enhanced Global Button Styles
   ========================================================================== */

button:not(.theme-toggle):not(.mobile-menu-toggle):not(.search-toggle):not(.search-close):not(.scroll-to-top),
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.wp-block-button__link {
	appearance: none;
	background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-highlight) 100%);
	background-size: 200% 200%;
	border: none;
	border-radius: var(--radius-md);
	box-shadow: 0 4px 15px rgba(45, 142, 255, 0.3);
	color: #ffffff !important;
	cursor: pointer;
	display: inline-block;
	font-family: var(--font-primary);
	font-size: var(--font-size-base);
	font-weight: 600;
	line-height: 1;
	overflow: hidden;
	padding: var(--spacing-sm) var(--spacing-lg);
	position: relative;
	text-align: center;
	text-decoration: none;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:not(.theme-toggle):not(.mobile-menu-toggle):not(.search-toggle):not(.search-close):not(.scroll-to-top)::before,
input[type="button"]::before,
input[type="reset"]::before,
input[type="submit"]::before,
.button::before,
.wp-block-button__link::before {
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
	content: '';
	height: 100%;
	left: -100%;
	position: absolute;
	top: 0;
	transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	width: 100%;
}

button:not(.theme-toggle):not(.mobile-menu-toggle):not(.search-toggle):not(.search-close):not(.scroll-to-top):hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover,
.button:hover,
.wp-block-button__link:hover {
	background-position: 100% 0;
	box-shadow: 0 6px 25px rgba(45, 142, 255, 0.5), 0 0 40px rgba(0, 224, 255, 0.2);
	transform: translateY(-3px) scale(1.02);
}

button:not(.theme-toggle):not(.mobile-menu-toggle):not(.search-toggle):not(.search-close):not(.scroll-to-top):hover::before,
input[type="button"]:hover::before,
input[type="reset"]:hover::before,
input[type="submit"]:hover::before,
.button:hover::before,
.wp-block-button__link:hover::before {
	left: 100%;
}

button:not(.theme-toggle):not(.mobile-menu-toggle):not(.search-toggle):not(.search-close):not(.scroll-to-top):active,
input[type="button"]:active,
input[type="reset"]:active,
input[type="submit"]:active,
.button:active,
.wp-block-button__link:active {
	box-shadow: 0 3px 15px rgba(45, 142, 255, 0.4);
	transform: translateY(-1px) scale(1);
}

button:not(.theme-toggle):not(.mobile-menu-toggle):not(.search-toggle):not(.search-close):not(.scroll-to-top):focus,
input[type="button"]:focus,
input[type="reset"]:focus,
input[type="submit"]:focus,
.button:focus,
.wp-block-button__link:focus {
	outline: 3px solid rgba(45, 142, 255, 0.5);
	outline-offset: 3px;
}

/* ==========================================================================
   Enhanced Card Animations
   ========================================================================== */

.post-card {
	animation: fadeInUp 0.6s ease-out both;
	animation-delay: calc(var(--card-index, 0) * 0.1s);
}

.post-card-inner {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card-inner:hover {
	box-shadow: 0 12px 40px rgba(45, 142, 255, 0.2), 0 0 0 1px rgba(45, 142, 255, 0.1);
	transform: translateY(-8px) scale(1.02);
}

.post-card-inner:hover .post-card-thumbnail img {
	transform: scale(1.08) rotate(1deg);
}

.post-card-inner::after {
	background: linear-gradient(135deg, rgba(45, 142, 255, 0.05) 0%, rgba(0, 224, 255, 0.05) 100%);
	border-radius: var(--radius-lg);
	bottom: 0;
	content: '';
	left: 0;
	opacity: 0;
	pointer-events: none;
	position: absolute;
	right: 0;
	top: 0;
	transition: opacity 0.4s ease;
}

.post-card-inner:hover::after {
	opacity: 1;
}

/* ==========================================================================
   Enhanced Header & Navigation
   ========================================================================== */

.site-header {
	animation: slideDown 0.5s ease-out;
	backdrop-filter: blur(10px);
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
}

/* Disabled: top-level nav link styling (underline, hover color/lift, and
   an ::after this stylesheet loads AFTER custom.css and so was winning)
   is now owned entirely by custom.css's "Top-Level Dropdown Behavior"
   section and style.css. This file also uses ::after for its own
   centered underline bar, which collided with the dropdown caret
   (also an ::after) defined in custom.css - whichever loaded last won
   the `content` property, which is why the caret kept misbehaving.
   Left here, commented, so the intent isn't lost - do not re-enable
   without also removing the caret's ::after in custom.css.
.primary-menu>li>a {
	position: relative;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-menu>li>a::after {
	background: linear-gradient(90deg, var(--color-accent), var(--color-highlight));
	bottom: -5px;
	content: '';
	height: 2px;
	left: 50%;
	position: absolute;
	transform: translateX(-50%);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	width: 0;
}

.primary-menu>li>a:hover::after,
.primary-menu>li.current-menu-item>a::after {
	width: 80%;
}

.primary-menu>li>a:hover {
	color: var(--color-accent);
	transform: translateY(-2px);
}
*/

/* ==========================================================================
   Enhanced Form Inputs
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px rgba(45, 142, 255, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.1);
	transform: translateY(-1px);
}

/* ==========================================================================
   Enhanced Pagination
   ========================================================================== */

.nav-links .page-numbers {
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links .page-numbers:hover {
	box-shadow: 0 4px 12px rgba(45, 142, 255, 0.3);
	transform: translateY(-2px);
}

.nav-links .page-numbers.current {
	box-shadow: 0 4px 15px rgba(45, 142, 255, 0.4);
	transform: scale(1.1);
}

/* ==========================================================================
   Enhanced Footer
   ========================================================================== */

.site-footer {
	animation: fadeIn 0.8s ease-out;
	background: linear-gradient(180deg, var(--color-secondary) 0%, var(--color-primary) 100%);
	box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
}

.footer-navigation a,
.footer-credits a {
	position: relative;
	transition: all 0.3s ease;
}

.footer-navigation a::after,
.footer-credits a::after {
	background-color: var(--color-accent);
	bottom: -2px;
	content: '';
	height: 1px;
	left: 0;
	position: absolute;
	transition: width 0.3s ease;
	width: 0;
}

.footer-navigation a:hover::after,
.footer-credits a:hover::after {
	width: 100%;
}

/* ==========================================================================
   Enhanced Content Animations
   ========================================================================== */

.entry-content {
	animation: fadeIn 0.6s ease-out 0.2s both;
}

.entry-content a:not(.button) {
	position: relative;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	transition: all 0.3s ease;
}

.entry-content a:not(.button):hover {
	text-decoration-thickness: 3px;
	text-shadow: 0 0 8px rgba(45, 142, 255, 0.3);
}

/* ==========================================================================
   Enhanced Scroll-based Animations
   ========================================================================== */

.site-main>* {
	animation: fadeInUp 0.6s ease-out both;
}

/* ==========================================================================
   Enhanced Theme Toggle
   ========================================================================== */

.theme-toggle {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
	box-shadow: 0 4px 15px rgba(45, 142, 255, 0.3);
	transform: scale(1.05);
}

.theme-toggle .toggle-icon {
	box-shadow: 0 2px 8px rgba(45, 142, 255, 0.4);
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .theme-toggle .toggle-icon {
	box-shadow: 0 2px 8px rgba(0, 224, 255, 0.4);
}

/* ==========================================================================
   Enhanced Comment Cards
   ========================================================================== */

.comment-body {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-body:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	transform: translateX(5px);
}

/* ==========================================================================
   Enhanced Hero Section
   ========================================================================== */

.entry-hero {
	animation: fadeIn 0.8s ease-out;
}

.entry-hero .hero-content {
	animation: fadeInUp 1s ease-out 0.3s both;
}

.entry-hero .entry-title {
	text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), 0 0 20px rgba(45, 142, 255, 0.3);
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.loading {
	animation: pulse 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Smooth Scrolling
   ========================================================================== */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	html {
		scroll-behavior: auto;
	}
}
