/* ===== MICRO-INTERACTIONS & SMOOTH ANIMATIONS ===== */
/* Subtle animations that enhance user experience */

/* ===== LOADING STATES ===== */
@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(0, 102, 255, 0.05) 25%,
    rgba(0, 255, 255, 0.1) 50%,
    rgba(0, 102, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ===== RIPPLE EFFECT ON CLICK ===== */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease, opacity 0.6s ease;
  opacity: 0;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
  opacity: 1;
  transition: width 0s, height 0s, opacity 0.3s ease;
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-scale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Apply animations to cards */
.giveaway-card,
.dashboard-card {
  animation: fade-in-up 0.4s ease-out;
}

.giveaway-card:nth-child(1) { animation-delay: 0.05s; }
.giveaway-card:nth-child(2) { animation-delay: 0.1s; }
.giveaway-card:nth-child(3) { animation-delay: 0.15s; }
.giveaway-card:nth-child(4) { animation-delay: 0.2s; }
.giveaway-card:nth-child(5) { animation-delay: 0.25s; }
.giveaway-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== NOTIFICATION ENTRANCE ===== */
@keyframes slide-in-from-right {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-out-to-right {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast {
  animation: slide-in-from-right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.toast.removing {
  animation: slide-out-to-right 0.3s ease-in forwards;
}

/* ===== MODAL ANIMATIONS ===== */
@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-slide-up {
  from {
    transform: translateY(50px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal {
  animation: modal-fade-in 0.2s ease;
}

.modal-dialog {
  animation: modal-slide-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== DROPDOWN ANIMATIONS ===== */
@keyframes dropdown-slide-down {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.notifications-dropdown {
  animation: dropdown-slide-down 0.3s ease-out;
}

/* Mobile bottom sheet animation */
@media (max-width: 768px) {
  @keyframes bottom-sheet-slide-up {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .notifications-dropdown {
    animation: bottom-sheet-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  }
}

/* ===== BUTTON PRESS FEEDBACK ===== */
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-steam {
  transition: transform 0.1s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.btn-primary:active,
.btn-secondary:active,
.btn-outline:active {
  transform: scale(0.97) !important;
}

/* ===== GLOW PULSE ANIMATION ===== */
@keyframes glow-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(0, 102, 255, 0.4), 0 0 35px rgba(0, 255, 255, 0.2);
  }
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.form-input:focus-visible {
  animation: glow-pulse 2s ease-in-out infinite;
}

/* ===== PROGRESS INDICATORS ===== */
@keyframes progress-bar {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--tech-cyan), transparent);
  z-index: 9999;
  animation: progress-bar 1.5s ease-in-out infinite;
}

/* ===== HOVER LIFT EFFECT ===== */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 102, 255, 0.25);
}

/* ===== SMOOTH SCROLL INDICATOR ===== */
@keyframes bounce-down {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

.scroll-indicator {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce-down 2s ease-in-out infinite;
  opacity: 0.6;
  transition: opacity 0.3s ease;
  z-index: 100;
}

.scroll-indicator:hover {
  opacity: 1;
}

/* Hide scroll indicator when scrolled */
.scrolled .scroll-indicator {
  opacity: 0;
  pointer-events: none;
}

/* ===== COUNTER ANIMATION ===== */
@keyframes count-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat-value,
.metric-value {
  animation: count-up 0.6s ease-out;
}

/* ===== CARD FLIP EFFECT (for special items) ===== */
.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ===== STAGGER ANIMATION UTILITY ===== */
.stagger-animation > * {
  animation: fade-in-up 0.5s ease-out backwards;
}

.stagger-animation > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-animation > *:nth-child(8) { animation-delay: 0.4s; }

/* ===== SHIMMER EFFECT ===== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 255, 255, 0.1) 50%,
    transparent 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ===== TYPING INDICATOR ===== */
@keyframes typing-dot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.5rem;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
  animation: typing-dot 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

/* ===== SUCCESS CHECKMARK ANIMATION ===== */
@keyframes draw-check {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.success-checkmark {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw-check 0.5s ease-out forwards;
}

/* ===== PARTICLE EFFECT ON HOVER ===== */
@keyframes particle-float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-30px) translateX(10px);
    opacity: 0;
  }
}

.particle-effect {
  position: relative;
  overflow: visible;
}

.particle-effect::before,
.particle-effect::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--tech-cyan);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.particle-effect:hover::before {
  animation: particle-float 1s ease-out;
  left: 20%;
  top: 50%;
}

.particle-effect:hover::after {
  animation: particle-float 1.2s ease-out;
  animation-delay: 0.1s;
  left: 80%;
  top: 50%;
}

/* ===== SMOOTH STATE TRANSITIONS ===== */
.page-transition-enter {
  animation: fade-in-up 0.4s ease-out;
}

.page-transition-exit {
  animation: fade-in-up 0.3s ease-in reverse;
}

/* ===== LIGHT THEME ANIMATIONS & EFFECTS ===== */

/* Light theme skeleton loading */
[data-theme="light"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.05) 25%,
    rgba(139, 92, 246, 0.15) 50%,
    rgba(139, 92, 246, 0.05) 75%
  );
}

/* Light theme ripple */
[data-theme="light"] .ripple::after {
  background: rgba(139, 92, 246, 0.3);
}

/* Light theme glow pulse */
@keyframes glow-pulse-light {
  0%, 100% {
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.15);
  }
  50% {
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.3), 0 0 30px rgba(139, 92, 246, 0.15);
  }
}

[data-theme="light"] .btn-primary:focus-visible,
[data-theme="light"] .btn-secondary:focus-visible,
[data-theme="light"] .form-input:focus-visible {
  animation: glow-pulse-light 2s ease-in-out infinite;
}

/* Light theme hover lift */
[data-theme="light"] .hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 0 30px rgba(124, 58, 237, 0.15);
}

/* Light theme shimmer */
[data-theme="light"] .shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(139, 92, 246, 0.15) 50%,
    transparent 100%
  );
}

/* Light theme particle effect */
[data-theme="light"] .particle-effect::before,
[data-theme="light"] .particle-effect::after {
  background: var(--accent-primary);
}

/* Light theme loading bar */
[data-theme="light"] .loading-bar {
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

/* ===== LIGHT THEME SOFT GLOW EFFECTS ===== */

/* Soft gradient background animation for light theme */
@keyframes soft-gradient {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

[data-theme="light"] .giveaways-hero {
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.08),
    rgba(236, 72, 153, 0.05),
    rgba(139, 92, 246, 0.08)
  );
  background-size: 200% 200%;
  animation: soft-gradient 8s ease-in-out infinite;
}

/* Light theme card hover glow */
@keyframes card-glow-light {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  50% {
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.15);
  }
}

[data-theme="light"] .giveaway-card:hover {
  animation: card-glow-light 2s ease-in-out infinite;
}

/* Light theme floating shapes */
@keyframes float-shape {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0.5;
  }
  25% {
    transform: translate(10px, -10px) rotate(90deg);
    opacity: 0.7;
  }
  50% {
    transform: translate(0, -20px) rotate(180deg);
    opacity: 0.5;
  }
  75% {
    transform: translate(-10px, -10px) rotate(270deg);
    opacity: 0.7;
  }
}

/* Subtle decorative shapes for light theme */
.light-decorations {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.light-decorations::before,
.light-decorations::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  opacity: 0;
}

[data-theme="light"] .light-decorations::before {
  top: 10%;
  right: 10%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  animation: float-shape 20s ease-in-out infinite;
  opacity: 1;
}

[data-theme="light"] .light-decorations::after {
  bottom: 10%;
  left: 10%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.06) 0%, transparent 70%);
  animation: float-shape 25s ease-in-out infinite reverse;
  opacity: 1;
}

/* ===== ADVANCED ANIMATIONS ===== */

/* Confetti burst for wins */
@keyframes confetti-fall {
  0% {
    transform: translateY(-100%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  top: 0;
  pointer-events: none;
  z-index: 9999;
}

.confetti:nth-child(odd) {
  background: var(--accent-primary);
}

.confetti:nth-child(even) {
  background: var(--accent-secondary);
}

/* Trophy bounce for winners */
@keyframes trophy-bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  25% {
    transform: translateY(-20px) scale(1.1);
  }
  50% {
    transform: translateY(0) scale(1);
  }
  75% {
    transform: translateY(-10px) scale(1.05);
  }
}

.trophy-animation {
  animation: trophy-bounce 1s ease-in-out;
}

/* Heartbeat for live indicators */
@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.15);
  }
  70% {
    transform: scale(1);
  }
}

.heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* Pulse ring for notifications */
@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-ring 1.5s ease-out infinite;
}

/* Shake animation for errors */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Bounce in animation */
@keyframes bounce-in {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.bounce-in {
  animation: bounce-in 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Spotlight effect */
@keyframes spotlight {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.spotlight {
  position: relative;
  overflow: hidden;
}

.spotlight::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: spotlight 3s ease-in-out infinite;
  pointer-events: none;
}

[data-theme="light"] .spotlight::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(139, 92, 246, 0.1) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
}

/* Glow text animation */
@keyframes glow-text {
  0%, 100% {
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
  }
  50% {
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.8), 0 0 30px rgba(139, 92, 246, 0.6);
  }
}

.glow-text {
  animation: glow-text 2s ease-in-out infinite;
}

[data-theme="light"] .glow-text {
  animation: none;
  color: var(--accent-primary);
  font-weight: 600;
}

/* Counter roll animation */
@keyframes counter-roll {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

.counter-roll {
  display: inline-block;
  animation: counter-roll 0.4s ease-out;
}

/* Gradient border animation */
@keyframes gradient-border {
  0%, 100% {
    border-color: var(--accent-primary);
  }
  50% {
    border-color: var(--accent-secondary);
  }
}

.gradient-border-animated {
  animation: gradient-border 3s ease-in-out infinite;
}

/* ===== ACCESSIBILITY: Respect user preferences ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
