.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: 2px;
  border: 1px solid var(--black_50);
  border-radius: 4px;
  box-shadow: 0 3px 4px 0 rgb(4 73 89 / 6%);
  padding: 20px 25px;
  top: 45px;
  overflow-y: auto;
  max-height: 90vh;
  &::before{
    content: "";
    width: 12px;
    height: 12px;
    background: var(--bs-white);
    position: absolute;
    top: -6px;
    transform: rotate(45deg);
    left: 40px;
    border-left: 1px solid var(--black_50);
    border-top: 1px solid var(--black_50);
  }
  .searchbar-tabs {
    padding: 0 10px 15px 0;
  }
  a {
    text-decoration: none;
  }
  &.ajax-search {
    display: block;
  }
  .not-found-text,
  .bbpc-not-found-text {
    display: none;
    font-weight: 700;
    font-size: 20px;
    margin: 12px 0 5px;
    letter-spacing: 0.1px;
  }
}

.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: #02010136;
        font-size: 14px;
        text-transform: capitalize;
        padding: 4px 12px;
        border-radius: 15px;
        font-weight: 400;
        text-decoration: none !important;
      }
    }
  }
}

.bbpc_search_form_wrapper {
  position: relative;

  .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;
      border: 1.5px solid var(--black_50);
      background: var(--bs-white);
      font-size: 15px;
      color: #444;
      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;
      }
    }
  }

  .search-result-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    width: 100%;
    flex: 100%;
    transition: all 0.3s;
    a {
      color: var(--p_color);
    }
    &:hover {
      background: rgb(143 187 237 / 10%);
    }
  }

  /* 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;
  }
}

body {
  &.body_dark {
    input.frmx-search-input.input_focused {
      background: #fff;
    }
    .not-found-text, .bbpc-not-found-text {
      color: black;
    }
  }
}

/** === 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;
		}
	}
}