/* ЕДР — animations.css
   Keyframes, transitions, hover effects, NEW badge pulse */

/* Core keyframes */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scale-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* NEW badge pulse */
@keyframes badge-pulse {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(255, 107, 107, 0.7);
    transform: scale(1.05);
  }
}

/* Toast animations */
@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%) scale(0.8); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.8); }
}

/* Page transitions */
@keyframes page-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-enter {
  animation: page-enter 0.25s ease;
}

/* Skeleton loading */
@keyframes skeleton-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--card) 25%,
    var(--card-hover) 50%,
    var(--card) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

.skeleton-title {
  height: 22px;
  width: 60%;
  border-radius: 4px;
}

.skeleton-photo {
  width: 100%;
  height: 200px;
  border-radius: 0;
}

/* Accent glow effects */
.glow-accent {
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
}

.glow-alt {
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.25);
}

/* Sidebar gradient line */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--accent) 30%,
    var(--accent-alt) 70%,
    transparent
  );
  opacity: 0.2;
}

/* Nav item ripple */
.nav-item { overflow: hidden; }

/* Card entrance */
.joker-card {
  animation: scale-in 0.2s ease;
}

/* Interactive accent underline */
.accent-link {
  position: relative;
  color: var(--text);
  font-weight: 500;
}
.accent-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.accent-link:hover::after { width: 100%; }
.accent-link:hover { color: var(--accent); }

/* Cosmic Void Background (ThoughtLab Obsidian Sphere) */
.cosmic-void-bg {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.cosmic-void-bg::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90vw;
  height: 90vw;
  max-width: 1200px;
  max-height: 1200px;
  background: #000000;
  border-radius: 50%;
  /* Obsidian rim lighting - enhanced visibility */
  box-shadow: inset -30px -30px 100px rgba(62, 207, 142, 0.15),
              inset 20px 20px 60px rgba(255, 255, 255, 0.05),
              0 0 160px rgba(62, 207, 142, 0.1);
  transform: translate(-30%, -50%);
  animation: liquid-sphere 20s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.cosmic-void-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.6;
  mix-blend-mode: screen;
}

@keyframes liquid-sphere {
  0% { transform: translate(-30%, -50%) scale(0.9) rotate(0deg); border-radius: 45% 55% 40% 60%; }
  50% { transform: translate(-40%, -45%) scale(1.05) rotate(10deg); border-radius: 55% 45% 60% 40%; }
  100% { transform: translate(-25%, -55%) scale(1) rotate(-5deg); border-radius: 50% 50% 45% 55%; }
}

/* Auth Mesh Background */
.auth-mesh-bg {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-mesh-bg::before {
  content: '';
  position: absolute;
  width: 150vw;
  height: 150vh;
  top: -25vh;
  left: -25vw;
  background: radial-gradient(circle at 50% 50%, rgba(62, 207, 142, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 80% 20%, rgba(252, 28, 70, 0.05) 0%, transparent 40%);
  animation: auth-mesh-pulse 15s ease-in-out infinite alternate;
}

.auth-mesh-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='1' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E");
  opacity: 0.8;
}

@keyframes auth-mesh-pulse {
  0% { transform: scale(1) rotate(0deg); opacity: 0.8; }
  100% { transform: scale(1.2) rotate(5deg); opacity: 1; }
}

.auth-mockup {
  position: absolute;
  top: 50%;
  background: rgba(10, 20, 15, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 24px 64px rgba(62, 207, 142, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transform-style: preserve-3d;
  z-index: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.auth-mockup-center {
  left: 50%;
  width: 480px;
  max-width: 90vw;
  height: 240px;
  animation: float-mockup-center 10s ease-in-out infinite alternate;
}

.auth-mockup-left {
  left: 5%;
  width: 380px;
  max-width: 80vw;
  animation: float-mockup-left 14s ease-in-out infinite alternate-reverse;
}

.auth-mockup-right {
  left: 95%;
  width: 380px;
  max-width: 80vw;
  animation: float-mockup-right 12s ease-in-out infinite alternate;
}

@keyframes float-mockup-center {
  0% { transform: translate(-50%, -85%) perspective(1200px) rotateX(12deg) translateY(0); opacity: 0.7; }
  100% { transform: translate(-50%, -75%) perspective(1200px) rotateX(4deg) translateY(-10px); opacity: 0.95; }
}

@keyframes float-mockup-left {
  0% { transform: translate(0, -40%) perspective(1200px) rotateX(15deg) rotateY(30deg) translateY(0); opacity: 0.5; }
  100% { transform: translate(0, -50%) perspective(1200px) rotateX(5deg) rotateY(20deg) translateY(-20px); opacity: 0.8; }
}

@keyframes float-mockup-right {
  0% { transform: translate(-100%, -60%) perspective(1200px) rotateX(20deg) rotateY(-30deg) translateY(0); opacity: 0.5; }
  100% { transform: translate(-100%, -50%) perspective(1200px) rotateX(10deg) rotateY(-20deg) translateY(-20px); opacity: 0.8; }
}

.auth-mockup-header {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-lg, 14px) var(--radius-lg, 14px) 0 0;
}

.auth-mockup-dots {
  display: flex;
  gap: 6px;
}

.auth-mockup-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #444;
}
.auth-mockup-dots span:nth-child(1) { background: #ff5f56; }
.auth-mockup-dots span:nth-child(2) { background: #ffbd2e; }
.auth-mockup-dots span:nth-child(3) { background: #27c93f; }

.auth-mockup-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  padding-right: 40px; /* Offset to center title against dots */
}

.auth-mockup-body {
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.auth-mockup-cursor {
  display: inline-block;
  width: 8px;
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Spinner variants */
.spinner-sm {
  width: 14px; height: 14px;
  border-width: 2px;
}

.spinner-lg {
  width: 40px; height: 40px;
  border-width: 3px;
}

/* Drag indicator */
@keyframes drag-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

[draggable="true"] {
  cursor: grab;
}
[draggable="true"]:active {
  cursor: grabbing;
}

/* Smooth appear for list items */
.list-item-appear {
  animation: slide-in-right 0.2s ease;
}

/* Number counter animation */
@keyframes count-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.count-appear {
  animation: count-up 0.4s ease;
}
