/* Enhanced styles for AI-powered Code Review Game */

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  line-height: 1.6;
}

/* Retro government office styling with AI elements */
.retro-paper {
  background: linear-gradient(45deg, #f5f5dc 25%, #f8f8dc 25%, #f8f8dc 50%, #f5f5dc 50%, #f5f5dc 75%, #f8f8dc 75%);
  background-size: 4px 4px;
}

/* AI generation indicators */
.ai-generating {
  position: relative;
  overflow: hidden;
}

.ai-generating::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.3), transparent);
  animation: ai-processing 2s infinite;
}

@keyframes ai-processing {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Enhanced stamp effects */
.stamp-approved {
  transform: rotate(-5deg);
  border: 3px solid #22c55e;
  color: #22c55e;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 4px;
  background: rgba(34, 197, 94, 0.1);
  animation: stamp-impact 0.5s ease-out;
}

.stamp-rejected {
  transform: rotate(5deg);
  border: 3px solid #ef4444;
  color: #ef4444;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.1);
  animation: stamp-impact 0.5s ease-out;
}

@keyframes stamp-impact {
  0% {
    transform: scale(0) rotate(-5deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(-5deg);
  }
  100% {
    transform: scale(1) rotate(-5deg);
    opacity: 1;
  }
}

/* Enhanced code syntax highlighting */
.code-viewer {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

/* AI focus area highlighting */
.focus-highlight {
  background: rgba(147, 51, 234, 0.1);
  border-left: 3px solid #9333ea;
  padding-left: 0.5rem;
}

/* Loading states for AI generation */
.ai-loading {
  position: relative;
}

.ai-loading::before {
  content: 'AI Generating...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(147, 51, 234, 0.9);
  color: white;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 10;
}

/* Queue status indicators */
.queue-indicator {
  position: relative;
  display: inline-block;
}

.queue-indicator.generating::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #fbbf24;
  border-radius: 50%;
  animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
}

/* Adaptive difficulty visualization */
.difficulty-meter {
  background: linear-gradient(90deg, #22c55e 0%, #fbbf24 50%, #ef4444 100%);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}

.difficulty-indicator {
  background: rgba(255, 255, 255, 0.9);
  height: 100%;
  width: 20px;
  border-radius: 2px;
  transition: transform 0.5s ease;
}

/* Animated elements for AI interactions */
@keyframes paperSlide {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.paper-slide {
  animation: paperSlide 0.5s ease-out;
}

/* AI success/error states */
.ai-success {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.ai-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Enhanced timer with AI sync */
.timer-warning {
  animation: pulse-urgent 1s infinite;
}

@keyframes pulse-urgent {
  0%, 100% {
    transform: scale(1);
    color: #ef4444;
  }
  50% {
    transform: scale(1.1);
    color: #dc2626;
  }
}

/* Progress bars for AI adaptation */
.progress-bar {
  background: linear-gradient(90deg, #e5e7eb, #d1d5db);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background: linear-gradient(90deg, #8b5cf6, #a855f7);
  transition: width 0.5s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Custom scrollbar enhancements */
.code-viewer::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.code-viewer::-webkit-scrollbar-track {
  background: #374151;
}

.code-viewer::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 4px;
}

.code-viewer::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Enhanced button interactions */
button {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* AI-generated content styling */
.ai-generated {
  position: relative;
}

.ai-generated::before {
  content: '🤖';
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  background: #8b5cf6;
  color: white;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  z-index: 1;
}

/* Focus area indicators */
.focus-security { border-left-color: #dc2626; }
.focus-performance { border-left-color: #ea580c; }
.focus-style { border-left-color: #0891b2; }
.focus-logic { border-left-color: #7c3aed; }
.focus-error-handling { border-left-color: #059669; }

/* Mobile responsiveness for AI elements */
@media (max-width: 768px) {
  .text-xl {
    font-size: 1.1rem;
  }
  
  .text-2xl {
    font-size: 1.4rem;
  }
  
  .text-3xl {
    font-size: 1.6rem;
  }

  .ai-loading::before {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }
}

/* Accessibility improvements */
button:focus,
input:focus,
textarea:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Success/error state indicators */
.success-glow {
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
  animation: glow-success 2s ease-out;
}

.error-glow {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
  animation: glow-error 2s ease-out;
}

@keyframes glow-success {
  0% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.1); }
  50% { box-shadow: 0 0 30px rgba(34, 197, 94, 0.4); }
  100% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.3); }
}

@keyframes glow-error {
  0% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.1); }
  50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.4); }
  100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
}

/* Language unlock celebration */
.language-unlock {
  animation: celebration 1s ease-out;
}

@keyframes celebration {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.1) rotate(-5deg);
  }
  50% {
    transform: scale(1.2) rotate(5deg);
  }
  75% {
    transform: scale(1.1) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}