{% scope_css %}

/* ========================================
   MODAL SEARCH - CONTAINER
   ======================================== */
.modal-search {
  width: 100%;
  max-width: 880px;
  height: 90vh;
  max-height: 900px;
  padding: 0;
  background-color: var(--base-white);
}

.search-modal-container{
  padding: 40px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ========================================
   SEARCH HEADER (Fixed at top)
   ======================================== */
.search-header {
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

.search-header::after {
  content: "";
  height: 20px;
  position: absolute;
  bottom: -20px;
  left: 0;
  background: linear-gradient(180deg,var(--base-white) 0%, var(--base-white) 60%, transparent 100%);
  width: 100%;
}
/* ========================================
   SEARCH INPUT WRAPPER
   ======================================== */
.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.search-input-container {
  flex: 1;
  position: relative;
}

.search-input-container::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image:  url("https://45498610.fs1.hubspotusercontent-na1.net/hubfs/45498610/Icons/blog/Search-1.svg");
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

#search_input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1px solid var(--neutral-200);
  border-radius: 100px;
  font-size: 16px;
  font-family: Poppins, sans-serif;
  color: var(--neutral-900);
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

#search_input::placeholder {
  color: var(--neutral-600) !important;
  font-weight: 400;
}

#search_input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(71, 164, 251, 0.1);
}

.reset-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--brand-600);
  color: var(--base-white);
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: Poppins, sans-serif;
}

.reset-button:hover {
  background-color: var(--brand-700);
}

.reset-button-image {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.search-close-button {
  background: none;
  border: none;
  color: var(--neutral-500);
  font-size: 28px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s ease;
  flex-shrink: 0;
  position: static;
}

.search-close-button:hover {
  color: var(--neutral-900);
}

/* ========================================
   TAGS SECTION (Horizontally scrollable)
   ======================================== */
.search-tags-wrappaer-container{
  position: relative;
  margin: -10px;
  padding: 10px;
}
.search-tags-wrappaer-container::before,
.search-tags-wrappaer-container::after {
  content: "";
  width: 10px;
  height: 100%;
  position: absolute;
  z-index: 1;
}
.search-tags-wrappaer-container::before {
  background: linear-gradient(-90deg, transparent, var(--base-white));
  left: -1px;
  top: 0;
}

.search-tags-wrappaer-container::after {
  background: linear-gradient(90deg, transparent, var(--base-white));
  right: -1px;
  top: 0;
}

.search-tags-wrapper {
  margin: -10px;
  padding: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.search-tags-wrapper::-webkit-scrollbar {
  height: 4px;
}

.search-tags-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--neutral-300);
  border-radius: 2px;
}

.search-tags-wrapper::-webkit-scrollbar-track {
  background-color: transparent;
}

.search-tags-container {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 100%;
}

/* ========================================
   RESULTS INFO
   ======================================== */
.results-info {
  margin-top: 16px;
  font-size: 14px;
  color: var(--neutral-600);
}

/* ========================================
   RESULTS CONTAINER (Scrollable)
   ======================================== */

.search-results-container::after {
  content: "";
  height: 20px;
  position: absolute;
  bottom: 36px;
  left: 0;
  background: linear-gradient(0deg,var(--base-white) 0%, var(--base-white) 60%, transparent 100%);
  width: 100%;
}

.search-results-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: -20px;
  padding-right: 20px;
  -webkit-overflow-scrolling: touch;
}

.search-results-container::-webkit-scrollbar {
  width: 6px;
}

.search-results-container::-webkit-scrollbar-thumb {
  background-color: var(--neutral-300);
  border-radius: 3px;
}

.search-results-container::-webkit-scrollbar-track {
  background-color: transparent;
}

/* ========================================
   SEARCH RESULT CARD
   ======================================== */
.search-result-card {
  display: flex;
  flex-direction: row;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--neutral-200);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.search-result-card:last-child {
  border-bottom: none;
}

.search-result-image {
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  border-radius: 12px;
  background-color: var(--neutral-100);
  overflow: hidden;
}

.search-result-image img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: all 0.2s ease;
}
.search-result-card:focus {
  outline: none !important;
  box-shadow: none !important;
}

.search-result-card:hover .search-result-image img,
.search-result-card:focus .search-result-image img {
  scale: 1.1;
}

.search-result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-result-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-date {
  font-size: 12px;
  color: var(--neutral-600);
  font-weight: 400;
}

.search-result-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--neutral-900);
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.search-result-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0;
}

.search-result-tag {
  background-color: var(--brand-50);
  color: var(--brand-600);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 12px;
  white-space: nowrap;
  text-decoration: none;
}

.search-result-tag:hover {
  background-color: var(--brand-600);
  color: var(--base-white);
}

.search-result-description, .search-result-description p {
  font-size: 14px !important;
  color: var(--neutral-600) !important;
  margin-block-start: 0 !important;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--neutral-600);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.search-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 40px 20px;
  text-align: center;
}

.search-empty-state p {
  font-size: 16px;
  color: var(--neutral-600);
  margin: 0;
}

/* ========================================
   RESPONSIVE - TABLET (max-width: 1024px)
   ======================================== */
@media screen and (max-width: 1024px) {
  .modal-search {
    width: 100%;
    max-width: 760px;
    height: 90vh;
    max-height: 672px;
    margin: 0 80px;
  }
  .search-modal-container{
    padding: 30px;
  }
  .search-results-container::after {
    bottom: 26px;
  }

  .search-result-card {
    gap: 16px;
  }
}

/* ========================================
   RESPONSIVE - MOBILE (max-width: 768px)
   ======================================== */
@media screen and (max-width: 768px) {
  .modal-search {
    width: calc(100% - 60px);
    height: 85vh;
  }

  .search-input-wrapper {
    gap: 8px;
    margin-bottom: 12px;
  }

  .results-info {
    margin-bottom: 12px;
  }

  .search-tag {
    padding: 6px 12px;
    font-size: 12px;
  }

  .search-result-card {
    gap: 12px;
    padding: 12px 0;
  }

  .search-result-description {
    font-size: 12px;
  }
}

/* ========================================
   RESPONSIVE - SMALL MOBILE (max-width: 480px)
   ======================================== */
@media screen and (max-width: 480px) {
  .search-modal-container{
    padding: 20px;
  }
  .search-results-container{
    margin-right: -10px;
    padding-right: 10px;
  }
  .search-results-container::after {
    bottom: 16px;
  }
  .search-header{
    padding-top: 42px;
  }
  .search-header::after {
    bottom: -10px;
  }
  .search-input-wrapper {
    flex-direction: column;
    gap: 12px;
  }

  .search-input-container {
    width: 100%;
  }
  #search_input{
    font-size: 14px;
  }

  .reset-button {
    width: 100%;
    justify-content: center;
    font-size: 14px;
  }

  .search-result-card {
    gap: 16px;
  }

  .search-result-image {
    width: 80px;
    height: 80px;
  }

  .search-result-title {
    font-size: 12px;
    font-weight: 400;
  }
  .search-result-description{
    display: none;
  }
  .search-close-button {
    position: absolute;
    right: 0px;
    top: 0px;
  }
}

{% end_scope_css %}
