/* ==============================
   CoreTech Search Overlay - Final Fixed Version
   ============================== */

.coretech-search-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.28s ease;
  opacity: 0;
  pointer-events: none;
}

.coretech-search-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

/* پس‌زمینه تار هنگام باز بودن */
.coretech-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

/* باکس اصلی جستجو */
.coretech-search-box {
  position: relative;
  z-index: 2;
  width: 92%;
  max-width: 760px;
  background: rgba(30,30,30,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.55);
}

/* دکمه بستن */
.coretech-close-search {
  position: absolute;
  top: 10px;
  left: 12px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* ورودی جستجو */
.coretech-search-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease;
}
.coretech-search-input:focus {
  border-color: var(--color-accent, #e00);
}

/* ناحیه نتایج */
.coretech-search-results {
  margin-top: 14px;
  max-height: 420px;
  overflow-y: auto;
}

/* =============================
   استایل نتایج — مشابه آخرین نوشته‌ها در دسکتاپ
   ============================= */
.coretech-search-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  align-items: center;
  border-radius: 6px;
  transition: background 0.2s ease;
}
.coretech-search-item:hover {
  background: rgba(255,255,255,0.05);
}

.coretech-search-item .thumb {
  flex: 0 0 110px;
  width: 110px;
  height: 72px;
  overflow: hidden;
  border-radius: 6px;
}
.coretech-search-item .thumb img {
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius: 6px;
}

/* متن‌ها */
.coretech-search-item .meta {
  text-align: right;
  flex: 1;
}
.coretech-search-item .meta .title {
  font-weight:600;
  color:var(--ct-text, #eee);
  margin:0 0 6px 0;
  line-height:1.4;
}
.coretech-search-item .meta .sub {
  font-size:13px;
  color:rgba(255,255,255,0.6);
  display:none; /* حذف زمان انتشار */
}

/* =============================
   حالت موبایل — شبیه آخرین نوشته‌های موبایل
   ============================= */
@media (max-width: 768px) {
  .coretech-search-results {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .coretech-search-item {
    flex-direction: column;
    align-items: center;
    border: none;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px;
  }

  .coretech-search-item .thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
  }

  .coretech-search-item .meta {
    text-align: center;
    margin-top: 8px;
  }

  .coretech-search-item .meta .title {
    font-size: 15px;
  }

  .coretech-search-item .meta .sub {
    display: none; /* عدم نمایش زمان */
  }

  .coretech-search-input {
    text-align: center;
  }
}

/* =============================
   رفع پس‌زمینه سفید در SVG ویجت سرچ
   ============================= */
.coretech-search-widget .search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  cursor: pointer;
  color: var(--ct-text, #eee);
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.coretech-search-widget .search-icon svg {
  width: 100%;
  height: 100%;
  background: none !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  border: none !important;
  border-radius: 0 !important;
  display: block !important;
  pointer-events: none;
  transition: transform 0.2s ease, color 0.2s ease;
}

.coretech-search-widget .search-icon:hover svg {
  transform: scale(1.08);
  color: var(--color-accent, #ff4747);
}