.ama-search-widget {
  position: relative;
  margin-left: auto;
  margin-right: auto;

  .header_search_keyword {
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-weight: 500;
    justify-content: center;
    margin-top: 10px;

    span {
      font-size: 14px;
      margin-right: 10px;
    }

    ul {
      margin: 0;

      li {
        display: inline-block;
        margin: 0 3px 0;

        a {
          display: block;
          font-size: 13px;
          padding: 0 19px;
          border-radius: 45px;
          background: var(--bbpc_color);
          color: #fff;
          font-weight: normal;

          &.header-search-form__keywords-label {
            color: var(--black_800);
          }
        }
      }
    }
  }

  .search-box {
    z-index: 99;
    position: relative;

    svg {
      position: absolute;
      right: 8px;
      top: 49.59999%;
      transform: translateY(-50%);
      line-height: 22px;
      padding: 10px;
      border-radius: 4px;
      border-left-color: transparent;
      box-sizing: border-box;
      color: var(--bbpc_brand_color);
    }

    input.frmx-search-input {
      border: 0 solid transparent;
      box-shadow: none;
    }

    input {
      width: 100%;
      border-radius: 4px;
      line-height: 35px;
      text-indent: 15px;
      padding-right: 43px;
    }

    .frmx-search-input + .spinner {
      position: absolute;
      right: 45px;
      top: 50% !important;
      transform: translateY(-50%);
      display: none;
      z-index: 999;
      color: var(--bbpc_brand_color);
      line-height: 0;

      .frmx-spinner-icon {
        animation: frmx-search-spin 0.75s linear infinite;
      }
    }
  }

  .elementor {
    img {
      height: auto;
      max-width: 100%;
      border: none;
      border-radius: 0;
      -webkit-box-shadow: none;
      box-shadow: none;
    }
  }
}

ul.list-unstyled {
  padding-left: 0;
}

.ama-search-keyword-wrapper .header_search_keyword ul li a {
  color: var(--black_600);
  background: var(--black_50);
  font-weight: normal;
}

/* ------- Forum & Search -------- */
.single-forum-post-widget{
  .post-category{
    img {
      width: 15px;
      height: auto;
    }
  }
}

.single-filter-item {
  a {
    color: var(--black_600);
  }
}

/** === Doc search form result === **/
.bbpc-search-result-container {
  position: absolute;
  width: 100%;
  background: var(--bs-white);
  font-size: 14px;
  font-weight: 400;
  display: none;
  transition: all 0.4s;
  margin-top: 0;
  border: 1px solid var(--black_50);
  border-top: none;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 16px 0 rgb(4 73 89 / 10%);
  padding: 0;
  /* Tuck flush under the input (~48px tall) so the two read as one card. */
  top: 47px;
  overflow-y: auto;
  max-height: 90vh;

  /* Slim custom scrollbar (EazyDocs-style). */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
  &::-webkit-scrollbar {
    width: 8px;
  }
  &::-webkit-scrollbar-track {
    background: transparent;
  }
  &::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
  }
  &::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
  }

  .searchbar-tabs {
    padding: 0 10px 15px 0;
  }
  a {
    text-decoration: none;
  }
  &.ajax-search {
    display: block;
  }
  /* Result type tabs (All / Forums / Topics / Replies) — EazyDocs-style. */
  .bbpc-result-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--black_50);

    .bbpc-tab {
      background: transparent;
      border: none;
      padding: 5px 14px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 500;
      color: #5f6368;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
      line-height: 1.5;

      &.active {
        background: #e8f0fe;
        color: #1a73e8;
      }

      &:hover:not(.active) {
        background: #f1f3f4;
        color: #202124;
      }
    }
  }
  .bbpc-not-found-text {
    display: block;
    font-weight: 700;
    font-size: 20px;
    margin: 0;
    padding: 28px 16px;
    letter-spacing: 0.1px;
    text-align: center;
  }
}

.search-results-tab {
  .bbpc-search-title {
    font-size: 16px;
    color: var(--black_600);
    display: block;
    border-bottom: 1px solid var(--black_50);
    font-weight: 500;
    text-align: left;
    padding-left: 8px;
    margin: 12px 0 0;
    padding-bottom: 8px;
    text-transform: capitalize;
  }
}

/*
 keywords
 */
.bbpc-search-keyword {
  display: block;
  text-align: center;
  margin: 15px 0 5px;
  &.left {
    text-align: left;
  }
  &.right {
    text-align: right;
  }
  ul {
    list-style: none;
    margin: 0 2px;
    padding: 0;
    display: inline-block;
    li {
      list-style: none;
      margin: 0 2px;
      padding: 0;
      display: inline-block;
      a {
        color: #fff;
        background: #000;
        font-size: 14px;
        text-transform: capitalize;
        padding: 4px 12px;
        border-radius: 15px;
        font-weight: 400;
        text-decoration: none !important;
        &:hover{
          background: #979393;
        }
      }
    }
  }
}

.bbpc_search_form_wrapper {
  position: relative;

  /* Only while the results box is actually visible, flatten the input's bottom
     edge so the two read as one connected card. Driven off the box's own
     `.ajax-search` state via :has(), so it can never get stuck open. */
  &:has(.bbpc-search-result-container.ajax-search) {
    .input-wrapper input[type="search"],
    .input-wrapper input.frmx-search-input,
    .input-wrapper input[type="search"]:focus,
    .input-wrapper input.frmx-search-input:focus {
      /* Drop the pill to a 16px top + flat bottom so it joins the box. */
      border-top-left-radius: 16px;
      border-top-right-radius: 16px;
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
      /* Match the results box border (neutral) instead of the blue focus
         colour, so the joined card has one consistent edge. */
      border-color: var(--black_50);
      border-bottom-color: transparent;
      box-shadow: none;
    }
  }

  .input-wrapper {
    position: relative;

    /* Pill-shaped wrapper — mirrors the second reference design. */
    input[type="search"],
    input.frmx-search-input {
      width: 100%;
      height: 48px;
      padding: 0 44px 0 48px; /* left space for icon, right space for clear btn */
      border-radius: 50px; /* pill while closed; squared/16px top when results open */
      border: 1.5px solid var(--black_50);
      background: var(--bs-white);
      font-size: 15px;
      color: var(--black_600);
      outline: none;
      transition: border-color 0.2s, box-shadow 0.2s;
      box-shadow: none;
      -webkit-appearance: none;

      &::placeholder {
        color: #aaa;
      }

      &:focus {
        border-color: var(--bbpc_brand_color, #1a73e8);
        box-shadow: 0 0 0 3px rgb(26 115 232 / 10%);
      }

      /* Native clear (×) button — keep it inside the pill. */
      &::-webkit-search-cancel-button {
        -webkit-appearance: auto;
        margin-right: 10px;
        cursor: pointer;
        opacity: 0.5;
        &:hover { opacity: 1; }
      }
    }

    /* Spinner sits just before the clear button. */
    .spinner {
      position: absolute;
      right: 40px;
      top: 50%;
      transform: translateY(-50%);
      display: none;
      z-index: 999;
      align-items: center;
      justify-content: center;
      color: var(--bbpc_brand_color, #1a73e8);
      line-height: 0;

      &.show {
        display: inline-flex;
      }

      .frmx-spinner-icon {
        animation: frmx-search-spin 0.75s linear infinite;
      }
    }

    /* Submit button — always positioned absolute inside the pill. */
    .submit-btn-left,
    .submit-btn-right {
      position: absolute;
      top: 0;
      bottom: 0;
      display: flex;
      align-items: center;
      margin: auto;
      z-index: 2;
    }

    /* Icon on the LEFT side (default / submit_btn_align = right → button on left). */
    .submit-btn-left {
      left: 24px;
    }

    /* Icon on the RIGHT side. */
    .submit-btn-right {
      right: 14px;
    }

    /* When icon is on the RIGHT — flip padding so text has left space instead. */
    &.right input[type="search"],
    &.right input.frmx-search-input {
      padding-left: 18px;
      padding-right: 52px;
    }

    button {
      background: transparent;
      border: none;
      outline: none;
      cursor: pointer;
      padding: 0;
      margin: 0;
      color: var(--bbpc_brand_color, #1a73e8); /* blue icon — matches design */
      line-height: 0;

      i, svg {
        font-size: 18px;
        width: 1em;
        height: 1em;
        fill: currentColor;
        display: block;
      }
    }
  }

  /* Result group label — e.g. "REPLIES", "TOPICS" (EazyDocs-style). */
  .bbpc-result-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #bdc1c6;
    padding: 8px 16px 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .search-result-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border-bottom: 1px solid var(--black_50);
    transition: background 0.15s;
    cursor: pointer;

    &:last-of-type {
      border-bottom: none;
    }

    .bbpc-result-link {
      display: flex;
      align-items: center;
      gap: 12px;
      color: inherit;
      text-decoration: none;
    }

    .bbpc-result-icon {
      width: 20px;
      height: 20px;
      flex-shrink: 0;
      color: #9aa0a6;
    }

    .bbpc-result-body {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-width: 0;
    }

    .bbpc-result-title {
      font-size: 14px;
      font-weight: 500;
      color: #202124;
      line-height: 1.4;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .bbpc-result-type {
      margin-top: 3px;
      font-size: 12px;
      font-weight: 400;
      color: #70757a;
    }

    /* Ancestor breadcrumb (Forum › Topic), aligned under the title text. */
    .bbpc-result-breadcrumb {
      display: flex;
      flex-wrap: wrap;
      list-style: none;
      margin: 4px 0 0;
      padding: 0 0 0 32px;

      .bbpc-breadcrumb-item {
        font-size: 12px;
        color: #70757a;

        & + .bbpc-breadcrumb-item::before {
          content: "\203A";
          color: #b7b9be;
          padding: 0 5px;
        }
      }
    }

    &:hover {
      background: rgb(143 187 237 / 10%);

      .bbpc-result-title {
        color: #1a73e8;
      }
    }
  }

  /* Search keyword highlight styling. */
  .frmx-search-highlight {
    background-color: #fff3cd;
    color: inherit;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
  }
}

.searchbar-tabs {
  .tab-item {
    font-size: 14px;
    font-weight: 500;
    padding: 11px 8px;
    margin-right: 20px;
    border: none;
    background: 0 0;
    color: var(--black_400);
    text-transform: capitalize;
    cursor: pointer;
    &.active {
      color: var(--bbpc_brand_color);
      border-bottom: 3px solid var(--bbpc_brand_color);
    }
    &:hover{
      text-decoration: none;
      outline: none;
    }
    &:focus{
      text-decoration: none;
      outline: none;
    }
  }
}

.forum-card {
  .forum-card-thumbnail-area {
    padding: 0 !important;
  }
}



/** === Focus Search Form === **/
body.bbpc-search-open {
  opacity: 1;
  visibility: visible;
}

body:not(.bbpc-search-open) .bbpc-search-result-container.ajax-search {
  display: none;
}

.bbpc-search-overlay{
  &.active {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 40%); /* Semi-transparent black overlay */
    justify-content: center;
    align-items: center;
    z-index: 99;
    transition: 0.3s all;
  }
}

/* Spin animation for search spinner. */
@keyframes frmx-search-spin {
  to {
    transform: rotate(360deg);
  }
}

.elementor-widget-container{
	.more-communities{
		margin-top:0px !important;
	}
	.community-topic-widget-box{
		img{
			height:48px!important;
		}
	}
}