/* =========================================
   Wizard – Global Styles
   ========================================= */

/* Card */
.wizard-card {
  border-radius: var(--fs-radius-md);
  overflow: hidden;
  animation: wizardEnter .3s ease-out forwards;
  border: 1px solid var(--fs-neutral-200);
  box-shadow: var(--fs-shadow-sm);
  background: #fff;
}
.wizard-card-header {
  background: var(--fs-grad-card);
  color: #fff;
  padding: var(--fs-space-md, 1rem) var(--fs-space-lg, 1.5rem);
}
.wizard-card-header h5 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* Page Enter Animation */
@keyframes wizardEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fade-In (advanced drawers etc.) */
.fade-in {
  animation: fadeInUp .25s ease-out forwards;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Inline Error States
   ========================================= */
.wizard-field-error {
  color: var(--fs-danger, #ef4444);
  font-size: .85rem;
  margin-top: .25rem;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.wizard-field-error::before {
  content: "\F33A";
  font-family: "bootstrap-icons";
  font-size: .8rem;
}
.wizard-card .form-control.is-invalid,
.wizard-card .form-select.is-invalid {
  border-color: var(--fs-danger, #ef4444);
  box-shadow: 0 0 0 .2rem rgba(239, 68, 68, .12);
}

/* =========================================
   Tooltip Help Icon
   ========================================= */
.wizard-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--fs-green-50, #eaf7f3);
  color: var(--fs-green-700, #008060);
  font-size: .72rem;
  cursor: help;
  border: 1px solid var(--fs-green-200, #8fd9bf);
  margin-left: .4rem;
  transition: background 150ms ease;
}
.wizard-help:hover {
  background: var(--fs-green-200, #8fd9bf);
}

/* =========================================
   Wizard Stepper
   ========================================= */
.wizard-stepper {
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid var(--fs-neutral-200);
  border-radius: var(--fs-radius-md);
  box-shadow: var(--fs-shadow-xs);
}
.wizard-stepper-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* Step */
.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  flex: 0 0 auto;
}
.wizard-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .95rem;
  background: var(--fs-neutral-100, #f1f5f9);
  color: var(--fs-neutral-400, #94a3b8);
  transition: all var(--fs-transition-base, 200ms) ease;
  border: 2px solid var(--fs-neutral-200, #e2e8f0);
}
.wizard-step-label {
  font-size: .78rem;
  font-weight: 500;
  color: var(--fs-neutral-400, #94a3b8);
  transition: color var(--fs-transition-base, 200ms) ease;
  letter-spacing: .01em;
}

/* Active */
.wizard-step--active .wizard-step-circle {
  background: var(--fs-grad-brand);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(0, 128, 96, .15), var(--fs-shadow-sm);
}
.wizard-step--active .wizard-step-label {
  color: var(--fs-green-700, #008060);
  font-weight: 700;
}

/* Done */
.wizard-step--done .wizard-step-circle {
  background: var(--fs-green-50, #eaf7f3);
  color: var(--fs-green-600, #008f6b);
  border-color: var(--fs-green-300, #4dc9a0);
}
.wizard-step--done .wizard-step-label {
  color: var(--fs-green-600, #008f6b);
  font-weight: 500;
}

/* Clickable Done Steps */
a.wizard-step--done {
  text-decoration: none;
}
a.wizard-step--done:hover .wizard-step-circle {
  background: var(--fs-green-100, #c7eadf);
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(0, 128, 96, .12);
}
a.wizard-step--done:hover .wizard-step-label {
  font-weight: 600;
  color: var(--fs-green-700, #008060);
}

/* Connecting Lines */
.wizard-step-line {
  flex: 1 1 0;
  height: 3px;
  min-width: 40px;
  max-width: 100px;
  background: var(--fs-neutral-200, #e2e8f0);
  border-radius: var(--fs-radius-pill, 999px);
  margin: 0 .5rem;
  margin-bottom: 1.2rem;
  transition: background var(--fs-transition-base, 200ms) ease;
  position: relative;
}
.wizard-step-line--done {
  background: linear-gradient(90deg, var(--fs-green-300, #4dc9a0), var(--fs-green-400, #00b386));
}

/* =========================================
   Connector-Type Cards (Step 1)
   ========================================= */
.connector-card {
  cursor: pointer;
  transition: all 200ms ease;
  border: 2px solid var(--fs-neutral-200, #e2e8f0) !important;
  border-radius: var(--fs-radius-lg, 1rem) !important;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-align: center;
  padding: 1.5rem 1rem;
}
.connector-card:hover {
  border-color: var(--fs-green-300, #4dc9a0) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 128, 96, .08);
}
.connector-card--active {
  border-color: var(--fs-green-700, #008060) !important;
  background: var(--fs-green-50, #eaf7f3) !important;
  box-shadow: 0 0 0 4px rgba(0, 128, 96, .1);
}
.connector-card input[type="radio"] {
  display: none;
}
.connector-icon {
  color: var(--fs-green-700, #008060);
  font-size: 2.5rem;
  line-height: 1;
}

/* =========================================
   Dropzone (Step 2 – File Upload)
   ========================================= */
.dropzone-area {
  border: 2px dashed var(--fs-green-300, #4dc9a0);
  border-radius: var(--fs-radius-lg, 1rem);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 200ms ease;
  background: var(--fs-green-50, #eaf7f3);
}
.dropzone-area:hover,
.dropzone-area.dragover {
  border-color: var(--fs-green-700, #008060);
  background: rgba(0, 128, 96, .06);
}
.dropzone-area.has-file {
  border-style: solid;
  border-color: var(--fs-green-700, #008060);
  background: var(--fs-green-50, #eaf7f3);
  padding: 1.5rem;
}
.dropzone-content .bi-cloud-arrow-up {
  color: var(--fs-green-700, #008060);
}

/* =========================================
   URL Test Button (Step 2 – URL)
   ========================================= */
.url-test-result {
  font-size: .85rem;
  margin-top: .25rem;
  font-weight: 500;
}
.url-test-result.is-ok {
  color: var(--fs-green-700, #008060);
}
.url-test-result.is-fail {
  color: var(--fs-danger, #ef4444);
}

/* =========================================
   Sync-Mode Cards (Step 4)
   ========================================= */
.sync-mode-card {
  cursor: pointer;
  transition: all 200ms ease;
  border: 2px solid var(--fs-neutral-200, #e2e8f0) !important;
  border-radius: var(--fs-radius-lg, 1rem) !important;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}
.sync-mode-card:hover {
  border-color: var(--fs-green-300, #4dc9a0) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 128, 96, .08);
}
.sync-mode-card--active {
  border-color: var(--fs-green-700, #008060) !important;
  background: var(--fs-green-50, #eaf7f3) !important;
  box-shadow: 0 0 0 4px rgba(0, 128, 96, .1);
}
.sync-mode-card input[type="radio"] {
  display: none;
}

/* =========================================
   Condition Cards (Step 4)
   ========================================= */
.condition-card {
  border-radius: var(--fs-radius-md, .75rem);
  animation: fadeInUp .2s ease-out;
  border: 1px solid var(--fs-neutral-200) !important;
  box-shadow: var(--fs-shadow-xs);
  background: #fff !important;
  transition: box-shadow var(--fs-transition-fast);
}
.condition-card:hover {
  box-shadow: var(--fs-shadow-sm);
}
.condition-label {
  font-weight: 600;
  color: var(--fs-green-700, #008060);
  white-space: nowrap;
  min-width: 44px;
  font-size: .82rem;
}
.conditions-list:empty::after {
  content: "Keine Bedingungen \2013  alle Zeilen werden verarbeitet.";
  display: block;
  padding: 1.5rem;
  text-align: center;
  color: var(--fs-neutral-400, #94a3b8);
  font-size: .85rem;
  border: 2px dashed var(--fs-neutral-200, #e2e8f0);
  border-radius: var(--fs-radius-md, .75rem);
  background: var(--fs-neutral-50);
}
.condition-card .form-select,
.condition-card .form-control {
  max-width: 200px;
  font-size: .82rem;
}
.condition-card .condition-val {
  max-width: 180px;
}
.condition-card .btn-outline-danger {
  opacity: .5;
  transition: opacity var(--fs-transition-fast);
}
.condition-card:hover .btn-outline-danger {
  opacity: 1;
}

/* =========================================
   Wizard Tabs (Mapping + Conditions)
   ========================================= */
.wizard-tabs {
  display: flex;
  gap: .5rem;
  border-bottom: 2px solid var(--fs-neutral-200, #e2e8f0);
  margin-bottom: 1.5rem;
  background: #fff;
  padding: 0 .5rem;
}
.wizard-tab {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.25rem;
  font-size: .88rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--fs-neutral-500, #64748b);
  border-radius: var(--fs-radius-sm) var(--fs-radius-sm) 0 0;
  transition: all var(--fs-transition-fast, 150ms) ease;
  white-space: nowrap;
}
.wizard-tab i {
  font-size: .95rem;
}
.wizard-tab:hover {
  color: var(--fs-neutral-700, #334155);
  background: var(--fs-neutral-50, #f8fafc);
}
.wizard-tab--active {
  color: var(--fs-green-700, #008060);
  border-bottom-color: var(--fs-green-700, #008060);
  font-weight: 600;
  background: rgba(0, 128, 96, .03);
}
.wizard-tab--active i {
  color: var(--fs-green-600, #008f6b);
}

/* =========================================
   MC Tabs – Glass Pills on Gradient Header
   ========================================= */
.mc-tabs {
  display: flex;
  gap: .25rem;
  background: rgba(255, 255, 255, .12);
  border-radius: var(--fs-radius-pill, 999px);
  padding: .2rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.mc-tab {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem 1rem;
  font-size: .82rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, .65);
  cursor: pointer;
  border-radius: var(--fs-radius-pill, 999px);
  transition: all var(--fs-transition-fast, 150ms) ease;
  white-space: nowrap;
  line-height: 1.3;
}
.mc-tab i {
  font-size: .85rem;
}
.mc-tab:hover {
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .1);
}
.mc-tab--active {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Sync-Mode Segmented Control */
.sync-mode-group {
  width: 100%;
}
.sync-mode-group .btn {
  font-size: .85rem;
  padding: .6rem 1rem;
  font-weight: 500;
  transition: all var(--fs-transition-fast) ease;
}
.sync-mode-group .btn-check:checked + .btn {
  background-color: var(--fs-green-50, #eaf7f3);
  border-color: var(--fs-green-600, #008f6b);
  color: var(--fs-green-700, #008060);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(0, 128, 96, .15);
}

/* =========================================
   Data Preview (Step 2 inline table)
   ========================================= */
.data-preview {
  border: 1px solid var(--fs-neutral-200, #e2e8f0);
  border-radius: var(--fs-radius-md, .75rem);
  padding: 1rem 1.25rem;
  background: #fff;
  box-shadow: var(--fs-shadow-xs);
  animation: fadeInUp .25s ease-out;
}
.data-preview h6 {
  color: var(--fs-green-700, #008060);
  font-weight: 600;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.data-preview-table {
  max-height: 280px;
  overflow: auto;
  border-radius: var(--fs-radius-sm, .5rem);
  border: 1px solid var(--fs-neutral-200, #e2e8f0);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .03);
}
.data-preview-table table {
  font-size: .8rem;
  margin-bottom: 0;
}
.data-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--fs-neutral-50, #f8fafc);
  font-weight: 600;
  font-size: .72rem;
  color: var(--fs-neutral-600, #475569);
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 2px solid var(--fs-neutral-200);
  padding: .5rem .6rem;
}
.data-preview-table tbody td {
  padding: .35rem .6rem;
  color: var(--fs-neutral-700);
  border-color: var(--fs-neutral-100);
}
.data-preview-table tbody tr:hover td {
  background: var(--fs-neutral-50);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 576px) {
  .wizard-stepper-track { gap: 0; }
  .wizard-step-circle { width: 34px; height: 34px; font-size: .85rem; }
  .wizard-step-label { font-size: .72rem; }
  .wizard-step-line { min-width: 24px; max-width: 60px; }
  .connector-card { min-height: 120px; }
  .sync-mode-card { min-height: 110px; }
  .condition-card { flex-wrap: wrap; }
  .condition-card .form-select,
  .condition-card .form-control { max-width: 100%; }
  .wizard-tabs { overflow-x: auto; }
  .wizard-tab { font-size: .82rem; padding: .6rem 1rem; }
}
