/* ==========================================================================
   FEHIVER — Pack Táctico de Animaciones Ligeras (100% CSS · GPU-only)
   Solo anima transform / opacity y micro-estados de color. Cero JS extra.
   ========================================================================== */

/* ── 1. Keyframes base (acelerados por GPU) ─────────────────────────────── */
@keyframes fhv-enter-up {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fhv-terminal-open {
	from {
		opacity: 0;
		transform: translateY(-6px) scale(0.975);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes fhv-backdrop-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes fhv-toast-in {
	from {
		opacity: 0;
		transform: translateX(-14px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

@keyframes fhv-bar-grow {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}

@keyframes fhv-pulse-dot {
	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.45;
		transform: scale(0.84);
	}
}

@keyframes fhv-pulse-live {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.68;
	}
}

/* ── 2. Navegación superior y emblema HUD ───────────────────────────────── */
body.fehiver-scifi-theme .fhv-brand-mark {
	transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), filter 0.24s ease;
}

body.fehiver-scifi-theme .fhv-branding:hover .fhv-brand-mark {
	transform: scale(1.06) rotate(8deg);
}

body.fehiver-scifi-theme .main-navigation .primary-menu > li > a::after {
	content: "";
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 2px;
	height: 2px;
	border-radius: 2px;
	background: var(--fv-cyan, #65b8c9);
	transform: scaleX(0);
	transform-origin: center;
	opacity: 0;
	transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

body.fehiver-scifi-theme .main-navigation .primary-menu > li > a:hover::after,
body.fehiver-scifi-theme .main-navigation .primary-menu > li.current-menu-item > a::after,
body.fehiver-scifi-theme .main-navigation .primary-menu > li.current_page_item > a::after {
	transform: scaleX(1);
	opacity: 1;
}

/* ── 3. Botones con tacto de consola (hover + active) ───────────────────── */
.fhv-btn,
.fhv-pda-header-btn,
.fhv-pda-link,
.fhv-org-tab,
.fhv-explore .bn-explore-filter,
.fhv-dip-btn,
.fhv-article-source-btn,
#comments.fhv-comments .fhv-comment-submit {
	transition:
		transform 0.16s cubic-bezier(0.22, 1, 0.36, 1),
		background-color 0.16s ease,
		border-color 0.16s ease,
		color 0.16s ease,
		box-shadow 0.18s ease;
}

.fhv-btn:active:not(:disabled),
.fhv-pda-header-btn:active,
.fhv-pda-link:active,
.fhv-org-tab:active,
.fhv-explore .bn-explore-filter:active,
.fhv-dip-btn:active:not(:disabled),
.fhv-article-source-btn:active,
#comments.fhv-comments .fhv-comment-submit:active {
	transform: translateY(0) scale(0.97) !important;
}

/* ── 4. Micro-interacciones en tarjetas (Explorar, Tablón, Orgs, Feed) ─── */
.fhv-org-card,
.fhv-card,
.fhv-media-card,
.fhv-roster-item {
	transition:
		transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
		border-color 0.2s ease,
		box-shadow 0.22s ease,
		background-color 0.18s ease;
}

.fhv-org-card,
.fhv-card {
	position: relative;
	overflow: hidden;
}

/* Brillo táctico sutil en el borde superior al pasar el ratón */
.fhv-org-card::after,
.fhv-card::after {
	content: "";
	position: absolute;
	top: 0;
	left: -40%;
	width: 55%;
	height: 2px;
	background: linear-gradient(90deg, transparent, rgba(127, 202, 217, 0.85), transparent);
	opacity: 0;
	transform: translateX(0);
	pointer-events: none;
	transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.fhv-org-card:hover::after,
.fhv-card:hover::after {
	opacity: 1;
	transform: translateX(220%);
}

.fhv-org-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.44), 0 0 18px rgba(101, 184, 201, 0.12);
}

.fhv-media-card:hover {
	transform: translateY(-3px);
	border-color: rgba(101, 184, 201, 0.45);
	box-shadow: 0 12px 26px rgba(0, 0, 0, 0.44);
}

.fhv-roster-item:hover {
	border-color: rgba(101, 184, 201, 0.32);
	background: #162334;
}

/* Zoom sutil en portadas e imágenes de tarjetas */
.fhv-card__media img,
.fhv-media-card img,
.fhv-explore .ec-card .ec-img img,
.fhv-org-emblem img {
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.fhv-card:hover .fhv-card__media img,
.fhv-media-card:hover img,
.fhv-explore .ec-card:hover .ec-img img {
	transform: scale(1.035);
}

.fhv-org-card:hover .fhv-org-emblem img {
	transform: scale(1.06);
}

/* Tarjetas del feed de BuddyNext */
body.fehiver-scifi-theme .bn-post-card,
body.fehiver-scifi-theme .bn-sidebar-card {
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.fehiver-scifi-theme .bn-post-card:hover {
	border-color: rgba(101, 184, 201, 0.28);
}

/* ── 5. Entrada escalonada (Stagger) al cargar grids y paneles ──────────── */
.fhv-org-hero,
.fhv-explore-hero.bn-explore-hero,
.fhv-article-hero,
.fhv-article-card,
.fhv-org-panel,
.fhv-fairplay-banner {
	animation: fhv-enter-up 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fhv-org-grid > .fhv-org-card,
.fhv-grid > .fhv-card,
.fhv-explore .bn-explore-grid > .ec-card,
.fhv-media-grid > .fhv-media-card {
	animation: fhv-enter-up 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fhv-org-grid > .fhv-org-card:nth-child(2),
.fhv-grid > .fhv-card:nth-child(2),
.fhv-explore .bn-explore-grid > .ec-card:nth-child(2),
.fhv-media-grid > .fhv-media-card:nth-child(2) { animation-delay: 35ms; }

.fhv-org-grid > .fhv-org-card:nth-child(3),
.fhv-grid > .fhv-card:nth-child(3),
.fhv-explore .bn-explore-grid > .ec-card:nth-child(3),
.fhv-media-grid > .fhv-media-card:nth-child(3) { animation-delay: 70ms; }

.fhv-org-grid > .fhv-org-card:nth-child(4),
.fhv-grid > .fhv-card:nth-child(4),
.fhv-explore .bn-explore-grid > .ec-card:nth-child(4),
.fhv-media-grid > .fhv-media-card:nth-child(4) { animation-delay: 105ms; }

.fhv-org-grid > .fhv-org-card:nth-child(5),
.fhv-grid > .fhv-card:nth-child(5),
.fhv-explore .bn-explore-grid > .ec-card:nth-child(5),
.fhv-media-grid > .fhv-media-card:nth-child(5) { animation-delay: 140ms; }

.fhv-org-grid > .fhv-org-card:nth-child(6),
.fhv-grid > .fhv-card:nth-child(6),
.fhv-explore .bn-explore-grid > .ec-card:nth-child(6),
.fhv-media-grid > .fhv-media-card:nth-child(6) { animation-delay: 175ms; }

.fhv-org-grid > .fhv-org-card:nth-child(n+7),
.fhv-grid > .fhv-card:nth-child(n+7),
.fhv-explore .bn-explore-grid > .ec-card:nth-child(n+7),
.fhv-media-grid > .fhv-media-card:nth-child(n+7) { animation-delay: 205ms; }

/* ── 6. Apertura tipo terminal para [PDA], Modales y Toasts ─────────────── */
.fhv-pda-drawer:not([hidden]) {
	animation: fhv-terminal-open 0.19s cubic-bezier(0.22, 1, 0.36, 1) both;
	transform-origin: top right;
}

.fhv-modal-backdrop:not([hidden]),
.fhv-org-modal-bg {
	animation: fhv-backdrop-in 0.16s ease both;
}

.fhv-modal-backdrop:not([hidden]) .fhv-modal-box,
.fhv-org-modal-bg .fhv-org-modal {
	animation: fhv-terminal-open 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fhv-toast {
	animation: fhv-toast-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── 7. Pulso vivo de telemetría (solo elementos en directo / estado) ───── */
.fhv-pda-fab__dot,
.fhv-explore-hero__kicker::before,
.fhv-sc-pill--ok .fhv-sc-dot,
.fhv-sc-pill--warn .fhv-sc-dot,
.fhv-sc-pill--danger .fhv-sc-dot {
	animation: fhv-pulse-dot 2.4s ease-in-out infinite;
}

.fhv-org-badge--live,
.fhv-pda-fab__alert {
	animation: fhv-pulse-live 1.9s ease-in-out infinite;
}

/* ── 8. Barras de progreso vivas (cupos de batalla y maestrías) ─────────── */
.fhv-quota-bar__fill,
.fhv-mastery-bar__fill {
	transform-origin: left center;
	animation: fhv-bar-grow 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── 8b. Loader Holográfico FEHIVER (PDA, Organizaciones, Parlamento, Tablón) */
@keyframes fhv-spin-cw {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}

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

@keyframes fhv-scan-bar {
	0%   { transform: translateX(-100%); }
	100% { transform: translateX(260%); }
}

@keyframes fhv-nebula-drift {
	0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
	100% { transform: translate3d(2%, 2%, 0) scale(1.05); }
}

@keyframes fhv-star-twinkle {
	0%   { opacity: 0.38; }
	100% { opacity: 0.72; }
}

@keyframes fhv-header-stars {
	0%   { transform: translateX(0); }
	50%  { transform: translateX(12px); }
	100% { transform: translateX(0); }
}

.fhv-holo-loader {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 46px 24px;
	border-radius: 12px;
	background:
		radial-gradient(circle at center, rgba(101, 184, 201, 0.11) 0%, transparent 62%),
		linear-gradient(180deg, rgba(15, 22, 33, 0.92) 0%, rgba(9, 14, 22, 0.95) 100%);
	border: 1px solid rgba(101, 184, 201, 0.24);
	text-align: center;
}

.fhv-holo-loader--compact {
	padding: 24px 14px;
	gap: 10px;
	background: transparent;
	border: none;
}

.fhv-holo-loader__orb {
	width: 68px;
	height: 68px;
}

.fhv-holo-loader--compact .fhv-holo-loader__orb {
	width: 50px;
	height: 50px;
}

.fhv-holo-loader__orb svg {
	width: 100%;
	height: 100%;
	overflow: visible;
	filter: drop-shadow(0 0 10px rgba(101, 184, 201, 0.32));
}

.fhv-holo-ring-outer {
	transform-origin: 32px 32px;
	animation: fhv-spin-cw 4.8s linear infinite;
}

.fhv-holo-ring-inner {
	transform-origin: 32px 32px;
	animation: fhv-spin-ccw 3.2s linear infinite;
}

.fhv-holo-hex {
	animation: fhv-pulse-live 2s ease-in-out infinite;
}

.fhv-holo-loader__text {
	font-family: "JetBrains Mono", ui-monospace, monospace;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #9be5f2;
}

.fhv-holo-loader--compact .fhv-holo-loader__text {
	font-size: 11px;
}

.fhv-holo-loader__bar {
	width: 180px;
	max-width: 80%;
	height: 3px;
	border-radius: 99px;
	background: rgba(154, 178, 204, 0.14);
	overflow: hidden;
}

.fhv-holo-loader__bar span {
	display: block;
	width: 38%;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, transparent, #65b8c9, #e2bd74, transparent);
	animation: fhv-scan-bar 1.45s ease-in-out infinite;
}

.fhv-sos-header-btn__dot {
	animation: fhv-pulse-dot 1.9s ease-in-out infinite;
}

/* ── 8c. Overlay Global Holográfico para transiciones entre páginas ─────── */
.fhv-page-loader {
	position: fixed;
	inset: 0;
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(6, 10, 16, 0.74);
	backdrop-filter: blur(7px);
	-webkit-backdrop-filter: blur(7px);
	opacity: 0;
	transition: opacity 0.18s ease;
	pointer-events: all;
}

.fhv-page-loader[hidden] {
	display: none !important;
}

.fhv-page-loader.is-visible {
	opacity: 1;
}

.fhv-page-loader .fhv-holo-loader {
	min-width: 280px;
	padding: 32px 38px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 36px rgba(101, 184, 201, 0.18);
	border-color: rgba(101, 184, 201, 0.42);
}

/* ── 9. Accesibilidad: respeto estricto a prefers-reduced-motion ────────── */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
