/**
 * Live Search Module Styles
 * 
 * Chỉ style cho phần live search results, KHÔNG thay đổi search box
 * Dựa trên mobile search extracted styles
 * 
 * FEATURES:
 * - Live search results styling
 * - Vietnamese text support  
 * - Mobile optimization
 * - Touch-friendly design
 */

/* ================================
   SEARCH CONTAINER
   ================================ */

.custom-header__search {
  position: relative;
}

/* ================================
   LIVE SEARCH RESULTS CONTAINER
   ================================ */

.live-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  margin-top: 8px;
  max-height: 400px;
  overflow: hidden;
  z-index: 9999;
  width: 100%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
}

.live-search-results.show {
  display: block;
}

.live-search-results.hidden {
  display: none;
}

/* ================================
   LOADING STATE
   ================================ */

.live-search-results .loading {
  padding: 24px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.live-search-results .loading.hidden {
  display: none;
}

.live-search-results .loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.live-search-results .loading-spinner i {
  color: var(--primary-color);
}

/* ================================
   NO RESULTS STATE
   ================================ */

.live-search-results .no-results {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  background: var(--gray-50);
  border-radius: 0.75rem;
  margin: 8px;
}

.live-search-results .no-results.hidden {
  display: none;
}

/* ================================
   SEARCH RESULTS LIST
   ================================ */

.live-search-results .results {
  max-height: 400px;
  overflow-y: auto;
  padding: 6px;
}

/* Custom scrollbar */
.live-search-results .results::-webkit-scrollbar {
  width: 4px;
}

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

.live-search-results .results::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 2px;
}

.live-search-results .results::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ================================
   SEARCH RESULT ITEMS
   ================================ */

.live-search-results .results > div {
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0.5rem;
  margin-bottom: 2px;
}

.live-search-results .results > div:last-child {
  border-bottom: none;
}

.live-search-results .results a {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0.5rem;
}

.live-search-results .results > div:hover {
  background-color: var(--gray-50);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.live-search-results .results a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  background-color: var(--primary-s-light);
}

/* ================================
   SEARCH RESULT CONTENT LAYOUT
   ================================ */

.live-search-results .flex {
  display: flex;
}

.live-search-results .items-start {
  align-items: flex-start;
}

.live-search-results .items-center {
  align-items: center;
}

.live-search-results .justify-between {
  justify-content: space-between;
}

.live-search-results .space-x-3 > * + * {
  margin-left: 0.75rem;
}

.live-search-results .space-x-2 > * + * {
  margin-left: 0.5rem;
}

.live-search-results .flex-1 {
  flex: 1 1 0%;
}

.live-search-results .flex-shrink-0 {
  flex-shrink: 0;
}

.live-search-results .min-w-0 {
  min-width: 0;
}

.live-search-results .flex-wrap {
  flex-wrap: wrap;
}

/* ================================
   IMAGES AND THUMBNAILS
   ================================ */

.live-search-results .w-10 {
  width: 2.5rem;
}

.live-search-results .h-10 {
  height: 2.5rem;
}

.live-search-results .w-4 {
  width: 1rem;
}

.live-search-results .h-4 {
  height: 1rem;
}

.live-search-results .w-3 {
  width: 0.75rem;
}

.live-search-results .h-3 {
  height: 0.75rem;
}

.live-search-results .object-cover {
  object-fit: cover;
}

.live-search-results .rounded-md {
  border-radius: 0.375rem;
}

.live-search-results .rounded {
  border-radius: 0.25rem;
}

.live-search-results .rounded-full {
  border-radius: 0.75rem;
}

.live-search-results .shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* ================================
   BORDERS AND SPACING
   ================================ */

.live-search-results .border {
  border-width: 1px;
}

.live-search-results .border-b {
  border-bottom-width: 0;
}

.live-search-results .border-gray-200 {
  border-color: var(--gray-200);
}

.live-search-results .border-gray-100 {
  border-color: var(--gray-100);
}

.live-search-results .last\:border-b-0:last-child {
  border-bottom-width: 0;
}

.live-search-results .p-3 {
  padding: 0.5rem 1rem;
}

.live-search-results .px-1 {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.live-search-results .py-0\.5 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.live-search-results .px-2 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.live-search-results .mb-1 {
  margin-bottom: 0.25rem;
}

.live-search-results .mt-1 {
  margin-top: 0.25rem;
}

.live-search-results .mt-2 {
  margin-top: 0.5rem;
}

.live-search-results .ml-2 {
  margin-left: 0.5rem;
}

/* ================================
   TYPOGRAPHY
   ================================ */

.live-search-results .text-sm {
  font-size: var(--font-size-xs);
  line-height: var(--line-height-tight);
  font-family: var(--font-primary);
}

.live-search-results .text-xs {
  font-size: 9px;
  line-height: var(--line-height-tight);
  font-family: var(--font-primary);
}

.live-search-results .font-semibold {
  font-weight: var(--font-weight-semibold);
}

.live-search-results .font-medium {
  font-weight: var(--font-weight-medium);
}

.live-search-results .leading-5 {
  line-height: 1.25rem;
}

.live-search-results .line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 2;
}

/* ================================
   COLORS
   ================================ */

/* Text colors */
.live-search-results .text-gray-900 {
  color: var(--text-primary);
  margin-bottom: var(--spacing-sx);
}

.live-search-results .text-gray-500 {
  color: var(--text-secondary);
}

.live-search-results .text-gray-400 {
  color: var(--gray-400);
}

.live-search-results .text-blue-600 {
  color: var(--primary-color);
}

.live-search-results .text-green-600 {
  color: var(--success);
}

/* Background colors */

.live-search-results .bg-blue-100 {
  background-color: var(--primary-s-light);
}

.live-search-results .bg-green-100 {
  background-color: #dcfce7;
}

.live-search-results .bg-gray-100 {
  background-color: var(--gray-100);
}

.live-search-results .bg-gray-200 {
  background-color: var(--gray-200);
}

.live-search-results .bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.live-search-results .from-gray-100 {
  --tw-gradient-from: var(--gray-100);
  --tw-gradient-stops: var(--tw-gradient-from),
    var(--tw-gradient-to, rgba(243, 244, 246, 0));
}

.live-search-results .to-gray-200 {
  --tw-gradient-to: var(--gray-200);
}

/* Hover colors */
.live-search-results .group:hover .group-hover\:text-blue-600 {
  color: var(--primary-color);
}

.live-search-results .hover\:bg-gray-50:hover {
  background-color: var(--gray-50);
}

/* ================================
   TRANSITIONS AND ANIMATIONS
   ================================ */

.live-search-results .transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.live-search-results .transition-colors {
  transition-property: color, background-color, border-color,
    text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.live-search-results .duration-200 {
  transition-duration: 200ms;
}

/* ================================
   SEARCH HIGHLIGHTING
   ================================ */

.live-search-results mark {
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 0.375rem;
  font-weight: var(--font-weight-semibold);
  font-size: 0.9em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  letter-spacing: var(--letter-spacing-tight);
}

.live-search-results .group:hover mark {
  background: var(--primary-color);
  color: var(--white);
  transform: scale(1.05);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

/* Mobile devices */
@media (max-width: 640px) {
  .live-search-results {
    max-height: 320px;
    margin-top: 8px;
    border-radius: 0.75rem;
  }

  .live-search-results .results {
    max-height: 320px;
    padding: 4px;
  }

  .live-search-results .p-3 {
    padding: 0.875rem;
  }

  .live-search-results .text-sm {
    font-size: var(--font-size-sm);
  }

  .live-search-results .text-xs {
    font-size: 9px;
  }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1023px) {
  .live-search-results {
    max-height: 380px;
    border-radius: 0.75rem;
  }

  .live-search-results .results {
    max-height: 380px;
  }
}

/* ================================
   TOUCH DEVICE OPTIMIZATIONS
   ================================ */

.touch-device .live-search-results .results a {
  min-height: 3.5rem;
  padding: 1rem;
}

.touch-device .live-search-results .p-3 {
  padding: 1.125rem;
}

/* ================================
   ACCESSIBILITY
   ================================ */

.live-search-results .results a:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .live-search-results {
    border-width: 2px;
    border-color: var(--black);
  }

  .live-search-results mark {
    background: var(--warning);
    color: var(--black);
    outline: 1px solid var(--black);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .live-search-results,
  .live-search-results .results > div,
  .live-search-results .results a {
    transition: none;
  }
}

/* Light mode - always use light theme */
.live-search-results {
  background: var(--white) !important;
  border-color: var(--gray-200) !important;
}

.live-search-results .results > div:hover {
  background-color: var(--gray-50) !important;
}

.live-search-results .text-gray-900 {
  color: var(--text-primary) !important;
}

.live-search-results .text-gray-500 {
  color: var(--text-secondary) !important;
}

.live-search-results .loading,
.live-search-results .no-results {
  color: var(--text-secondary) !important;
}

/* Utility classes */
.hidden {
  display: none !important;
}
