* {
  box-sizing: border-box;
}

body {
  font-family: 'Space Mono', monospace;
  background: #09090b;
}

.glitch-text {
  font-family: 'Dela Gothic One', cursive;
  background: linear-gradient(135deg, #ff006e, #8338ec, #3a86ff, #06d6a0);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 4s ease infinite;
  text-shadow: none;
  position: relative;
}

.glitch-text::before,
.glitch-text::after {
  content: 'CHAOS PROMPT GENERATOR';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: inherit;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glitch-text::before {
  animation: glitch-1 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-text::after {
  animation: glitch-2 2s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-2px); }
  40% { transform: translateX(2px); }
  60% { transform: translateX(-1px); }
  80% { transform: translateX(1px); }
}

@keyframes glitch-2 {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(2px); }
  40% { transform: translateX(-2px); }
  60% { transform: translateX(1px); }
  80% { transform: translateX(-1px); }
}

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

.floating-emojis {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.floating-emoji {
  position: absolute;
  font-size: 2rem;
  opacity: 0.1;
  animation: float-up linear infinite;
}

@keyframes float-up {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.1;
  }
  90% {
    opacity: 0.1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

.category-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
}

.category-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.category-btn.active {
  color: white;
  border-color: currentColor;
}

.generator-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.05));
  border: 3px solid;
  border-radius: 1.5rem;
  position: relative;
  overflow: hidden;
  animation: border-glow 3s ease-in-out infinite;
}

.generator-box::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--glow-color), transparent, var(--glow-color));
  opacity: 0.2;
  filter: blur(20px);
  z-index: 0;
}

@keyframes border-glow {
  0%, 100% { box-shadow: 0 0 20px var(--glow-color, #ff006e)30; }
  50% { box-shadow: 0 0 40px var(--glow-color, #ff006e)50; }
}

.prompt-text {
  font-family: 'Space Mono', monospace;
  line-height: 1.6;
}

.generate-btn {
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.generate-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.generate-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.generate-btn:hover::before {
  opacity: 1;
}

.generate-btn:active {
  transform: translateY(0) scale(0.98);
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px) rotate(-0.5deg); }
  40% { transform: translateX(5px) rotate(0.5deg); }
  60% { transform: translateX(-3px) rotate(-0.3deg); }
  80% { transform: translateX(3px) rotate(0.3deg); }
}

.action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e4e4e7;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.modifier-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #71717a;
}

.modifier-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
}

.modifier-btn.active {
  background: linear-gradient(135deg, #8338ec40, #ff006e40);
  border-color: #8338ec;
  color: white;
}

.chaos-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: linear-gradient(90deg, #3a86ff, #8338ec, #ff006e);
  border-radius: 4px;
  cursor: pointer;
}

.chaos-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.chaos-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.chaos-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* AI Mode Styles */
.context-input {
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  line-height: 1.5;
}

.context-input:focus {
  box-shadow: 0 0 20px var(--glow-color, #ff006e)30;
}

.context-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: #71717a;
}

.ai-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.ai-toggle-btn.active {
  background: linear-gradient(135deg, #06d6a040, #3a86ff40);
  border-color: #06d6a0;
  color: #06d6a0;
}

.generating-btn {
  cursor: wait !important;
  animation: pulse-btn 1.5s ease-in-out infinite;
}

@keyframes pulse-btn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.generator-box.generating {
  animation: border-pulse 1s ease-in-out infinite;
}

@keyframes border-pulse {
  0%, 100% { border-color: var(--glow-color); }
  50% { border-color: #06d6a0; }
}

.pulse-text {
  animation: text-pulse 1.2s ease-in-out infinite;
}

@keyframes text-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .glitch-text {
    font-size: 2rem;
  }
  
  .floating-emoji {
    font-size: 1.5rem;
  }
  
  .generator-box {
    padding: 1.25rem;
  }
  
  .prompt-text {
    font-size: 1.1rem;
  }
  
  .generate-btn {
    font-size: 1.1rem;
    padding: 1rem 2rem;
  }
  
  .context-input {
    font-size: 0.9rem;
  }
}