html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}
/* ========================================
   COMMUNITY PAGE ANIMATIONS
   ======================================== */

/* Post card staggered slide-up animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card-animate {
  animation: slideUp 0.4s ease-out forwards;
  animation-delay: var(--anim-delay, 0ms);
  opacity: 0;
}

/* Post composer card entrance */
.post-composer-card {
  animation: slideUp 0.3s ease-out forwards;
}

/* Like button bounce animation */
@keyframes likeBounce {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.3);
  }
  50% {
    transform: scale(0.9);
  }
  75% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.like-bounce {
  animation: likeBounce 0.4s ease-out;
}

/* Online indicator pulse */
@keyframes onlinePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

.online-pulse {
  animation: onlinePulse 2s infinite;
}

/* Button pulse on hover */
@keyframes btnPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(234, 179, 8, 0);
  }
}

.btn-pulse:hover:not(:disabled) {
  animation: btnPulse 1.5s infinite;
}

/* Reaction button hover effect */
.btn-reaction {
  position: relative;
  overflow: visible;
}

.btn-reaction::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.btn-reaction:hover::before {
  opacity: 1;
}

/* Avatar ring glow on hover */
.avatar-ring {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.avatar-ring:hover {
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.3);
}

/* Tab indicator slide animation */
@keyframes tabSlide {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.tab-indicator {
  transform-origin: left;
  animation: tabSlide 0.2s ease-out forwards;
}

/* Progress bar shimmer effect */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.progress-shimmer {
  background: linear-gradient(
    90deg,
    rgba(234, 179, 8, 0.3) 0%,
    rgba(234, 179, 8, 0.6) 50%,
    rgba(234, 179, 8, 0.3) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
}

/* Card hover elevation effect */
.glass-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card-animate:hover {
  background-color: rgba(15, 23, 42, 0.3);
  transition: background-color 0.2s ease;
}

/* Smooth transitions for interactive elements */
.transition-smooth {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus ring for accessibility */
.focus-ring:focus-visible {
  outline: 2px solid rgba(234, 179, 8, 0.5);
  outline-offset: 2px;
}

/* Loading spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ========================================
   LEADERBOARD ANIMATIONS
   ======================================== */

/* First place glow effect */
.first-place-glow {
  animation: firstPlaceGlow 3s ease-in-out infinite;
}

@keyframes firstPlaceGlow {
  0%, 100% {
    box-shadow: 
      0 0 20px rgba(234, 179, 8, 0.4),
      0 0 40px rgba(234, 179, 8, 0.2),
      0 0 60px rgba(234, 179, 8, 0.1);
  }
  50% {
    box-shadow: 
      0 0 30px rgba(234, 179, 8, 0.6),
      0 0 60px rgba(234, 179, 8, 0.3),
      0 0 90px rgba(234, 179, 8, 0.15);
  }
}

/* Crown float animation */
.crown-animate {
  animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
  0%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-3px);
  }
}

/* Medal badge pulse */
.medal-badge {
  animation: medalPulse 2.5s ease-in-out infinite;
}

@keyframes medalPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* Podium container entrance */
.podium-container {
  animation: podiumEnter 0.6s ease-out forwards;
}

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

/* Individual podium items staggered entrance */
.podium-item {
  animation: podiumItemEnter 0.5s ease-out forwards;
  opacity: 0;
}

.podium-second {
  animation-delay: 0.15s;
}

.podium-first {
  animation-delay: 0s;
}

.podium-third {
  animation-delay: 0.3s;
}

@keyframes podiumItemEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Leaderboard row staggered entrance */
.leaderboard-row-animate {
  animation: rowSlideIn 0.4s ease-out forwards;
  animation-delay: var(--anim-delay, 0ms);
  opacity: 0;
}

@keyframes rowSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Rank change indicator animation */
.trend-indicator-up {
  animation: trendUp 0.5s ease-out;
}

@keyframes trendUp {
  0% {
    transform: translateY(5px);
    opacity: 0;
  }
  50% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.trend-indicator-down {
  animation: trendDown 0.5s ease-out;
}

@keyframes trendDown {
  0% {
    transform: translateY(-5px);
    opacity: 0;
  }
  50% {
    transform: translateY(2px);
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Points counter animation */
@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.points-animate {
  animation: countUp 0.3s ease-out;
}

/* Progress bar fill animation */
@keyframes progressFill {
  from {
    width: 0;
  }
}

.progress-bar-animate {
  animation: progressFill 0.8s ease-out forwards;
}

/* Sparkline bar animation */
.sparkline-bar {
  animation: sparklineGrow 0.5s ease-out forwards;
  animation-delay: calc(var(--bar-index, 0) * 50ms);
  transform: scaleY(0);
  transform-origin: bottom;
}

@keyframes sparklineGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

/* User rank card attention animation */
.user-rank-attention {
  animation: userRankPulse 3s ease-in-out infinite;
}

@keyframes userRankPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(234, 179, 8, 0);
  }
}

/* Hover highlight effect for leaderboard rows */
.leaderboard-row-animate:hover {
  background-color: rgba(15, 23, 42, 0.4);
}
