:host {
  display: block;
  min-height: 100vh;
}

/* ================= VIEW TOGGLE ================= */
.view-toggle {
  display: flex;
  justify-content: flex-end;
  padding: 0 1rem;
  margin-bottom: 1rem;

  .Toggle {
    display: flex;
    gap: 8px;
  }

  button {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;

    &.active {
      background: var(--action-primary-default);
      color: white;
      border-color: var(--action-primary-default);
    }

    &:hover:not(.active) {
      background: #f9fafb;
    }
  }
}

/* ================= STEP INDICATOR ================= */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  width: 100%;
  gap: 0;
}

.step-item {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
  cursor: pointer;
  min-width: 0;
  transition: opacity 0.2s;

  &:hover {
    opacity: 0.8;
  }

  &:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 52px;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
  }

  &.completed::after {
    background: var(--action-primary-default);
  }
}

.step-circle {
  width: 40px;
  height: 40px;
  min-width: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  margin-right: 12px;
  position: relative;
  z-index: 1;

  &.active,
  &.completed {
    background: var(--action-primary-default);
    color: white;
  }
}

.step-info {
  flex: 1;
  min-width: 0;
  padding-right: 8px;

  h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  p {
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* ================= WIZARD LAYOUT ================= */
.wizard-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  padding: 0 1rem;
  align-items: start;
}

/* ================= FORM VIEW LAYOUT ================= */
.form-view-layout {
  padding: 0 1rem;
}

/* ================= FORM CONTENT COLUMN ================= */
.form-content {
  min-width: 0;
}

/* ================= SCROLLABLE FORM AREA ================= */
.FormOverView {
  height: calc(100vh - 260px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  padding-bottom: 4rem;

  &.scrollbar {
    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-track {
      background: #f1f1f1;
      border-radius: 4px;
    }

    &::-webkit-scrollbar-thumb {
      background: #cbd5e1;
      border-radius: 4px;

      &:hover {
        background: #94a3b8;
      }
    }
  }
}

/* ================= STEP CARDS ================= */
.step1,
.step2,
.step3 {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;

  h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #111827;
  }

  .step-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
  }
}

/* ================= WIZARD STEP VISIBILITY ================= */
.wizard-view {

  .step1,
  .step2,
  .step3 {
    display: none;
  }

  &[data-step="1"] .step1 { display: block; }
  &[data-step="2"] .step2 { display: block; }
  &[data-step="3"] .step3 { display: block; }
}

/* ================= FORM VIEW VISIBILITY ================= */
.form-view {

  .step1,
  .step2,
  .step3 {
    display: block !important;

    .step-description {
      display: none;
    }
  }
}

/* ================= FIELD GROUPS ================= */
.field-group {
  margin-bottom: 1rem;

  > div {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }
}

/* ================= TEMPLATE CONTAINER (Step 1) ================= */
.template-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

/* ================= CONTENT TYPE CHECKBOXES (Step 3) ================= */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;

  .checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    transition: background 0.2s;

    &:hover {
      background: #f3f4f6;
    }

    label {
      font-size: 14px;
      font-weight: 500;
      color: #374151;
      cursor: pointer;
    }
  }
}

/* ================= ACTION SIDEBAR ================= */
.actions-sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 1rem;
  height: fit-content;

  h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 1.25rem 0;
    color: #111827;
  }

  button {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;

    &.primary {
      background: var(--action-primary-default);
      color: white;
      border: none;

      &:hover {
        opacity: 0.9;
      }
    }

    &.secondary {
      background: white;
      color: #374151;
      border: 1px solid #d1d5db;

      &:hover {
        background: #f9fafb;
      }
    }

    &:last-of-type {
      margin-bottom: 0;
    }
  }

  .step-counter {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;

    h4 {
      font-size: 14px;
      font-weight: 600;
      margin: 0 0 0.5rem 0;
      color: #111827;
    }

    p {
      font-size: 13px;
      color: #6b7280;
      margin: 0;
    }
  }
}