:root {
  --deep-purple: #0a0015;
  --space-purple: #1a0033;
  --electric-blue: #00d4ff;
  --neural-pink: #ff66b2;
  --cosmic-violet: #8b5cf6;
  --transcendent-gold: #ffd700;
}

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

body {
  font-family: 'Rajdhani', sans-serif;
  background: linear-gradient(135deg, var(--deep-purple) 0%, var(--space-purple) 50%, #0d001a 100%);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  min-height: 100vh;
  position: relative;
}

.app-container.transcendent-mode {
  animation: transcendentPulse 2s ease-in-out infinite;
}

@keyframes transcendentPulse {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(30deg); }
}

/* Particle Field */
.particle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--electric-blue);
  border-radius: 50%;
  opacity: 0.4;
  animation: float 5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50% { transform: translateY(-30px) scale(1.5); opacity: 0.8; }
}

/* Neural Background */
.neural-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.15;
  z-index: 0;
}

.neural-svg {
  width: 100%;
  height: 100%;
}

.neural-node {
  fill: var(--electric-blue);
  animation: nodeGlow 3s ease-in-out infinite;
}

.neural-line {
  stroke: var(--neural-pink);
  stroke-width: 0.2;
  opacity: 0.5;
  animation: linePulse 4s ease-in-out infinite;
}

@keyframes nodeGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes linePulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.6; }
}

/* Header */
.app-header {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(180deg, rgba(26, 0, 51, 0.9) 0%, transparent 100%);
}

.app-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 900;
  background: linear-gradient(90deg, var(--cosmic-violet), var(--electric-blue), var(--neural-pink));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 3s ease infinite;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

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

.app-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.5rem;
  letter-spacing: 2px;
}

.sound-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sound-toggle:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: var(--electric-blue);
}

/* Main Content */
.main-content {
  position: relative;
  z-index: 10;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
}

/* Timeline */
.timeline-section {
  margin-bottom: 2rem;
}

.timeline-container {
  background: rgba(26, 0, 51, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.timeline-era {
  color: var(--neural-pink);
  font-weight: 600;
}

.timeline-track-wrapper {
  position: relative;
  height: 20px;
  margin-bottom: 0.5rem;
}

.timeline-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
  position: relative;
  z-index: 2;
}

.timeline-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--electric-blue), var(--cosmic-violet));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 20px var(--electric-blue);
  transition: transform 0.2s ease;
}

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

.timeline-fill {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 8px;
  background: linear-gradient(90deg, var(--cosmic-violet), var(--electric-blue));
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
}

.timeline-year {
  text-align: center;
}

.year-display {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--electric-blue);
  text-shadow: 0 0 20px var(--electric-blue);
}

/* Panels Layout */
.panels-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .panels-wrapper {
    grid-template-columns: 1fr 1.5fr 1fr;
  }
}

/* Vectors Panel */
.vectors-panel {
  background: rgba(26, 0, 51, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--electric-blue);
}

/* Sliders */
.slider-container {
  margin-bottom: 1.25rem;
}

.slider-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.slider-icon {
  font-size: 1.5rem;
}

.slider-labels {
  flex: 1;
}

.slider-name {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.slider-desc {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.5);
}

.slider-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  color: var(--electric-blue);
  min-width: 45px;
  text-align: right;
}

.slider-track-wrapper {
  position: relative;
  height: 12px;
}

.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  position: relative;
  z-index: 2;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--electric-blue);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px var(--electric-blue);
  transition: all 0.2s ease;
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px var(--electric-blue);
}

.slider-fill {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 6px;
  background: linear-gradient(90deg, var(--cosmic-violet), var(--electric-blue));
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
}

/* Buttons */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.generate-btn {
  background: linear-gradient(135deg, var(--cosmic-violet), var(--electric-blue));
  border: none;
  border-radius: 0.75rem;
  padding: 1rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.4);
}

.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.generate-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

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

.randomize-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 102, 178, 0.5);
  border-radius: 0.75rem;
  padding: 0.75rem;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--neural-pink);
  cursor: pointer;
  transition: all 0.3s ease;
}

.randomize-btn:hover {
  background: rgba(255, 102, 178, 0.2);
  border-color: var(--neural-pink);
}

/* Visualization Panel */
.visualization-panel {
  background: rgba(26, 0, 51, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Prediction Card */
.prediction-card {
  width: 100%;
}

.prediction-image-container {
  width: 100%;
  aspect-ratio: 1;
  max-width: 400px;
  margin: 0 auto 1rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid rgba(0, 212, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
}

.prediction-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prediction-content {
  text-align: center;
}

.prediction-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 1rem;
}

.prediction-fact {
  background: rgba(255, 102, 178, 0.1);
  border: 1px solid rgba(255, 102, 178, 0.3);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.fact-label {
  display: block;
  font-weight: 600;
  color: var(--neural-pink);
  margin-bottom: 0.5rem;
}

.share-btn {
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid var(--electric-blue);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--electric-blue);
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-btn:hover {
  background: var(--electric-blue);
  color: var(--deep-purple);
}

/* Loading Animation */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
}

.dna-helix {
  display: flex;
  gap: 8px;
}

.dna-strand {
  width: 10px;
  height: 60px;
  background: linear-gradient(180deg, var(--electric-blue), var(--neural-pink));
  border-radius: 5px;
  animation: dnaWave 1s ease-in-out infinite;
}

@keyframes dnaWave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.5); }
}

.loading-text {
  margin-top: 1rem;
  color: var(--electric-blue);
  animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Stats Panel */
.stats-panel {
  display: flex;
  flex-direction: column;
}

.stats-card {
  background: rgba(26, 0, 51, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  flex: 1;
}

.stats-card.transcendent {
  border-color: var(--transcendent-gold);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
  animation: goldenGlow 2s ease-in-out infinite;
}

@keyframes goldenGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.3); }
  50% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.6); }
}

.stats-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--electric-blue);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item.full-width {
  grid-column: 1 / -1;
}

.stat-value {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--electric-blue);
  text-shadow: 0 0 10px var(--electric-blue);
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
}

/* History Gallery */
.history-section {
  margin-top: 2rem;
}

.history-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: var(--electric-blue);
  margin-bottom: 1rem;
}

.history-gallery {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.history-item {
  flex-shrink: 0;
  width: 80px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.history-item:hover {
  transform: scale(1.1);
}

.history-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid rgba(0, 212, 255, 0.3);
}

.history-year {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.25rem;
}

/* Footer */
.app-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-footer a {
  color: var(--neural-pink);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.app-footer a:hover {
  color: var(--electric-blue);
}

.disclaimer {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .panels-wrapper {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .stat-value {
    font-size: 1.2rem;
  }
}