/* Wizard Production Style - No Scroll & Clean Layout */

/* Modal Container & Structure */
#workout-wizard-modal {
  align-items: center !important;
  padding: 10px !important;
  box-sizing: border-box !important;
}

.wizard-modal-content {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  max-width: 800px !important;
  height: auto !important;
  max-height: 95vh !important; /* Fit within viewport */
  border-radius: 20px !important;
  overflow: hidden !important;
  background: #fff !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

/* Header */
.wizard-header {
  flex: 0 0 auto !important;
  padding: 1rem 1.5rem !important;
  background: #fff !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.wizard-header h2 {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  margin: 0 !important;
}

/* Progress Bar */
.wizard-progress {
  flex: 0 0 auto !important;
  padding: 0.75rem 1rem !important;
  background: #f8fafc !important;
}

.step-number {
  width: 28px !important;
  height: 28px !important;
  font-size: 14px !important;
}

.step-label {
  font-size: 11px !important;
  margin-top: 4px !important;
}

/* Content Area - Main Scrollable Area (if needed) but aimed to fit */
.wizard-steps-container {
  flex: 1 1 auto !important;
  overflow-y: auto !important; /* fallback */
  padding: 1rem !important;
  display: flex !important;
  flex-direction: column !important;
}

.wizard-step {
  height: 100% !important;
  display: none !important;
  flex-direction: column !important;
}

.wizard-step.active {
  display: flex !important;
}

/* Fields & Labels */
.wizard-field {
  margin-bottom: 1rem !important;
}

.wizard-field label {
  font-size: 0.85rem !important;
  color: #64748b !important;
  margin-bottom: 0.5rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 600 !important;
}

/* Step 1: Type Selection */
.wizard-options[style*="grid-template-columns: 1fr 1fr"] {
  gap: 1rem !important;
  height: 100% !important;
}

/* Generic Option Buttons (Experience, Training, Type) */
.wizard-option {
  padding: 0.75rem !important;
  border-radius: 12px !important;
  border: 2px solid #e2e8f0 !important;
  background: #fff !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 80px !important; /* ensure touch target */
}

.wizard-option:hover {
  border-color: #cbd5e1 !important;
  transform: translateY(-2px) !important;
}

.wizard-option.selected {
  border-color: #5D5FEF !important;
  background: rgba(93, 95, 239, 0.05) !important;
  box-shadow: 0 4px 6px -1px rgba(93, 95, 239, 0.1) !important;
}

.wizard-option i {
  font-size: 1.5rem !important;
  margin-bottom: 0.5rem !important;
  color: #94a3b8 !important;
}

.wizard-option.selected i {
  color: #5D5FEF !important;
}

.wizard-option span {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
}

/* Specific grids for Experience and Training */
/* Training: 2 rows of 3 */
.wizard-options:has([data-field="training"]) {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.75rem !important;
}

/* Experience: 1 row of 3 */
.wizard-options:has([data-field="experience"]) {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 0.75rem !important;
}

/* Step 3 & 4: Muscle & Equipment Grids */
.wizard-muscle-grid,
.wizard-equipment-grid {
  display: grid !important;
  /* Auto-fit with min size to ensure they fit but wrap if absolutely needed */
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
  gap: 0.5rem !important;
  align-content: start !important;
}

/* Mobile Optimizations for Grids */
@media (max-width: 768px) {
  .wizard-muscle-grid,
  .wizard-equipment-grid {
    grid-template-columns: repeat(3, 1fr) !important; /* Force 3 cols on mobile for readability */
  }

  /* Reduce header/footer padding on mobile */
  .wizard-header {
    padding: 0.5rem !important;
    min-height: 40px !important;
    justify-content: flex-end !important; /* Move close button to right */
  }

  .wizard-header h2 {
    display: none !important; /* Hide title on mobile to save space */
  }

  .wizard-footer { padding: 0.5rem 1rem !important; }

  /* Compact Progress */
  .wizard-progress {
    padding: 0.25rem !important;
    gap: 0.5rem !important;
  }

  .step-number {
    width: 24px !important;
    height: 24px !important;
    font-size: 12px !important;
  }

  .step-label {
    display: none !important; /* Hide labels on mobile */
  }

  /* Compact Question Title */
  .wizard-step h3 {
    font-size: 1rem !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
  }

  /* Make main content compact */
  .wizard-steps-container { padding: 0.5rem !important; }

  /* Compact buttons for mobile grids */
  .wizard-muscle-option,
  .wizard-equipment-option {
    min-height: 60px !important; /* Smaller height */
    padding: 0.25rem !important;
  }

  .wizard-muscle-option img,
  .wizard-equipment-option img {
    width: 28px !important; /* Smaller icons */
    height: 28px !important;
    margin-bottom: 2px !important;
  }

  .wizard-muscle-option span,
  .wizard-equipment-option span {
    font-size: 11px !important; /* Slightly larger text */
    line-height: 1.2 !important;
  }

  /* Compact Experience/Training buttons on mobile */
  .wizard-option {
    min-height: 60px !important;
    padding: 0.5rem !important;
  }
  .wizard-option i { font-size: 1.2rem !important; margin-bottom: 0.25rem !important; }
  .wizard-option span { font-size: 0.8rem !important; }
}

/* Muscle & Equipment Items */
.wizard-muscle-option,
.wizard-equipment-option {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  position: relative !important;
  transition: all 0.2s !important;
  padding: 0.75rem !important;
}

.wizard-muscle-option.selected,
.wizard-equipment-option.selected {
  border-color: #5D5FEF !important;
  background: rgba(93, 95, 239, 0.05) !important;
}

/* Checkmark badge */
.wizard-muscle-option.selected::after,
.wizard-equipment-option.selected::after {
  content: '✓' !important;
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  width: 16px !important;
  height: 16px !important;
  background: #5D5FEF !important;
  color: #fff !important;
  border-radius: 50% !important;
  font-size: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.wizard-muscle-option img,
.wizard-equipment-option img {
  width: 48px !important;
  height: 48px !important;
  object-fit: contain !important;
  margin-bottom: 0.5rem !important;
}

.wizard-muscle-option span,
.wizard-equipment-option span {
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  text-align: center !important;
  word-break: normal !important; /* Prevent mid-word breaks */
  overflow-wrap: break-word !important;
}

/* Footer */
.wizard-footer {
  flex: 0 0 auto !important;
  padding: 1rem 1.5rem !important;
  background: #fff !important;
  border-top: 1px solid #f1f5f9 !important;
  display: flex !important;
  justify-content: space-between !important;
  gap: 1rem !important;
}

.wizard-btn {
  padding: 0.75rem 1.5rem !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  transition: all 0.2s !important;
  cursor: pointer !important;
  display: flex; /* Remove !important to allow JS toggling */
  align-items: center !important;
  gap: 0.5rem !important;
  border: none !important;
}

.wizard-back-btn {
  background: #f1f5f9 !important;
  color: #64748b !important;
}

.wizard-next-btn,
.wizard-generate-btn {
  background: #5D5FEF !important;
  color: #fff !important;
  box-shadow: 0 4px 6px -1px rgba(93, 95, 239, 0.3) !important;
}

.wizard-next-btn:hover,
.wizard-generate-btn:hover {
  background: #4f46e5 !important;
  transform: translateY(-1px) !important;
}

/* Time Slider */
.wizard-time-slider {
  background: #f8fafc !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  text-align: center !important;
}

.wizard-slider {
  width: 100% !important;
  height: 6px !important;
  background: #e2e8f0 !important;
  border-radius: 3px !important;
  outline: none !important;
  -webkit-appearance: none !important;
}

.wizard-slider::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 24px !important;
  height: 24px !important;
  background: #5D5FEF !important;
  border-radius: 50% !important;
  cursor: pointer !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.time-display {
  margin-top: 1rem !important;
  font-size: 1.5rem !important;
  font-weight: 700 !important;
  color: #5D5FEF !important;
}
