/* Demo Mode Styles */

.demo-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

/* Header */
.demo-header {
  margin-bottom: var(--spacing-xl);
}

.demo-header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.demo-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
}

.demo-subtitle {
  margin: var(--spacing-xs) 0 0 0;
  font-size: 1.125rem;
  color: var(--color-text-secondary);
}

.demo-property-description {
  background: var(--color-background);
  border-radius: var(--radius-base);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Section Titles */
.demo-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--spacing-md) 0;
}

/* Characters Grid */
.demo-characters-section {
  margin-bottom: var(--spacing-xl);
}

.demo-characters-grid {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  justify-content: center;
}

.demo-character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  width: 120px;
}

.demo-character-portrait {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border-color);
  background: var(--color-background);
}

.demo-character-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-character-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-secondary);
  color: var(--color-white);
  font-size: 2.5rem;
}

.demo-character-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
}

/* Form Styles */
.demo-form-container {
  background: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
  padding: var(--spacing-lg);
}

.demo-form-description {
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.6;
}

.demo-form-group {
  margin-bottom: var(--spacing-lg);
}

.demo-form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text);
}

.demo-form-textarea {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 150px;
}

.demo-form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.demo-form-select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
  font-size: 1rem;
  background: var(--color-white);
}

.demo-form-hint {
  margin: var(--spacing-sm) 0 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.demo-form-actions {
  margin-top: var(--spacing-lg);
}

.demo-submit-btn {
  width: 100%;
  padding: var(--spacing-md);
  font-size: 1.125rem;
}

/* Info Box */
.demo-info-box {
  margin-top: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--color-info-light, #e7f3ff);
  border-radius: var(--radius-base);
  border-left: 4px solid var(--color-info);
}

.demo-info-box h4 {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1rem;
  color: var(--color-text);
}

.demo-info-box h4 i {
  margin-right: var(--spacing-xs);
  color: var(--color-info);
}

.demo-steps-list {
  margin: 0;
  padding-left: var(--spacing-lg);
}

.demo-steps-list li {
  margin-bottom: var(--spacing-xs);
  color: var(--color-text-secondary);
}

/* Progress Display */
.demo-progress-container {
  background: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
  padding: var(--spacing-lg);
  text-align: center;
}

.demo-prompt-display {
  background: var(--color-background);
  border-radius: var(--radius-base);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  text-align: left;
  color: var(--color-text-secondary);
}

.demo-progress-bar-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.demo-progress-bar {
  flex: 1;
  height: 12px;
  background: var(--color-background);
  border-radius: 6px;
  overflow: hidden;
}

.demo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  border-radius: 6px;
  transition: width 0.5s ease;
}

.demo-progress-percentage {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 60px;
}

.demo-status-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  font-size: 1.125rem;
  color: var(--color-text);
  margin-bottom: var(--spacing-lg);
}

.demo-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Phases Display */
.demo-phases {
  display: flex;
  justify-content: space-between;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.demo-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm);
  min-width: 70px;
}

.demo-phase-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s ease;
}

.demo-phase-pending .demo-phase-icon {
  background: var(--color-background);
  color: var(--color-text-muted);
}

.demo-phase-active .demo-phase-icon {
  background: var(--color-primary);
  color: var(--color-white);
}

.demo-phase-completed .demo-phase-icon {
  background: var(--color-success);
  color: var(--color-white);
}

.demo-phase-spinning {
  animation: spin 2s linear infinite;
}

.demo-phase-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
}

.demo-phase-active .demo-phase-label {
  color: var(--color-primary);
  font-weight: 600;
}

.demo-phase-completed .demo-phase-label {
  color: var(--color-success);
}

.demo-progress-info {
  margin-top: var(--spacing-md);
}

/* Preview Styles */
.demo-preview-container {
  background: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
  padding: var(--spacing-lg);
}

.demo-preview-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.demo-preview-success-icon {
  font-size: 4rem;
  color: var(--color-success);
  margin-bottom: var(--spacing-md);
}

.demo-preview-subtitle {
  color: var(--color-text-muted);
  margin: var(--spacing-sm) 0 0 0;
}

.demo-preview-stats {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  margin: var(--spacing-lg) 0;
  flex-wrap: wrap;
}

.demo-stat {
  text-align: center;
}

.demo-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.demo-stat-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.demo-preview-actions {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
  flex-wrap: wrap;
}

.demo-watch-btn {
  padding: var(--spacing-md) var(--spacing-xl);
  font-size: 1.125rem;
}

.demo-watch-btn i {
  margin-right: var(--spacing-sm);
}

/* Script Preview */
.demo-preview-script {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
}

.demo-preview-script h3 {
  margin: 0 0 var(--spacing-md) 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.demo-script-content {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--spacing-md);
  background: var(--color-background);
  border-radius: var(--radius-base);
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.demo-scene {
  margin-bottom: var(--spacing-lg);
}

.demo-scene-heading {
  text-transform: uppercase;
  margin-bottom: var(--spacing-sm);
}

.demo-dialogue {
  margin: var(--spacing-sm) 0;
  padding-left: var(--spacing-lg);
}

.demo-dialogue .demo-character-name {
  display: block;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.demo-dialogue p {
  margin: 0;
}

.demo-action {
  margin: var(--spacing-sm) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Failed State */
.demo-failed-container {
  background: var(--color-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-base);
  padding: var(--spacing-lg);
  text-align: center;
}

.demo-failed-header {
  margin-bottom: var(--spacing-lg);
}

.demo-failed-icon {
  font-size: 4rem;
  color: var(--color-danger);
  margin-bottom: var(--spacing-md);
}

.demo-failed-subtitle {
  color: var(--color-text-muted);
  margin: var(--spacing-sm) 0 0 0;
}

.demo-error-message {
  background: var(--color-danger-light, #ffe6e6);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-base);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  color: var(--color-danger);
  text-align: left;
}

.demo-failed-actions {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.demo-failed-help {
  text-align: left;
  padding: var(--spacing-md);
  background: var(--color-background);
  border-radius: var(--radius-base);
}

.demo-failed-help h4 {
  margin: 0 0 var(--spacing-sm) 0;
  font-size: 1rem;
}

.demo-failed-help ul {
  margin: 0;
  padding-left: var(--spacing-lg);
  color: var(--color-text-secondary);
}

.demo-failed-help li {
  margin-bottom: var(--spacing-xs);
}

/* Responsive */
@media (max-width: 768px) {
  .demo-container {
    padding: var(--spacing-md);
  }

  .demo-header-content {
    flex-direction: column;
  }

  .demo-characters-grid {
    justify-content: flex-start;
  }

  .demo-phases {
    justify-content: center;
  }

  .demo-phase {
    min-width: 60px;
  }

  .demo-preview-stats {
    gap: var(--spacing-lg);
  }

  .demo-preview-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
