/**
 * Onboarding Wizard Styles
 * Modern, animated onboarding experience
 */

/* Wizard Container */
.onboarding-wizard {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

.onboarding-backdrop {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(245, 239, 230, 0.98) 0%, 
    rgba(235, 223, 207, 0.95) 100%
  );
  backdrop-filter: blur(10px);
}

.onboarding-container {
  position: relative;
  width: min(600px, calc(100vw - 2rem));
  max-height: min(800px, calc(100vh - 2rem));
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 248, 240, 0.95));
  border-radius: 30px;
  box-shadow: 
    0 28px 68px rgba(58, 39, 18, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Progress Bar */
.onboarding-progress {
  padding: 1.5rem 2rem 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-bottom: 1px solid rgba(28, 35, 37, 0.06);
}

.progress-bar {
  height: 6px;
  background: rgba(28, 35, 37, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #be6438, #ddb865);
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
}

.progress-step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #627072;
  background: rgba(28, 35, 37, 0.06);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.progress-step.active {
  background: #be6438;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(190, 100, 56, 0.3);
}

.progress-step.completed {
  background: #10B981;
  color: white;
}

/* Step Content */
.onboarding-step {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
}

.step-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.step-title {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: #1c2325;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.step-subtitle {
  font-size: 1.1rem;
  color: #627072;
  margin: 0 0 2rem;
}

/* Welcome Step */
.welcome-illustration {
  margin-bottom: 1.5rem;
}

.spark-animation {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ddb865, #be6438);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sparkPulse 2s ease-in-out infinite;
}

.spark-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

@keyframes sparkPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(190, 100, 56, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 10px rgba(190, 100, 56, 0.2); }
}

.welcome-features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 400px;
  margin-bottom: 2rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  border: 1px solid rgba(28, 35, 37, 0.06);
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.feature-text {
  color: #455255;
  font-size: 0.95rem;
  line-height: 1.4;
}

.step-description {
  color: #627072;
  font-size: 1rem;
  margin-top: auto;
}

/* Companion Step */
.companion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.companion-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.companion-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
}

.companion-card.selected {
  border-color: #be6438;
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.95), rgba(255, 255, 255, 0.9));
  box-shadow: 0 0 0 4px rgba(190, 100, 56, 0.1);
}

.companion-preview {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.companion-card:hover .companion-preview {
  transform: scale(1.1);
}

.companion-card.selected .companion-preview {
  animation: companionBounce 0.6s ease;
}

@keyframes companionBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.companion-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

.companion-info {
  text-align: center;
}

.companion-name {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.1rem;
  color: #1c2325;
  margin: 0 0 0.25rem;
}

.companion-tagline {
  font-size: 0.8rem;
  color: #be6438;
  font-weight: 500;
  margin: 0 0 0.5rem;
}

.companion-description {
  font-size: 0.8rem;
  color: #627072;
  line-height: 1.4;
  margin: 0;
}

.companion-select-indicator {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #627072;
  padding: 0.35rem 0.75rem;
  background: rgba(28, 35, 37, 0.06);
  border-radius: 20px;
}

.companion-card.selected .companion-select-indicator {
  background: #be6438;
  color: white;
}

.companion-naming {
  width: 100%;
  max-width: 300px;
  animation: fadeInUp 0.4s ease;
}

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

.name-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.name-label span {
  font-size: 0.9rem;
  color: #455255;
  font-weight: 500;
}

.companion-name-input {
  padding: 0.875rem 1rem;
  border: 2px solid rgba(28, 35, 37, 0.12);
  border-radius: 12px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.companion-name-input:focus {
  outline: none;
  border-color: #be6438;
  box-shadow: 0 0 0 4px rgba(190, 100, 56, 0.1);
}

/* Setup Step */
.setup-form {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-section {
  text-align: left;
}

.form-label,
.form-label-text {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #455255;
  margin-bottom: 0.75rem;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.setup-input,
.setup-select {
  padding: 0.875rem 1rem;
  border: 2px solid rgba(28, 35, 37, 0.12);
  border-radius: 12px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setup-input:focus,
.setup-select:focus {
  outline: none;
  border-color: #be6438;
  box-shadow: 0 0 0 4px rgba(190, 100, 56, 0.1);
}

.learning-style-grid,
.practice-time-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.learning-style-card,
.practice-time-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.learning-style-card:hover,
.practice-time-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.learning-style-card.selected,
.practice-time-card.selected {
  border-color: #be6438;
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.95), rgba(255, 255, 255, 0.9));
}

.style-icon,
.time-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.style-label,
.time-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1c2325;
  margin-bottom: 0.25rem;
}

.style-description {
  font-size: 0.75rem;
  color: #627072;
  line-height: 1.3;
}

.time-range {
  font-size: 0.75rem;
  color: #627072;
}

/* Preview Step */
.preview-summary {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.preview-companion {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(28, 35, 37, 0.08);
  margin-bottom: 1.5rem;
}

.preview-avatar {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.preview-companion-info h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.25rem;
  color: #1c2325;
  margin: 0 0 0.25rem;
}

.preview-companion-info p {
  color: #627072;
  margin: 0;
  font-size: 0.9rem;
}

.preview-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.preview-label {
  font-size: 0.8rem;
  color: #627072;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-value {
  font-size: 1rem;
  font-weight: 600;
  color: #1c2325;
}

.sample-question-preview {
  width: 100%;
  max-width: 400px;
  margin-bottom: 2rem;
}

.sample-question-preview h3 {
  font-size: 1rem;
  color: #455255;
  margin: 0 0 1rem;
}

.sample-card {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(28, 35, 37, 0.08);
  border-radius: 16px;
  padding: 1.25rem;
  text-align: left;
}

.sample-question {
  font-size: 1.1rem;
  font-weight: 500;
  color: #1c2325;
  margin: 0 0 1rem;
}

.sample-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sample-option {
  padding: 0.75rem;
  background: rgba(28, 35, 37, 0.04);
  border-radius: 10px;
  font-size: 0.9rem;
  text-align: center;
}

.sample-option.correct {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  font-weight: 500;
}

.sample-hint {
  font-size: 0.85rem;
  color: #627072;
  font-style: italic;
  margin: 0;
}

.completion-message {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  border: 2px solid rgba(16, 185, 129, 0.2);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  margin-top: auto;
}

.completion-message p {
  margin: 0;
  color: #065f46;
  font-weight: 500;
}

/* Navigation */
.onboarding-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem 1.5rem;
  background: rgba(255, 255, 255, 0.5);
  border-top: 1px solid rgba(28, 35, 37, 0.06);
  gap: 1rem;
}

.onboarding-btn {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.onboarding-btn:active:not(:disabled) {
  transform: translateY(0);
}

.onboarding-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #be6438, #d97706);
  color: white;
  box-shadow: 0 4px 14px rgba(190, 100, 56, 0.3);
}

.btn-secondary {
  background: rgba(28, 35, 37, 0.06);
  color: #455255;
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(28, 35, 37, 0.1);
}

/* Responsive */
@media (max-width: 600px) {
  .onboarding-container {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    border-radius: 20px;
  }
  
  .onboarding-progress {
    padding: 1rem 1.25rem 0.75rem;
  }
  
  .onboarding-step {
    padding: 1.25rem;
  }
  
  .companion-grid {
    grid-template-columns: 1fr;
  }
  
  .companion-card {
    flex-direction: row;
    text-align: left;
    gap: 1rem;
  }
  
  .companion-preview {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
  }
  
  .companion-info {
    text-align: left;
    flex: 1;
  }
  
  .learning-style-grid,
  .practice-time-grid {
    grid-template-columns: 1fr;
  }
  
  .preview-details {
    grid-template-columns: 1fr;
  }
  
  .onboarding-navigation {
    padding: 1rem 1.25rem 1.25rem;
  }
  
  .onboarding-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .onboarding-wizard,
  .companion-card,
  .progress-fill,
  .feature-item,
  .learning-style-card,
  .practice-time-card {
    transition: none;
  }
  
  .spark-animation {
    animation: none;
  }
}

/* Focus styles for keyboard navigation */
.companion-card:focus,
.learning-style-card:focus,
.practice-time-card:focus {
  outline: 3px solid #be6438;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .onboarding-wizard {
    display: none;
  }
}
