/**
 * About You Extended Questions - Styles
 * Batch selector, progress tracking, and question type components
 */

/* ========================================
   Profile Progress Overview
   ======================================== */

.profile-progress-overview {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--cloud) 100%);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  margin: var(--space-4) 0 var(--space-6);
  border: 1px solid var(--slate);
  box-shadow: var(--shadow-low);
}

.progress-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.progress-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-body);
  color: var(--ink);
}

.progress-title .emoji {
  font-size: 24px;
}

.progress-title strong {
  color: var(--accent);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
}

.progress-bar-container {
  background: var(--mist);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--slate);
}

.progress-bar-container.small {
  height: 6px;
  margin: var(--space-3) 0 var(--space-5);
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--t-slow) var(--ease);
}

/* ========================================
   Batch Selector
   ======================================== */

.batch-selector {
  margin: var(--space-6) 0;
}

.batch-list {
  display: grid;
  gap: var(--space-4);
}

.batch-card {
  background: var(--cloud);
  border: 1px solid var(--slate);
  border-radius: var(--radius-card);
  padding: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  box-shadow: var(--shadow-low);
}

.batch-card:hover:not(.locked) {
  border-color: var(--accent);
  box-shadow: var(--shadow-mid);
  transform: translateY(-1px);
}

.batch-card:focus-visible {
  box-shadow: var(--shadow-focus);
  border-color: var(--accent);
}

.batch-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--mist);
}

.batch-card.complete {
  border-color: var(--mint);
  background: linear-gradient(135deg, var(--mint-tint) 0%, var(--cloud) 100%);
}

.batch-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.batch-content {
  flex: 1;
}

.batch-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 4px;
}

.batch-description {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  margin-bottom: 6px;
}

.batch-meta {
  font-size: 0.75rem;
  color: var(--text-muted, #9ca3af);
  font-weight: 500;
}

.batch-status {
  flex-shrink: 0;
}

.status-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.status-badge[data-status="not_started"] {
  background: var(--primary, #3b82f6);
  color: white;
}

.status-badge[data-status="in_progress"] {
  background: var(--warning, #f59e0b);
  color: white;
}

.status-badge[data-status="complete"] {
  background: var(--success, #10b981);
  color: white;
}

.status-badge.locked {
  background: var(--muted-bg, #f3f4f6);
  color: var(--text-muted, #6b7280);
}

/* ========================================
   Batch Questions Form
   ======================================== */

.batch-progress-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.btn-back {
  background: var(--muted-bg, #f3f4f6);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-primary, #1f2937);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.batch-progress-info {
  flex: 1;
}

.batch-title-current {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 4px;
}

.questions-progress {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
}

/* ========================================
   Question Cards
   ======================================== */

.questions-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 24px 0;
}

.question-card {
  background: var(--card-bg, #ffffff);
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.2s ease;
}

.question-card:focus-within {
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.question-header {
  margin-bottom: 16px;
}

.question-prompt {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  line-height: 1.5;
  text-transform: none;
}

.question-prompt .required {
  color: #ef4444;
  margin-left: 4px;
  font-weight: 700;
  font-size: 1.125rem;
}

/* Override general game-form label styling for About You */
.game-panel[data-game-type="about_you"] label {
  text-transform: none;
  color: var(--text-primary, #1f2937);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: normal;
}

/* Override general game-form label styling for Baby Photo */
.game-panel label[for="photoInfo"] {
  text-transform: none;
  color: var(--text-primary, #1f2937);
  font-weight: 600;
  letter-spacing: normal;
}

/* Required indicator for basic info form labels */
.game-panel[data-game-type="about_you"] label .required {
  color: #ef4444;
  margin-left: 4px;
  font-weight: 700;
  font-size: 1.125rem;
}

.question-prompt .optional {
  color: var(--text-muted, #9ca3af);
  font-size: 0.875rem;
  font-weight: 400;
  margin-left: 8px;
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
  background: var(--muted-bg, #f3f4f6);
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 8px;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--primary, #3b82f6);
  background: var(--primary-lighter, #eff6ff);
  padding: 4px 10px;
  border-radius: 999px;
  margin-top: 8px;
}

.help-text {
  font-size: 0.875rem;
  color: var(--text-muted, #6b7280);
  margin-top: 8px;
  font-style: italic;
}

/* ========================================
   Either/Or Questions
   ======================================== */

.either-or-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.option-btn {
  position: relative;
  background: var(--cloud);
  border: 1px solid var(--slate);
  border-radius: var(--radius-base);
  padding: var(--space-5);
  min-height: var(--btn-height);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-low);
}

.option-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--shadow-mid);
}

.option-btn:focus-visible {
  box-shadow: var(--shadow-focus);
  border-color: var(--accent);
}

.option-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--cloud);
  box-shadow: var(--shadow-mid);
}

.option-btn .check-icon {
  display: none;
  font-size: 20px;
  font-weight: var(--fw-bold);
}

.option-btn.selected .check-icon {
  display: block;
}

.option-label {
  text-align: center;
}

.modifier-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.modifier-btn {
  background: var(--muted-bg, #f3f4f6);
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #1f2937);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modifier-btn:hover {
  background: var(--muted-hover, #e5e7eb);
}

.modifier-btn.active {
  background: var(--primary-lighter, #dbeafe);
  border-color: var(--primary, #3b82f6);
  color: var(--primary, #3b82f6);
}

/* ========================================
   Single Choice Questions
   ======================================== */

.single-choice-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  position: relative;
  background: var(--cloud);
  border: 1px solid var(--slate);
  border-radius: var(--radius-base);
  padding: 14px 16px;
  min-height: var(--btn-height);
  font-size: var(--fs-body);
  color: var(--ink);
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-align: left;
  box-shadow: var(--shadow-low);
}

.choice-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--shadow-mid);
}

.choice-btn:focus-visible {
  box-shadow: var(--shadow-focus);
  border-color: var(--accent);
}

.choice-btn.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.radio-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--slate);
  background: var(--cloud);
  flex-shrink: 0;
  position: relative;
  transition: all var(--t-base) var(--ease);
}

.choice-btn.selected .radio-indicator {
  border-color: var(--accent);
  background: var(--accent);
}

.choice-btn.selected .radio-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cloud);
}

.choice-label {
  flex: 1;
  font-weight: var(--fw-medium);
}

.choice-btn .check-icon {
  display: none;
  color: var(--accent);
  font-size: 20px;
  font-weight: var(--fw-bold);
}

.choice-btn.selected .check-icon {
  display: block;
}

.write-in-container {
  margin-top: 12px;
  animation: slideDown 0.2s ease;
}

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

.write-in-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--primary, #3b82f6);
  border-radius: 8px;
  font-size: 0.9375rem;
  background: #ffffff;
  color: #1f2937;
}

.write-in-input::placeholder {
  color: #9ca3af;
  opacity: 0.7;
}

.write-in-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

/* ========================================
   Short Text Questions
   ======================================== */

/* Fix input visibility - ensure white background and dark text */
.game-panel[data-game-type="about_you"] input[type="text"],
.game-panel[data-game-type="about_you"] input[type="email"],
.game-panel[data-game-type="about_you"] textarea {
  background: #ffffff !important;
  color: #1f2937 !important;
  border: 2px solid #e5e7eb;
}

.game-panel[data-game-type="about_you"] input[type="text"]:focus,
.game-panel[data-game-type="about_you"] input[type="email"]:focus,
.game-panel[data-game-type="about_you"] textarea:focus {
  background: #ffffff !important;
  color: #1f2937 !important;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.game-panel[data-game-type="about_you"] input::placeholder,
.game-panel[data-game-type="about_you"] textarea::placeholder {
  color: #9ca3af !important;
  opacity: 0.7;
}

.text-input-answer {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  font-size: 1rem;
  background: #ffffff;
  color: #1f2937;
  transition: all 0.2s ease;
}

.text-input-answer::placeholder {
  color: #9ca3af;
  opacity: 0.7;
}

.text-input-answer:focus {
  outline: none;
  border-color: var(--primary, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

.char-count {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted, #9ca3af);
  margin-top: 6px;
}

.char-count .current {
  font-weight: 600;
  color: var(--text-primary, #1f2937);
}

/* ========================================
   Form Actions
   ======================================== */

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color, #e5e7eb);
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.form-section-title .emoji {
  font-size: 1.5rem;
}

/* ========================================
   Dropdown Questions
   ======================================== */

.question-card.dropdown {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 24px;
}

.question-card.dropdown .question-header {
  margin-bottom: 12px;
}

.dropdown-select {
  width: 100%;
  padding: 14px 40px 14px 16px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #ffffff;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.dropdown-select:hover {
  border-color: #9ca3af;
}

.dropdown-select:focus {
  outline: none;
  border-color: var(--warm-gold, #D4A574);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

.dropdown-select option {
  padding: 12px;
  background: #ffffff;
  color: #1f2937;
}

.dropdown-select option:first-child {
  color: #9ca3af;
  font-style: italic;
}

.dropdown-select:invalid {
  color: #9ca3af;
}

/* ========================================
   Photo Upload Questions
   ======================================== */

.question-card.photo-upload {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 24px;
}

.question-card.photo-upload .question-header {
  margin-bottom: 16px;
}

.photo-instructions {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 0 0;
  line-height: 1.5;
  font-style: italic;
}

.photo-upload-container {
  text-align: center;
}

.photo-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

.photo-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.photo-upload-btn:active {
  transform: translateY(0);
}

.photo-preview {
  margin-bottom: 16px;
  position: relative;
}

.preview-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: block;
  margin: 0 auto 12px;
}

.remove-photo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.remove-photo:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.remove-photo span {
  font-size: 20px;
  line-height: 1;
}

.photo-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 640px) {
  .either-or-buttons {
    grid-template-columns: 1fr;
  }
  
  .option-btn {
    padding: 16px;
  }
  
  .batch-card {
    flex-direction: column;
    text-align: center;
  }
  
  .batch-icon {
    font-size: 2rem;
  }
  
  .form-actions {
    flex-direction: column-reverse;
  }
  
  .form-actions button {
    width: 100%;
  }
}

/* ========================================
   Centered Submit Buttons
   ======================================== */

.game-panel[data-game-type="about_you"] button[type="submit"],
.game-panel[data-game-type="about_you"] .btn.primary {
  display: block;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
