/*
  Flex Dashboard — animations.css
  Extra polish: page transitions, micro-interactions
*/

/* Page transition (when navigating) */
.content-header,
.panel,
.form,
.card {
  animation: fadeInUp 0.5s var(--ease-snappy) backwards;
}
.content-header { animation-delay: 0.05s; }
.layout .content > .panel:nth-of-type(1),
.layout .content > .form:nth-of-type(1) { animation-delay: 0.1s; }
.layout .content > .panel:nth-of-type(2),
.layout .content > .form:nth-of-type(2) { animation-delay: 0.15s; }
.layout .content > .panel:nth-of-type(3),
.layout .content > .form:nth-of-type(3) { animation-delay: 0.2s; }

/* Form-row stagger */
.form .form-row,
.form .form-group { animation: fadeInUp 0.4s var(--ease-snappy) backwards; }
.form .form-row:nth-child(1) { animation-delay: 0.1s; }
.form .form-row:nth-child(2) { animation-delay: 0.15s; }
.form .form-row:nth-child(3) { animation-delay: 0.2s; }
.form .form-row:nth-child(4) { animation-delay: 0.22s; }
.form .form-row:nth-child(5) { animation-delay: 0.24s; }

/* Card-Row Stagger */
.cards-row > * { animation: scaleIn 0.4s var(--ease-snappy) backwards; }
.cards-row > *:nth-child(1) { animation-delay: 0.05s; }
.cards-row > *:nth-child(2) { animation-delay: 0.1s; }
.cards-row > *:nth-child(3) { animation-delay: 0.15s; }
.cards-row > *:nth-child(4) { animation-delay: 0.2s; }

/* Button shine on hover */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.2),
    transparent
  );
  transition: left 0.6s var(--ease-smooth);
  z-index: 2;
}
.btn-primary:hover::after { left: 100%; }

/* Sidebar nav icon bounce on click */
.sidebar-nav a:active .sidebar-icon {
  animation: bounceIcon 0.4s var(--ease-bounce);
}
@keyframes bounceIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(-8deg); }
}

/* Stat-Card Numbers Counter Animation (no JS — pure CSS pulse on first load) */
.stat-value {
  animation: statPulse 1s var(--ease-snappy) 0.5s backwards;
}
@keyframes statPulse {
  0% { opacity: 0; transform: scale(0.8); }
  60% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* Server cards: fluid hover lift with shadow grow */
.server-card {
  will-change: transform, box-shadow;
}

/* Brand pulse (subtle) */
.brand img {
  animation: brandPulse 4s var(--ease-smooth) infinite;
}
@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(124,92,255,0.3), 0 4px 16px rgba(124,92,255,0.4); }
  50%      { box-shadow: 0 0 0 2px rgba(124,92,255,0.5), 0 6px 24px rgba(124,92,255,0.6); }
}

/* Music player thumb subtle rotate */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Flash message slide-out (use with JS or just pulse) */
.flash {
  animation: slideDownAndIn 0.5s var(--ease-snappy);
}
@keyframes slideDownAndIn {
  0% { opacity: 0; transform: translateY(-20px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Flash auto-fade nach 4s */
.flash {
  animation: slideDownAndIn 0.5s var(--ease-snappy), flashFade 0.5s var(--ease-smooth) 4s forwards;
}
@keyframes flashFade {
  to { opacity: 0; transform: translateY(-10px); pointer-events: none; }
}

/* Hover-Lift Util-class */
.hover-lift {
  transition: transform 0.25s var(--ease-snappy), box-shadow 0.25s var(--ease-smooth);
}
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }

/* Disable on reduced motion */
@media (prefers-reduced-motion: reduce) {
  .stat-value,
  .brand img,
  .flash { animation: none !important; }
}

/* ============================================================
   SPA NAVIGATION
   ============================================================ */

/* Top progress bar (during navigation) */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 12px var(--primary-glow);
  z-index: 1000;
  transition: width 0.4s var(--ease-smooth), opacity 0.3s var(--ease-smooth);
  opacity: 0;
}
.nav-progress.loading {
  opacity: 1;
  width: 70%;
  transition: width 1.5s cubic-bezier(0.1, 0.5, 0.1, 1);
}
.nav-progress.done {
  opacity: 1;
  width: 100%;
  transition: width 0.2s var(--ease-smooth);
}

/* Content cross-fade transition */
.content {
  transition: opacity 0.18s var(--ease-smooth), transform 0.25s var(--ease-snappy);
}
.content-leaving {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
.content-entering {
  opacity: 0;
  transform: translateY(12px);
}

/* When content is normally rendered (not entering/leaving), its own 
   children get the slideInUp via animations.css directly.
   The wrapper itself shouldn't fade-in because that conflicts with the
   stagger-animations on its children. */

/* ============================================================
   QUICK-SWITCHER (Cmd/Ctrl+K modal)
   ============================================================ */
.quick-switcher {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 24, 0.7);
  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-smooth);
}
.quick-switcher.open {
  opacity: 1;
  pointer-events: auto;
}

.quick-switcher-box {
  width: min(560px, 90vw);
  background: var(--bg-card);
  backdrop-filter: var(--blur-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  transform: translateY(-12px) scale(0.97);
  transition: transform 0.25s var(--ease-snappy);
}
.quick-switcher.open .quick-switcher-box {
  transform: translateY(0) scale(1);
}

.qs-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-glass);
}
.qs-input-wrap::before {
  content: '⌘';
  color: var(--text-muted);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.qs-input-wrap input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 1rem;
  color: var(--text);
  font-weight: 500;
}
.qs-input-wrap input:focus { outline: none; box-shadow: none !important; }
.qs-input-wrap kbd {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 3px 8px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-glass);
  border-radius: 5px;
  color: var(--text-muted);
}

.qs-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}
.qs-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-soft);
  text-decoration: none;
  transition: all 0.15s var(--ease-smooth);
}
.qs-list a:hover,
.qs-list a:focus {
  background: var(--bg-hover);
  color: var(--text);
  text-decoration: none;
  transform: translateX(2px);
}
.qs-list .qs-icon { font-size: 1.1rem; width: 22px; text-align: center; }


/* ============================================================
   FOOTER HEART (Vorks.NET branding)
   ============================================================ */
.footer-heart {
  display: inline-block;
  color: #ef4444;
  font-size: 1.05em;
  margin: 0 2px;
  animation: heartbeat 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.4));
  vertical-align: -1px;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  10%, 30% { transform: scale(0.9); }
  20%      { transform: scale(1.15); }
  40%      { transform: scale(1); }
}

/* Footer overall */
.footer p {
  margin: 0;
}
.footer a {
  color: var(--text-soft);
  font-weight: 500;
}
.footer a:hover {
  color: var(--primary);
}

/* ============================================================
   DEV PANEL — Special styling
   ============================================================ */
.navlink-dev {
  color: #fbbf24 !important;
  background: linear-gradient(135deg, rgba(251,191,36,0.08), rgba(239,68,68,0.05));
  border: 1px solid rgba(251,191,36,0.18);
}
.navlink-dev:hover {
  background: linear-gradient(135deg, rgba(251,191,36,0.18), rgba(239,68,68,0.1)) !important;
  border-color: rgba(251,191,36,0.4);
}

.dev-sidebar .sidebar-guild .guild-icon-fallback {
  font-size: 1.4rem;
  color: white;
}

.dev-sidebar .sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(251,191,36,0.2), rgba(239,68,68,0.05));
  box-shadow: inset 0 0 0 1px rgba(251,191,36,0.25);
}
.dev-sidebar .sidebar-nav a.active::before {
  background: linear-gradient(180deg, #fbbf24, #ef4444);
}

/* Reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .footer-heart { animation: none !important; }
}

