/* ==========================================================
   EKOR Search UI 3.0
   Search Results
========================================================== */

/* ==========================================================
   Root
========================================================== */

.search-results {
  display: flex;

  flex-direction: column;

  gap: 10px;

  padding: 8px;

  overflow-y: auto;
}

/* ==========================================================
   Result Card
========================================================== */

.search-result {
  position: relative;

  display: flex;

  align-items: flex-start;

  gap: 14px;

  padding: 14px 18px;

  border-radius: 14px;

  cursor: pointer;

  overflow: hidden;

  background: rgba(255, 255, 255, 0.02);

  border: 1px solid rgba(255, 255, 255, 0.035);

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    opacity 0.18s ease;

  animation: searchFade 0.18s ease;
}

/* ==========================================================
   Hover
========================================================== */

.search-result:hover {
  background: rgba(255, 255, 255, 0.055);

  border-color: rgba(255, 255, 255, 0.08);

  transform: translateX(3px);

  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

/* ==========================================================
   Active Result
========================================================== */

.search-result.active {
  background: linear-gradient(
    90deg,
    rgba(241, 101, 32, 0.15) 0%,

    rgba(241, 101, 32, 0.05) 100%
  );

  box-shadow:
    inset 4px 0 0 var(--theme-orange-hover),
    0 8px 20px rgba(0, 0, 0, 0.18);
}

/* ==========================================================
   Focus
========================================================== */

.search-result:focus-visible {
  outline: none;

  box-shadow:
    inset 4px 0 0 var(--theme-orange-hover),
    0 0 0 2px rgba(241, 101, 32, 0.35);
}

/* ==========================================================
   Result Body
========================================================== */

.search-result__content {
  flex: 1;

  min-width: 0;

  display: flex;

  flex-direction: column;

  gap: 8px;
}

/* ==========================================================
   Header
========================================================== */

.search-result__header {
  display: flex;

  justify-content: space-between;

  align-items: flex-start;

  gap: 14px;
}

/* ==========================================================
   Body
========================================================== */

.search-result__body {
  display: flex;

  flex-direction: column;

  gap: 8px;
}

/* ==========================================================
   Fade Animation
========================================================== */

@keyframes searchFade {
  from {
    opacity: 0;

    transform: translateY(6px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* ==========================================================
   Search Result Icon
========================================================== */

.search-result__icon {
  width: 44px;

  height: 44px;

  flex-shrink: 0;

  display: flex;

  align-items: center;

  justify-content: center;

  border-radius: 14px;

  background: linear-gradient(135deg, rgba(241, 101, 32, 0.18), rgba(241, 101, 32, 0.06));

  color: var(--theme-orange-hover);

  font-size: 18px;

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.search-result:hover .search-result__icon {
  transform: scale(1.08);
}

.search-result.active .search-result__icon {
  background: var(--theme-orange-hover);

  color: #fff;
}

/* ==========================================================
   Title
========================================================== */

.search-result__title {
  font-size: 15px;

  font-weight: 700;

  line-height: 1.35;

  color: #f7f9fa;

  overflow: hidden;

  text-overflow: ellipsis;

  white-space: nowrap;
}

/* ==========================================================
   Snippet
========================================================== */

.search-result__snippet {
  font-size: 0.82rem;

  line-height: 1.55;

  color: rgba(255, 255, 255, 0.7);

  overflow: hidden;

  display: -webkit-box;

  -webkit-line-clamp: 2;

  -webkit-box-orient: vertical;
}

/* ==========================================================
   Category Badge
========================================================== */

.search-result__category {
  flex-shrink: 0;

  padding: 4px 10px;

  border-radius: 999px;

  font-size: 10px;

  font-weight: 600;

  letter-spacing: 0.35px;

  color: rgba(255, 255, 255, 0.6);

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid rgba(255, 255, 255, 0.05);

  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.search-result:hover .search-result__category {
  background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================
   Highlight
========================================================== */

.search-result mark {
  background: rgba(241, 101, 32, 0.95);

  color: #fff;

  padding: 2px 5px;

  border-radius: 4px;

  font-weight: 700;
}

/* ==========================================================
   Typography Polish
========================================================== */

.search-result__title,
.search-result__snippet {
  word-break: break-word;
}

.search-result__snippet strong {
  color: #fff;

  font-weight: 600;
}

/* ==========================================================
   Empty State
========================================================== */

.search-empty {
  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  gap: 12px;

  padding: 48px 24px;

  text-align: center;

  color: rgba(255, 255, 255, 0.65);
}

.search-empty i {
  font-size: 42px;

  color: rgba(241, 101, 32, 0.9);
}

.search-empty p {
  margin: 0;

  font-size: 15px;

  line-height: 1.5;
}

.search-empty small {
  display: block;

  margin-top: 8px;

  font-size: 13px;

  color: rgba(255, 255, 255, 0.45);
}

/* ==========================================================
   Scrollbar
========================================================== */

.search-results::-webkit-scrollbar {
  width: 8px;
}

.search-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);

  border-radius: 20px;
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ==========================================================
   Responsive
========================================================== */

@media (max-width: 768px) {
  .search-result {
    padding: 12px 14px;

    gap: 12px;
  }

  .search-result__icon {
    width: 38px;

    height: 38px;

    font-size: 16px;
  }

  .search-result__title {
    font-size: 14px;
  }

  .search-result__snippet {
    font-size: 0.78rem;

    -webkit-line-clamp: 2;
  }

  .search-result__category {
    display: none;
  }
}

/* ==========================================================
   Motion
========================================================== */

@media (prefers-reduced-motion: reduce) {
  .search-result {
    animation: none;

    transition: none;
  }
}
