/* Enhanced US Pokemon Collection Styles */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P:wght@400&family=Inter:wght@400;500;600;700&family=Crimson+Text:wght@400;600&family=Roboto+Mono:wght@400;500&display=swap');

/* CSS Custom Properties for theming */
:root {
  --pokemon-red: #DC2626;
  --pokemon-blue: #2563EB;
  --pokemon-yellow: #EAB308;
  --cream-bg: #FEF7ED;
  --shadow-hover: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Typography Hierarchy */
.pokemon-title {
  font-family: 'Press Start 2P', cursive;
  text-shadow: 
    2px 2px 0px var(--pokemon-yellow),
    4px 4px 0px var(--pokemon-red),
    6px 6px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 3px;
  line-height: 1.2;
}

.pokemon-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.description-text {
  font-family: 'Crimson Text', serif;
  line-height: 1.6;
  font-size: 0.95rem;
}

.stat-font {
  font-family: 'Roboto Mono', monospace;
}

/* Enhanced pixel art rendering */
.pixel-art {
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: contrast(1.1) saturate(1.1);
}

/* Enhanced pokeball spinner */
.pokeball-spinner {
  position: relative;
  border: 4px solid transparent;
  border-top: 4px solid var(--pokemon-red);
  border-right: 4px solid var(--pokemon-red);
  border-bottom: 4px solid #FFFFFF;
  border-left: 4px solid #FFFFFF;
  border-radius: 50%;
  animation: pokeball-spin 1.5s ease-in-out infinite;
}

@keyframes pokeball-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Enhanced pokemon button styling */
.pokemon-button {
  background: linear-gradient(135deg, var(--pokemon-red), #EF4444, var(--pokemon-red));
  border: 3px solid #FFFFFF;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
  background-size: 300% 300%;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.pokemon-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 10px 25px rgba(220, 38, 38, 0.4),
    0 0 0 3px rgba(255, 255, 255, 0.8);
}

.pokemon-button:active {
  transform: translateY(-1px) scale(1.01);
}

.pokemon-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 12px;
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #FFFFFF, #E5E7EB);
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

/* Enhanced card hover effects */
.card-hover-glow {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.card-hover-glow:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: var(--shadow-hover);
}

.card-hover-glow:hover::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, 
    rgba(236, 72, 153, 0.3), 
    rgba(59, 130, 246, 0.3), 
    rgba(16, 185, 129, 0.3),
    rgba(245, 158, 11, 0.3)
  );
  border-radius: inherit;
  z-index: -1;
  filter: blur(8px);
  opacity: 0;
  animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.3; filter: blur(8px) hue-rotate(0deg); }
  50% { opacity: 0.6; filter: blur(12px) hue-rotate(90deg); }
}

/* Enhanced modal overlay */
.modal-overlay {
  backdrop-filter: blur(8px);
  animation: modal-fade-in 0.3s ease-out;
}

.modal-content {
  animation: modal-slide-up 0.3s ease-out;
  max-height: calc(100vh - 2rem);
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Enhanced loading animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.skeleton-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Type-specific visual enhancements */
.type-fire { --glow-color: rgba(239, 68, 68, 0.5); }
.type-water { --glow-color: rgba(59, 130, 246, 0.5); }
.type-grass { --glow-color: rgba(34, 197, 94, 0.5); }
.type-electric { --glow-color: rgba(234, 179, 8, 0.5); }

/* Accessibility improvements */
button:focus {
  outline: 3px solid var(--pokemon-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .pokemon-title {
    text-shadow: 2px 2px 0px #000, -2px -2px 0px #fff;
  }
  
  .card-hover-glow:hover {
    border: 4px solid #000;
  }
}

/* Custom scrollbar styling */
.overflow-y-auto::-webkit-scrollbar {
  width: 12px;
}

.overflow-y-auto::-webkit-scrollbar-track {
  background: linear-gradient(to bottom, #f1f5f9, #e2e8f0);
  border-radius: 6px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--pokemon-blue), var(--pokemon-red));
  border-radius: 6px;
  border: 2px solid #f1f5f9;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, var(--pokemon-red), var(--pokemon-blue));
}

/* Enhanced responsive design */
@media (max-width: 640px) {
  .pokemon-title {
    font-size: 1.75rem;
    letter-spacing: 1px;
    line-height: 1.3;
  }
  
  .modal-content {
    margin: 1rem;
    border-radius: 1rem;
    max-height: calc(100vh - 2rem);
  }
  
  .grid {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .pokemon-title {
    font-size: 1.5rem;
  }
  
  .card-hover-glow {
    padding: 1rem;
  }
}

/* Print styles */
@media print {
  .pokemon-button,
  .modal-overlay,
  button {
    display: none !important;
  }
  
  .card-hover-glow {
    break-inside: avoid;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

/* Enhanced error states */
.error-shake {
  animation: error-shake 0.5s ease-in-out;
}

@keyframes error-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Success animations */
.success-bounce {
  animation: success-bounce 0.6s ease-out;
}

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

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

/* Custom background pattern */
body {
  background-image: 
    radial-gradient(circle at 25px 25px, rgba(255,255,255,0.2) 2%, transparent 2%),
    linear-gradient(135deg, #fef7ed 0%, #dbeafe 100%);
  background-size: 50px 50px, 100% 100%;
  min-height: 100vh;
}

/* Enhanced focus indicators for accessibility */
.pokemon-card:focus-within {
  outline: 3px solid var(--pokemon-blue);
  outline-offset: 2px;
}

/* Loading state optimizations */
.loading-state {
  pointer-events: none;
  opacity: 0.7;
}

/* Performance optimizations */
.will-change-transform {
  will-change: transform;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
}