/* Promptimizer Demo Styles */

.promptimizer-demo {
  padding: 100px 0;
  position: relative;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  overflow: hidden;
}

.promptimizer-demo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.demo-subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: #a0a0a0;
  margin-bottom: 3rem;
}

.demo-container {
  max-width: 800px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.demo-controls {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.control-group {
  flex: 1;
  min-width: 200px;
}

.control-group label {
  display: block;
  color: #a0a0a0;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.model-selector,
.quality-selector {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.model-selector:hover,
.quality-selector:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.5);
}

.model-selector:focus,
.quality-selector:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.model-selector option,
.quality-selector option {
  background: #1a1a2e;
  color: #ffffff;
}

.demo-input-area {
  margin-bottom: 2rem;
  position: relative;
}

.prompt-textarea {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
}

.prompt-textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.prompt-textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

.char-counter {
  position: absolute;
  bottom: -1.5rem;
  right: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
}

.optimize-demo-button {
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
}

.optimize-demo-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.optimize-demo-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.demo-result {
  animation: fadeInUp 0.5s ease;
}

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

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.result-header h3 {
  color: #4ade80;
  font-size: 1.3rem;
  margin: 0;
}

.result-badges {
  display: flex;
  gap: 0.5rem;
}

.quality-badge,
.intent-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.quality-badge {
  background: rgba(102, 126, 234, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(102, 126, 234, 0.3);
}

.quality-badge.quality-simple {
  background: rgba(251, 191, 36, 0.2);
  color: #fde047;
  border-color: rgba(251, 191, 36, 0.3);
}

.quality-badge.quality-advanced {
  background: rgba(74, 222, 128, 0.2);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.3);
}

.intent-badge {
  background: rgba(168, 85, 247, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.optimized-prompt-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.optimized-prompt {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1.5rem;
  color: #e0e0e0;
  font-size: 0.95rem;
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

.optimized-prompt::-webkit-scrollbar {
  width: 8px;
}

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

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

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

.copy-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.4);
  border-radius: 5px;
  color: #a5b4fc;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-button:hover {
  background: rgba(102, 126, 234, 0.3);
  border-color: rgba(102, 126, 234, 0.6);
  transform: translateY(-1px);
}

.optimization-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  color: #a0a0a0;
  font-size: 0.9rem;
}

.stat-item span:last-child {
  color: #ffffff;
  font-weight: 600;
}

.optimization-tips {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.optimization-tips h4 {
  color: #86efac;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.optimization-tips ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.optimization-tips li {
  color: #d1d5db;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  padding-left: 1.5rem;
  position: relative;
}

.optimization-tips li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #86efac;
  font-weight: bold;
}

.reset-button {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: #a0a0a0;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reset-button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.demo-note {
  margin-top: 2rem;
  padding: 1rem;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  text-align: center;
}

.demo-note p {
  color: #fde047;
  font-size: 0.9rem;
  margin: 0;
}

.demo-link {
  color: #a5b4fc;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.demo-link:hover {
  color: #c7d2fe;
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .demo-container {
    padding: 1.5rem;
  }
  
  .demo-controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  .control-group {
    min-width: 100%;
  }
  
  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .optimization-stats {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .optimized-prompt {
    font-size: 0.85rem;
    padding: 1rem;
  }
  
  .copy-button {
    position: static;
    width: 100%;
    margin-top: 1rem;
  }
}

/* Animation for demo elements */
.promptimizer-demo * {
  animation: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .promptimizer-demo .container > * {
    opacity: 1;
    animation: fadeInUp 0.6s ease forwards;
  }
  
  .promptimizer-demo .section-title {
    animation-delay: 0.1s;
  }
  
  .promptimizer-demo .demo-subtitle {
    animation-delay: 0.2s;
  }
  
  .promptimizer-demo .demo-container {
    animation-delay: 0.3s;
  }
}