* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #0a0a14;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(57, 255, 20, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(184, 41, 221, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 0%, rgba(255, 41, 117, 0.02) 0%, transparent 40%);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0a0a14; }
::-webkit-scrollbar-thumb { background: #2a2a5e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #39ff14; }

/* DNA Helix Animation */
@keyframes helixSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(57, 255, 20, 0.3), 0 0 40px rgba(184, 41, 221, 0.2); }
  50% { box-shadow: 0 0 30px rgba(57, 255, 20, 0.5), 0 0 60px rgba(184, 41, 221, 0.4); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

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

@keyframes dnaStrand {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

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

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

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(57, 255, 20, 0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}

.glass {
  background: rgba(26, 26, 62, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(57, 255, 20, 0.1);
}

.glass-purple {
  background: rgba(40, 20, 60, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(184, 41, 221, 0.15);
}

.btn-generate {
  background: linear-gradient(135deg, #39ff14, #b829dd);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-generate:hover:not(:disabled) {
  transform: scale(1.02);
  animation: pulse-glow 1.5s ease-in-out infinite;
}

.btn-generate:disabled {
  background: linear-gradient(135deg, #1a3a14, #3a1a4a);
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-generate::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.5s ease;
}

.btn-generate:hover:not(:disabled)::after {
  animation: shimmer 1.5s linear infinite;
}

/* Custom dropdown styles */
.dropdown-menu {
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.dropdown-item:hover {
  background: rgba(57, 255, 20, 0.1);
}

.dropdown-item.selected {
  background: rgba(57, 255, 20, 0.15);
  border-left: 2px solid #39ff14;
}

/* Loading animation */
@keyframes dnaLoader {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.2) rotate(180deg); opacity: 0.7; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

.dna-loader {
  animation: dnaLoader 2s ease-in-out infinite;
}

/* Grid pattern overlay */
.grid-overlay {
  background-image:
    linear-gradient(rgba(57, 255, 20, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Image result card */
.result-card {
  position: relative;
}

.result-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #39ff14, #b829dd, #ff2975, #39ff14);
  border-radius: inherit;
  z-index: -1;
  background-size: 300% 300%;
  animation: shimmer 4s linear infinite;
}

/* Gallery thumbnail hover */
.gallery-thumb {
  transition: all 0.3s ease;
}

.gallery-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.3);
}

/* Merge mode styles */
.glass-merge {
  background: rgba(40, 15, 30, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-merge-badge {
  background: rgba(255, 41, 117, 0.1);
  border: 1px solid rgba(255, 41, 117, 0.2);
}

.btn-merge {
  background: linear-gradient(135deg, #ff2975, #b829dd, #ff2975);
  background-size: 200% 200%;
  animation: mergeGradient 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn-merge:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(255, 41, 117, 0.5), 0 0 60px rgba(184, 41, 221, 0.3);
}

.btn-merge:disabled {
  background: linear-gradient(135deg, #3a1a2a, #2a1a3a);
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}

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

/* Merge result card */
.merge-result-card {
  position: relative;
}

.merge-result-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #ff2975, #b829dd, #39ff14, #ff2975, #b829dd);
  border-radius: inherit;
  z-index: -1;
  background-size: 400% 400%;
  animation: shimmer 3s linear infinite;
}

/* Category header in dropdown */
.category-header {
  color: #b829dd;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 12px 4px;
  font-family: 'JetBrains Mono', monospace;
}