/* modules/wizardModule.css */
/* Styling for the Wizard Module multi-step form */

.wizard-module-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.wizard-module-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.wizard-module-container {
  position: relative;
  width: 90%;
  max-width: 600px;
  background: var(--bg-primary, #ffffff);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .wizard-module-container {
    background: var(--bg-primary, #1a1a1a);
    color: var(--text-primary, #ffffff);
  }
}

.wizard-module-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wizard-module-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.wizard-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-secondary, #6b7280);
  transition: background 150ms, color 150ms;
}

.wizard-close-btn:hover {
  background: var(--bg-hover, #f3f4f6);
  color: var(--text-primary, #1f2937);
}

@media (prefers-color-scheme: dark) {
  .wizard-close-btn:hover {
    background: var(--bg-hover, #2d2d2d);
    color: var(--text-primary, #ffffff);
  }
}

/* Progress bar */
.wizard-progress-bar {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  position: relative;
  flex-shrink: 0;
}

.wizard-progress-dots {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
}

.wizard-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary, #f3f4f6);
  border: 2px solid var(--border-color, #d1d5db);
  color: var(--text-secondary, #6b7280);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  transition: all 200ms;
  cursor: default;
  flex-shrink: 0;
}

.wizard-dot.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wizard-dot.complete {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

@media (prefers-color-scheme: dark) {
  .wizard-dot {
    background: var(--bg-secondary, #2d2d2d);
    color: var(--text-secondary, #9ca3af);
  }

  .wizard-dot.active {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  }
}

.wizard-progress-line {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--bg-secondary, #f3f4f6);
  border-radius: 1px;
  overflow: hidden;
}

.wizard-progress-line::after {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  transition: width 300ms ease-out;
  border-radius: 1px;
}

/* Body */
.wizard-module-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.wizard-step-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wizard-step-content > h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.wizard-step-description {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #6b7280);
}

/* Form elements */
.wizard-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-form-group > label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #1f2937);
}

@media (prefers-color-scheme: dark) {
  .wizard-form-group > label {
    color: var(--text-primary, #ffffff);
  }
}

.wizard-input,
.wizard-textarea,
.wizard-select {
  padding: 10px 12px;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-input, #ffffff);
  color: var(--text-primary, #1f2937);
  transition: border-color 150ms, box-shadow 150ms;
}

.wizard-input:focus,
.wizard-textarea:focus,
.wizard-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wizard-input.error {
  border-color: #ef4444;
}

@media (prefers-color-scheme: dark) {
  .wizard-input,
  .wizard-textarea,
  .wizard-select {
    background: var(--bg-input, #2d2d2d);
    border-color: var(--border-color, #4b5563);
    color: var(--text-primary, #ffffff);
  }

  .wizard-input:focus,
  .wizard-textarea:focus,
  .wizard-select:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  }
}

.wizard-textarea {
  resize: vertical;
  min-height: 80px;
}

/* Radio group */
.wizard-radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wizard-radio {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms;
}

.wizard-radio:hover {
  background: var(--bg-hover, #f9fafb);
  border-color: #3b82f6;
}

.wizard-radio input[type='radio'] {
  margin-top: 2px;
  cursor: pointer;
}

.wizard-radio input[type='radio']:checked + .glyph + .label {
  color: #3b82f6;
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .wizard-radio:hover {
    background: var(--bg-hover, #2d2d2d);
  }
}

.wizard-radio .glyph {
  font-size: 18px;
  display: flex;
  align-items: center;
}

.wizard-radio .label {
  font-weight: 500;
  color: var(--text-primary, #1f2937);
}

@media (prefers-color-scheme: dark) {
  .wizard-radio .label {
    color: var(--text-primary, #ffffff);
  }
}

.wizard-radio .desc {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  margin-left: auto;
  text-align: right;
}

/* Checkbox group */
.wizard-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
}

.wizard-checkbox input[type='checkbox'] {
  margin-top: 3px;
  cursor: pointer;
}

.wizard-checkbox .label {
  font-weight: 500;
  color: var(--text-primary, #1f2937);
}

@media (prefers-color-scheme: dark) {
  .wizard-checkbox .label {
    color: var(--text-primary, #ffffff);
  }
}

.wizard-checkbox .desc {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  margin-left: 0;
}

/* Info boxes */
.wizard-info-box {
  padding: 12px;
  background: #f0f9ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 13px;
  color: #1e40af;
}

.wizard-info-box strong {
  display: block;
  margin-bottom: 4px;
}

.wizard-info-box p {
  margin: 4px 0;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .wizard-info-box {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
  }
}

/* Error states */
.wizard-error {
  font-size: 12px;
  color: #ef4444;
  margin-top: -4px;
}

.wizard-error-box {
  padding: 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  color: #991b1b;
}

.wizard-error-content {
  font-size: 13px;
  line-height: 1.5;
}

.wizard-error-content p {
  margin: 0 0 4px 0;
}

.wizard-error-content p:first-child {
  font-weight: 600;
}

@media (prefers-color-scheme: dark) {
  .wizard-error-box {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
  }
}

/* Summary */
.wizard-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 6px;
}

.summary-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.summary-label {
  font-weight: 600;
  color: var(--text-secondary, #6b7280);
}

.summary-value {
  color: var(--text-primary, #1f2937);
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .wizard-summary {
    background: var(--bg-secondary, #2d2d2d);
  }

  .summary-label {
    color: var(--text-secondary, #9ca3af);
  }

  .summary-value {
    color: var(--text-primary, #ffffff);
  }
}

/* Character count */
.wizard-char-count {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  text-align: right;
}

/* Footer */
.wizard-module-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Buttons */
.wizard-btn-back,
.wizard-btn-next,
.wizard-btn-cancel {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms;
}

.wizard-btn-next {
  background: #3b82f6;
  color: white;
}

.wizard-btn-next:hover {
  background: #2563eb;
}

.wizard-btn-next:active {
  background: #1d4ed8;
}

.wizard-btn-back {
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-primary, #1f2937);
  border: 1px solid var(--border-color, #d1d5db);
}

.wizard-btn-back:hover {
  background: var(--bg-hover, #e5e7eb);
}

.wizard-btn-cancel {
  background: var(--bg-secondary, #f3f4f6);
  color: var(--text-primary, #1f2937);
  border: 1px solid var(--border-color, #d1d5db);
}

.wizard-btn-cancel:hover {
  background: var(--bg-hover, #e5e7eb);
}

@media (prefers-color-scheme: dark) {
  .wizard-btn-back,
  .wizard-btn-cancel {
    background: var(--bg-secondary, #2d2d2d);
    color: var(--text-primary, #ffffff);
    border-color: var(--border-color, #4b5563);
  }

  .wizard-btn-back:hover,
  .wizard-btn-cancel:hover {
    background: var(--bg-hover, #3d3d3d);
  }
}

/* Scrollbar styling */
.wizard-module-body::-webkit-scrollbar {
  width: 6px;
}

.wizard-module-body::-webkit-scrollbar-track {
  background: transparent;
}

.wizard-module-body::-webkit-scrollbar-thumb {
  background: var(--border-color, #d1d5db);
  border-radius: 3px;
}

.wizard-module-body::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Responsive */
@media (max-width: 640px) {
  .wizard-module-container {
    width: 95%;
    max-height: 90vh;
  }

  .wizard-module-header,
  .wizard-progress-bar,
  .wizard-module-body,
  .wizard-module-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .wizard-progress-dots {
    gap: 8px;
  }

  .wizard-dot {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .wizard-radio .desc {
    display: none;
  }

  .wizard-module-footer {
    flex-wrap: wrap;
  }

  .wizard-btn-back,
  .wizard-btn-next,
  .wizard-btn-cancel {
    flex: 1;
    min-width: 80px;
  }
}

/* Message action bar for chat suggestions */
.message-action-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (prefers-color-scheme: dark) {
  .message-action-bar {
    border-top-color: var(--border-color, #2d2d2d);
  }
}

.message-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-color, #d1d5db);
  border-radius: 6px;
  background: var(--bg-secondary, #f9fafb);
  color: var(--text-primary, #1f2937);
  cursor: pointer;
  transition: all 150ms ease;
}

.message-action-btn:hover {
  background: var(--bg-hover, #f3f4f6);
  border-color: var(--border-hover, #9ca3af);
}

.message-action-btn:active {
  transform: scale(0.98);
}

.message-action-btn .action-icon {
  font-size: 14px;
}

.message-action-btn .action-label {
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .message-action-btn {
    background: var(--bg-secondary, #2d2d2d);
    color: var(--text-primary, #e5e7eb);
    border-color: var(--border-color, #3f3f3f);
  }

  .message-action-btn:hover {
    background: var(--bg-hover, #3f3f3f);
    border-color: var(--border-hover, #4f4f4f);
  }
}

.coaching-thread-btn {
  /* Pro feature badge styling */
}

.pro-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 3px;
  margin-left: 4px;
  letter-spacing: 0.5px;
}
