/* Cool Transitions for Hot Wheels Database */

/* Page Load Animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
  50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.8); }
}

/* Apply animations to elements */
.premium-header {
  animation: fadeInUp 0.8s ease-out;
}

.nav-links button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-links button::before {
  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.5s;
}

.nav-links button:hover::before {
  left: 100%;
}

.nav-links button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Tab content transitions */
.tabcontent {
  animation: fadeInUp 0.5s ease-out;
  transition: all 0.3s ease;
}

/* Card hover effects */
.premium-card, .search-result, .collection-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.premium-card::before, .search-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.premium-card:hover::before, .search-result:hover::before {
  transform: translateX(100%);
}

.premium-card:hover, .search-result:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Button animations */
button, .btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

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

button:active::after, .btn:active::after {
  width: 300px;
  height: 300px;
}

button:hover, .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Modal animations */
.auth-modal, #tradeModal, #paymentModal {
  animation: fadeIn 0.3s ease-out;
}

.auth-content {
  animation: bounceIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Input focus effects */
input, select, textarea {
  transition: all 0.3s ease;
  position: relative;
}

input:focus, select:focus, textarea:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Notification animations */
.notification, .reward-notification {
  animation: slideInRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
  from { 
    opacity: 0; 
    transform: translateX(100px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0); 
  }
}

/* Loading animations */
.spinner {
  animation: spin 1s linear infinite;
}

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

/* Collection card special effects */
.collection-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.collection-card:hover {
  transform: translateY(-8px) rotateY(5deg);
  box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.ultra-rare:hover { animation: glow 2s infinite; }
.very-rare:hover { animation: pulse 1.5s infinite; }

/* Stats counter animation */
.stat-number {
  transition: all 0.5s ease;
}

.stat-number:hover {
  transform: scale(1.1);
  color: #667eea;
}

/* Search results stagger animation */
.search-result:nth-child(1) { animation-delay: 0.1s; }
.search-result:nth-child(2) { animation-delay: 0.2s; }
.search-result:nth-child(3) { animation-delay: 0.3s; }
.search-result:nth-child(4) { animation-delay: 0.4s; }

/* Floating elements */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.floating-car {
  animation: float 3s ease-in-out infinite;
}

/* Progress bar animation */
.xp-fill, .milestone-progress div {
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects for interactive elements */
.tablinks:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-1px);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Page transition effect */
body {
  animation: fadeInUp 0.6s ease-out;
}

/* Special rarity effects */
.rarity-ultra-rare {
  background: linear-gradient(45deg, #ff6b6b, #feca57);
  animation: glow 3s infinite;
}

.rarity-very-rare {
  background: linear-gradient(45deg, #a55eea, #26de81);
  animation: pulse 2s infinite;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .premium-card:hover, .search-result:hover {
    transform: translateY(-3px) scale(1.01);
  }
  
  button:hover, .btn:hover {
    transform: translateY(-1px);
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}