@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --gold-400: #fbbf24;
  --gold-500: #f59e0b;
  --gold-600: #d97706;
  --purple-900: #581c87;
  --purple-800: #6b21a8;
  --purple-700: #7c3aed;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #581c87, #1e1b4b, #581c87);
  min-height: 100vh;
  color: white;
}

.font-cinzel {
  font-family: 'Cinzel', serif;
}

.mystical-glow {
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5), 0 0 20px rgba(251, 191, 36, 0.3);
}

.cosmic-card {
  background: linear-gradient(135deg, rgba(107, 33, 168, 0.8), rgba(30, 27, 75, 0.8));
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.cosmic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.cosmic-card > * {
  position: relative;
  z-index: 2;
}

.pixel-art {
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--purple-900);
}

::-webkit-scrollbar-thumb {
  background: var(--gold-500);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-400);
}

/* Animations */
@keyframes sparkle {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.animate-sparkle {
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes mystical-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(1deg); }
  66% { transform: translateY(-5px) rotate(-1deg); }
}

.animate-mystical-float {
  animation: mystical-float 3s ease-in-out infinite;
}

/* Button hover effects */
button:not(:disabled):hover {
  transform: translateY(-1px);
}

/* Card hover effects */
.cosmic-card:hover {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Focus styles */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.5);
}

/* Utility classes for colors */
.text-gold-400 { color: var(--gold-400); }
.text-gold-500 { color: var(--gold-500); }
.text-gold-600 { color: var(--gold-600); }
.bg-gold-400 { background-color: var(--gold-400); }
.bg-gold-500 { background-color: var(--gold-500); }
.bg-gold-600 { background-color: var(--gold-600); }
.border-gold-500 { border-color: var(--gold-500); }

/* Card grid responsiveness */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .cosmic-card {
    padding: 1rem;
  }

  .grid-cols-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid-cols-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Loading animation */
@keyframes mystical-spin {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  to { transform: rotate(360deg) scale(1); }
}

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

/* Modal animations */
@keyframes modal-appear {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content {
  animation: modal-appear 0.3s ease-out;
}

/* Star field background effect */
.cosmic-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 40px 70px, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.15), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.1), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  pointer-events: none;
  z-index: 0;
}

/* Favorite star animation */
@keyframes star-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.star-favorite {
  animation: star-pulse 1s ease-in-out;
}

/* Enhanced card preview */
.card-preview {
  transition: all 0.3s ease;
  position: relative;
}

.card-preview:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card-preview::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--gold-400), var(--gold-600), var(--gold-400));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-preview:hover::before {
  opacity: 1;
}