/**
 * Public styles for Pro components (IvyFormProgressIndicator, IvyFormPageNavigation)
 *
 * Pro components are dynamically loaded Vue components - their styles need to exist
 * in the Lite public CSS so they render correctly regardless of scoped/global CSS bundling.
 */

// ─── Progress Indicator ───────────────────────────────────────────────────────

.ivyforms-form-progress-indicator {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;

  &.ivyforms-form-progress-indicator--none {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 6px 12px;
    min-height: 36px;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px dashed var(--map-base-dusk-stroke--2, #d1d5db);
    background: var(--map-ground-level-1-background, #f9fafb);
    color: var(--map-base-text-0, #121a26);
    user-select: none;
    cursor: default;

    .ivyforms-form-progress-indicator__none-label {
      margin: 0;
      max-width: 100%;
      text-align: center;
      color: inherit;
    }
  }

  //// Hide settings button in public context (only needed in builder)
  //&__settings {
  //}

  // --- Progress Bar ---
  &__bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  &__bar-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--map-base-text-0, #121a26);
    width: 100%;
    display: block;
    line-height: 20px;
  }

  &__bar {
    width: 100%;
    height: 8px;
    background: var(--map-base-dusk-o10, rgba(30, 58, 138, 0.1));
    border-radius: 4px;
    overflow: hidden;
    position: relative;
  }

  &__bar-fill {
    height: 100%;
    background: var(--map-base-dusk-fill-0, #1e3a8a);
    border-radius: 4px;
    transition: width 0.3s ease;
  }

  // --- Tabs ---
  &__tabs {
    flex: 1;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }
  }

  &__tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--map-base-dusk-o10, rgba(30, 58, 138, 0.1));
    color: var(--map-base-text-1, #4b5563);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
      background: var(--map-base-dusk-fill-4, #1e40af);
      color: #fff;
    }

    &.is-active {
      background: var(--map-base-dusk-fill-4, #1e40af);
      color: #fff;
      font-weight: 500;
    }

    &.is-completed {
      background: var(--map-base-purple-o10, rgba(109, 40, 217, 0.1));
    }
  }

  &__tab-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    font-weight: 500;
  }

  &__tab-title {
    font-size: 13px;
  }

  // --- Rootline / Steps ---
  &__rootline {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    row-gap: 32px;
  }

  &__step {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 0;
    position: relative;
  }

  &__step-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-width: 60px;
    max-width: 80px;
    flex-shrink: 0;
  }

  &__step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--map-base-dusk-stroke--2, #d1d5db);
    background: var(--map-ground-level-1-foreground, #fff);
    color: var(--map-base-text-1, #4b5563);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    flex-shrink: 0;

    .is-active & {
      border-color: var(--map-base-dusk-fill-0, #1e3a8a);
      background: var(--map-base-dusk-fill-0, #1e3a8a);
      color: #fff;
    }

    .is-completed & {
      border-color: var(--map-base-dusk-fill-0, #1e3a8a);
      background: var(--map-base-dusk-fill-0, #1e3a8a);
      color: #fff;
    }
  }

  &__step-title-slot {
    min-height: 16px;
    line-height: 16px;
    max-width: 90px;
    width: 100%;
    text-align: center;
  }

  &__step-title {
    font-size: 12px;
    font-weight: 400;
    color: var(--map-base-text-1, #4b5563);
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 16px;

    .is-active & {
      font-weight: 500;
      color: var(--map-base-text-0, #121a26);
    }
  }

  &__step-connector {
    flex: 0 0 auto;
    width: 24px;
    height: 2px;
    background: var(--map-base-dusk-stroke--2, #d1d5db);
    margin: 0;
    position: relative;
    z-index: 1;
    top: -12px;
    transition: background 0.2s ease;

    &.is-completed {
      background: var(--map-base-dusk-fill-0, #1e3a8a);
    }
  }
}

// ─── Page Navigation ──────────────────────────────────────────────────────────

.ivyforms-form-page-navigation {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;

  &--separated {
    justify-content: space-between;
    width: 100%;
  }

  &--grouped {
    &.ivyforms-form-page-navigation--position-left {
      justify-content: flex-start;
    }

    &.ivyforms-form-page-navigation--position-center {
      justify-content: center;
    }

    &.ivyforms-form-page-navigation--position-right {
      justify-content: flex-end;
    }
  }

  &__buttons-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  &__button-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;

    .ivyforms-button-wrapper {
      display: flex;
      margin: 0;
    }
  }

  .ivyforms-button-wrapper,
  .ivyforms-button-action,
  button {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
  }
}
