/* ═══════════════════════════════════════════════════════
   ORTAK KASA — Wizard Steps Styles
   ═══════════════════════════════════════════════════════ */

/* ─── Wizard Progress Bar ─── */
#wizard-progress {
  padding: 0 var(--space-sm);
  margin-bottom: clamp(0.75rem, 3vw, 2rem);
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  position: relative;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--border-medium);
  transition: all var(--transition-base);
  position: relative;
}

.step-number {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-base);
}

.step-check {
  display: none;
  font-size: var(--fs-sm);
  color: white;
}

.step-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-base);
  white-space: nowrap;
}

/* Active step */
.progress-step.active .step-circle {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  border-color: var(--accent-solid);
  box-shadow: 0 0 16px var(--accent-glow);
}

.progress-step.active .step-number {
  color: white;
}

.progress-step.active .step-label {
  color: var(--text-primary);
}

/* Completed step */
.progress-step.completed .step-circle {
  background: var(--success);
  border-color: var(--success);
}

.progress-step.completed .step-number {
  display: none;
}

.progress-step.completed .step-check {
  display: block;
}

.progress-step.completed .step-label {
  color: var(--success);
}

/* Connector line */
.progress-connector {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  margin: 0 var(--space-sm);
  margin-bottom: 20px;
  max-width: 60px;
  transition: background var(--transition-base);
  position: relative;
}

.progress-connector.active {
  background: linear-gradient(90deg, var(--success), var(--accent-solid));
}

/* ─── Wizard Steps ─── */
#wizard-container {
  position: relative;
  min-height: 300px;
}

.wizard-step {
  display: none;
  animation: wizardStepIn 400ms ease-out;
}

.wizard-step.active {
  display: block;
}

@keyframes wizardStepIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.step-header {
  margin-bottom: var(--space-xl);
}

.step-title {
  font-size: var(--fs-2xl);
  font-weight: 800;
  margin-bottom: var(--space-xs);
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.step-description {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* ─── People List ─── */
.people-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.person-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-base);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  animation: fadeInUp 300ms ease-out;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.person-item:hover {
  border-color: var(--border-medium);
  background: rgba(255, 255, 255, 0.05);
}

.person-item.default {
  border-color: var(--accent-light);
  background: var(--accent-light);
}

.person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.person-name {
  flex: 1;
  font-weight: 500;
  font-size: var(--fs-sm);
}

.person-badge {
  font-size: var(--fs-xs);
  color: var(--accent-start);
  font-weight: 500;
  background: rgba(139, 92, 246, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.person-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--fs-sm);
}

.person-delete:hover {
  background: var(--danger-light);
  color: var(--danger);
}

.person-item.removing {
  animation: slideOutRight 300ms ease-in forwards;
}

@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateX(30px);
    max-height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
  }
}

.add-person-row {
  display: flex;
  gap: var(--space-sm);
}

.add-person-row .input-group {
  flex: 1;
}

/* ─── Expenses List ─── */
.expenses-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.expense-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-base) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  animation: fadeInUp 300ms ease-out;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.expense-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.expense-icon {
  font-size: var(--fs-2xl);
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.expense-info {
  flex: 1;
  min-width: 0;
}

.expense-title {
  font-weight: 600;
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expense-amount {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--accent-start);
  white-space: nowrap;
}

.expense-edit-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--fs-sm);
}

.expense-edit-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Total bar */
.expenses-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-base) var(--space-lg);
  background: var(--accent-light);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.expenses-total-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.expenses-total-amount {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--accent-start);
}

/* ─── Participants List ─── */
.participants-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.participant-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  animation: fadeInUp 300ms ease-out;
  transition: border-color var(--transition-fast);
}

.participant-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-base);
  border-bottom: 1px solid var(--border-subtle);
}

.participant-card-icon {
  font-size: var(--fs-2xl);
}

.participant-card-title {
  font-weight: 600;
  font-size: var(--fs-base);
  flex: 1;
}

.participant-card-amount {
  font-weight: 700;
  color: var(--accent-start);
  font-size: var(--fs-lg);
}

/* Split type toggle */
.split-toggle {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-base);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: var(--space-xs);
  border: 1px solid var(--border-subtle);
}

.split-toggle-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.split-toggle-btn.active {
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Select all button */
.select-all-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--space-md);
}

.select-all-btn {
  font-size: var(--fs-xs);
  color: var(--accent-start);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.select-all-btn:hover {
  background: var(--accent-light);
}

/* Participant checkboxes */
.participant-checkboxes {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.participant-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.participant-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.participant-row .checkbox-wrapper {
  flex: 1;
}

.participant-custom-amount {
  width: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  /* Minimum 16px to prevent iOS auto-zoom */
  font-size: max(var(--fs-sm), 16px);
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  text-align: right;
  outline: none;
  transition: border-color var(--transition-fast);
}

.participant-custom-amount:focus {
  border-color: var(--accent-solid);
  box-shadow: 0 0 0 2px var(--accent-light);
}

.participant-custom-amount:disabled {
  opacity: 0.3;
}

.participant-share-display {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-start);
  min-width: 80px;
  text-align: right;
}

.participant-summary {
  margin-top: var(--space-base);
  padding-top: var(--space-base);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-sm);
}

.participant-summary-label {
  color: var(--text-secondary);
}

.participant-summary-value {
  font-weight: 700;
  color: var(--success);
}

.participant-summary-value.warning {
  color: var(--warning);
}

.participant-summary-value.error {
  color: var(--danger);
}

/* ─── Wizard Navigation ─── */
#wizard-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-base) var(--space-lg);
  background: rgba(6, 6, 15, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
}

#wizard-nav .btn {
  min-width: 120px;
}

#wizard-nav .btn-calculate {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

#wizard-nav .btn-calculate:hover {
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.5);
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  #wizard-nav {
    padding: var(--space-sm) var(--space-md);
    background: rgba(6, 6, 15, 0.95);
  }

  #wizard-nav .btn {
    min-width: 100px;
    font-size: var(--fs-xs);
    padding: var(--space-sm) var(--space-md);
  }

  .step-circle {
    width: 32px;
    height: 32px;
  }

  .step-label {
    font-size: 0.7rem;
  }
  
  .progress-connector {
    margin: 0 var(--space-sm);
    margin-bottom: 20px;
  }
}

@media (max-width: 380px) {
  .progress-connector {
    max-width: 25px;
    margin: 0 var(--space-xs);
    margin-bottom: 18px;
  }

  .step-label {
    font-size: 0.65rem;
  }

  .step-circle {
    width: 28px;
    height: 28px;
  }

  .participant-card {
    padding: var(--space-base);
  }

  #wizard-nav .btn {
    min-width: 80px;
  }
}
