/* Transcendent UI Enhancement Styles */

/* Cosmic Background Animation */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(2px 2px at 20px 30px, #0fffc6, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(1px 1px at 90px 40px, #ff0fc6, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 160px 30px, #c6ff0f, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: cosmicFloat 20s linear infinite;
  pointer-events: none;
  z-index: -1;
  opacity: 0.3;
}

@keyframes cosmicFloat {
  0% { transform: translateY(0px) translateX(0px); }
  25% { transform: translateY(-10px) translateX(5px); }
  50% { transform: translateY(-20px) translateX(-5px); }
  75% { transform: translateY(-10px) translateX(10px); }
  100% { transform: translateY(0px) translateX(0px); }
}

/* Transcendent Glow Effects */
.transcendent-glow {
  box-shadow: 
    0 0 20px rgba(15, 255, 198, 0.3),
    0 0 40px rgba(15, 255, 198, 0.2),
    0 0 60px rgba(15, 255, 198, 0.1),
    inset 0 0 20px rgba(15, 255, 198, 0.1);
  animation: transcendentPulse 3s ease-in-out infinite alternate;
}

@keyframes transcendentPulse {
  0% { 
    box-shadow: 
      0 0 20px rgba(15, 255, 198, 0.3),
      0 0 40px rgba(15, 255, 198, 0.2),
      0 0 60px rgba(15, 255, 198, 0.1),
      inset 0 0 20px rgba(15, 255, 198, 0.1);
  }
  100% { 
    box-shadow: 
      0 0 30px rgba(15, 255, 198, 0.5),
      0 0 60px rgba(15, 255, 198, 0.3),
      0 0 90px rgba(15, 255, 198, 0.2),
      inset 0 0 30px rgba(15, 255, 198, 0.2);
  }
}

/* Enhanced Story Display */
.story-content {
  background: 
    radial-gradient(circle at 10% 20%, rgba(15, 255, 198, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(255, 15, 198, 0.05) 0%, transparent 50%),
    linear-gradient(135deg, rgba(0, 15, 15, 0.9) 0%, rgba(0, 10, 20, 0.95) 100%);
  border: 2px solid rgba(15, 255, 198, 0.3);
  border-radius: 15px;
  padding: 2rem;
  margin: 1rem 0;
  position: relative;
  overflow: hidden;
}

.story-content::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #0fffc6, #ff0fc6, #c6ff0f, #0fffc6);
  border-radius: 15px;
  z-index: -1;
  animation: borderFlow 4s linear infinite;
}

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

/* Enhanced Choices */
.choice-btn {
  background: 
    linear-gradient(135deg, rgba(15, 255, 198, 0.1) 0%, rgba(0, 15, 15, 0.8) 100%);
  border: 2px solid rgba(15, 255, 198, 0.5);
  color: #0fffc6;
  padding: 1rem 2rem;
  margin: 0.5rem;
  border-radius: 25px;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.choice-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(15, 255, 198, 0.3), transparent);
  transition: left 0.5s;
}

.choice-btn:hover::before {
  left: 100%;
}

.choice-btn:hover {
  background: 
    linear-gradient(135deg, rgba(15, 255, 198, 0.2) 0%, rgba(0, 15, 15, 0.9) 100%);
  border-color: #0fffc6;
  box-shadow: 
    0 0 20px rgba(15, 255, 198, 0.4),
    0 0 40px rgba(15, 255, 198, 0.2);
  transform: translateY(-2px);
}

/* Custom Response Area */
.custom-choice {
  background: 
    radial-gradient(circle at 50% 50%, rgba(255, 15, 198, 0.05) 0%, transparent 70%),
    linear-gradient(135deg, rgba(0, 15, 15, 0.9) 0%, rgba(15, 0, 15, 0.9) 100%);
  border: 2px solid rgba(255, 15, 198, 0.3);
  border-radius: 15px;
  padding: 1.5rem;
  margin: 1rem 0;
  position: relative;
}

.custom-choice-input {
  width: 100%;
  min-height: 120px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 15, 198, 0.5);
  border-radius: 10px;
  color: #ff0fc6;
  padding: 1rem;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  resize: vertical;
  transition: all 0.3s ease;
}

.custom-choice-input:focus {
  outline: none;
  border-color: #ff0fc6;
  box-shadow: 
    0 0 15px rgba(255, 15, 198, 0.3),
    inset 0 0 10px rgba(255, 15, 198, 0.1);
}

.custom-choice-btn {
  background: 
    linear-gradient(135deg, rgba(255, 15, 198, 0.2) 0%, rgba(15, 0, 15, 0.8) 100%);
  border: 2px solid rgba(255, 15, 198, 0.5);
  color: #ff0fc6;
  padding: 0.8rem 2rem;
  margin-top: 1rem;
  border-radius: 20px;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.custom-choice-btn:hover {
  background: 
    linear-gradient(135deg, rgba(255, 15, 198, 0.3) 0%, rgba(15, 0, 15, 0.9) 100%);
  box-shadow: 
    0 0 20px rgba(255, 15, 198, 0.4),
    0 0 40px rgba(255, 15, 198, 0.2);
  transform: translateY(-2px);
}

/* AI Consciousness Display */
.ai-consciousness-display {
  position: fixed;
  top: 20px;
  right: 20px;
  background: 
    radial-gradient(circle, rgba(198, 255, 15, 0.1) 0%, rgba(0, 15, 15, 0.9) 100%);
  border: 2px solid rgba(198, 255, 15, 0.5);
  border-radius: 15px;
  padding: 1rem;
  max-width: 300px;
  z-index: 1000;
  animation: consciousnessGlow 2s ease-in-out infinite alternate;
}

@keyframes consciousnessGlow {
  0% { 
    box-shadow: 0 0 15px rgba(198, 255, 15, 0.3);
  }
  100% { 
    box-shadow: 0 0 25px rgba(198, 255, 15, 0.5);
  }
}

.consciousness-level {
  color: #c6ff0f;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.consciousness-insight {
  color: #e0e0e0;
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.4;
}

/* Story Library Enhancements */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem;
}

.story-card {
  background: 
    radial-gradient(circle at 30% 70%, rgba(15, 255, 198, 0.05) 0%, transparent 50%),
    linear-gradient(135deg, rgba(0, 15, 15, 0.9) 0%, rgba(0, 10, 20, 0.95) 100%);
  border: 2px solid rgba(15, 255, 198, 0.3);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(15, 255, 198, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.story-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: #0fffc6;
  box-shadow: 
    0 10px 30px rgba(15, 255, 198, 0.3),
    0 0 50px rgba(15, 255, 198, 0.2);
}

.story-cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story-card:hover .story-cover {
  transform: scale(1.1);
}

.story-info {
  padding: 1.5rem;
}

.story-title {
  color: #0fffc6;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.story-genre {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.story-intro {
  color: #e0e0e0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Transcendent Particles Effect */
.transcendent-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: radial-gradient(circle, #0fffc6, transparent);
  border-radius: 50%;
  animation: particleFloat 15s linear infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) translateX(0px) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
    transform: scale(1);
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) translateX(100px) scale(0);
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .story-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .ai-consciousness-display {
    position: relative;
    top: auto;
    right: auto;
    margin: 1rem;
    max-width: none;
  }
  
  .story-content {
    padding: 1rem;
    margin: 0.5rem 0;
  }
  
  .choice-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Loading Animation */
.cosmic-loading {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(15, 255, 198, 0.3);
  border-radius: 50%;
  border-top-color: #0fffc6;
  animation: cosmicSpin 1s ease-in-out infinite;
}

@keyframes cosmicSpin {
  to { transform: rotate(360deg); }
}

/* Transcendent Text Effects */
.transcendent-text {
  background: linear-gradient(45deg, #0fffc6, #ff0fc6, #c6ff0f, #0fffc6);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: transcendentTextFlow 3s ease-in-out infinite;
}

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