// Sitemap Links Popup Styles
.lbaic-settings-popup-sitemap-links {
  --lbaic-settings-popup-max-width: 640px;
}

.lbaic-settings-sitemap-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;

  &-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block-end: 8px;
    border-bottom: 1px solid var(--lbaic-settings-input-border);

    &-left {
      display: flex;
      align-items: center;
      gap: 12px;
      padding-inline-start: 13px;
    }
  }

  &-count {
    font-size: var(--lbaic-settings-fs-14);
    font-weight: var(--lbaic-settings-fw-400);
    color: var(--lbaic-settings-primary);
    line-height: var(--lbaic-settings-lh-18);
  }

  &-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;

    p {
      font-size: var(--lbaic-settings-fs-14);
      font-weight: var(--lbaic-settings-fw-400);
      color: var(--lbaic-settings-desc-color);
      line-height: var(--lbaic-settings-lh-20);
      margin: 0;
    }
  }

  &-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-height: calc(min(100dvh,100svh) - var(--wp-admin--admin-bar--height, 46px) - var(--lbaic-settings-popup-gap) - env(safe-area-inset-top, 0px) - 260px); // Height of the popup - 230px
    overflow-y: auto;
  }

  &-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    background-color: var(--lbaic-settings-input-bg);
    border: 1px solid var(--lbaic-settings-input-border);
    border-radius: 6px;
    cursor: pointer;

    &:hover, &.selected {
      border-color: var(--lbaic-settings-primary);
    }

    &.selected {
      background-color: rgba(var(--lbaic-settings-primary-rgb), 0.05);
    }

    &-url {
      flex: 1 1 auto;
      font-size: var(--lbaic-settings-fs-14);
      font-weight: var(--lbaic-settings-fw-400);
      color: var(--lbaic-settings-input-color);
      line-height: var(--lbaic-settings-lh-20);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      word-break: break-all;
    }

    &-delete {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
      padding: 0;
      background-color: transparent;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);

      &:hover:not(:disabled) {
        background-color: var(--lbaic-settings-button-bg-hover);
      }

      &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
      }

      &-icon {
        width: 16px;
        height: 16px;
        fill: var(--lbaic-settings-red);
        transition: fill 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      }
    }
  }
}
