/*
  Olympia Polish — detalles que profesionalizan la UI sin invadir
  los estilos existentes.

  - Splash screen con spinner animado
  - Transición fade-up al cambiar de vista
  - Hover sutil en cards/articles
  - Scroll bars más finos y oscuros
  - Foco visible accesible
*/

/* === Splash screen mejorado === */

#splash-screen::after {
  content: "";
  display: block;
  width: 32px;
  height: 32px;
  margin: 18px auto 0;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent, #d4163c);
  animation: olympiaSpin 0.9s linear infinite;
}

@keyframes olympiaSpin {
  to {
    transform: rotate(360deg);
  }
}

/* === Animación fade-up al cambiar vista === */

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

main > section,
main > div,
#content > section,
#content > div {
  animation: olympiaViewFadeUp 0.22s ease both;
}

/* === Hover sutil en cards === */

.card,
article.card,
.olympia-admin__card,
.olympia-admin__metric {
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.card:hover,
article.card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

/* No aplicar hover a las cards dentro de tablas o listas con muchos items
   para evitar movimiento innecesario. */

.olympia-admin__metric:hover {
  transform: translateY(-1px);
}

/* === Botones: micro-animación pulse en click === */

.btn,
.olympia-admin__btn,
button {
  transition:
    transform 80ms ease,
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.btn:active,
.olympia-admin__btn:active,
button:active {
  transform: scale(0.97);
}

/* === Scrollbar fina, color marca === */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* === Foco visible accesible (no rompe diseño) === */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent, #d4163c);
  outline-offset: 2px;
  border-radius: 6px;
}

/* === Inputs y selects con look consistente === */

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  font-family: inherit;
}

/* === Selección de texto con color marca === */

::selection {
  background: rgba(212, 22, 60, 0.4);
  color: #fff;
}

/* === Subrayado de enlaces más profesional === */

a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* === Animación de números para contadores grandes === */

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

.olympia-admin__metric-value,
.kpi-value,
[data-counter] {
  animation: olympiaCountUp 0.4s ease both;
}

/* === Prefer reduced motion: respetar accesibilidad === */

@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;
  }
}
