/* ==========================================================================
   Spac2 - Next-Gen Acrylic Glassmorphism Search Engine Styles
   File: /data/search/search.css
   ========================================================================== */

/* Search Container Glow & Ambient Ring */
.search-bar-container {
  position: relative;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  z-index: 40;
}

.search-bar-container::before {
  display: none;
}

/* Search Form & Input Wrapper */
.search-form {
  width: 100%;
  position: relative;
  z-index: 1;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

/* Omni Search Input - Frosted Acrylic Glassmorphism */
.search-input {
  width: 100%;
  height: 68px;
  background: rgba(24, 24, 28, 0.55);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 0 110px 0 30px;
  color: #ffffff;
  font-size: 17px;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: -0.1px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-size: 16.5px;
  font-weight: 400;
  letter-spacing: -0.1px;
}

.search-input:hover {
  background: rgba(30, 30, 36, 0.68);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.search-input:focus {
  background: rgba(34, 34, 42, 0.78);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 255, 255, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

/* Clear Button */
.search-clear-btn {
  position: absolute;
  right: 66px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  border: none;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
  padding: 0;
}

.search-clear-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: scale(1.06);
}

.search-clear-btn:active {
  transform: scale(0.92);
}

.search-clear-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* Submit Circular Button - Frosted Translucent Minimalist Button */
.search-submit-btn {
  position: absolute;
  right: 8px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  z-index: 2;
  padding: 0;
}

.search-submit-btn svg {
  width: 22px;
  height: 22px;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.2;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.search-submit-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.30);
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.search-submit-btn:hover svg {
  stroke: #ffffff;
}

.search-submit-btn:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   Live Instant Search Suggestions Dropdown (Acrylic Glassmorphism)
   ========================================================================== */
.search-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: rgba(18, 18, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.88), 
              0 0 0 1px rgba(255, 255, 255, 0.04),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  z-index: 100;
  max-height: 440px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: searchDropdownIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.search-suggestions-dropdown::-webkit-scrollbar {
  width: 5px;
}

.search-suggestions-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
}

@keyframes searchDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Suggestions Dropdown Header / Category Count Bar */
.search-dropdown-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 6px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.search-dropdown-meta .search-meta-count {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

/* Individual Suggestion Item */
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 14px;
  color: #ffffff;
  text-decoration: none;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
  position: relative;
}

.suggestion-item:hover,
.suggestion-item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.suggestion-item.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Suggestion Icon Squircle */
.suggestion-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  position: relative;
}

.suggestion-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
  display: block;
}

.suggestion-icon svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  opacity: 0.85;
}

/* Suggestion Info Body */
.suggestion-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.suggestion-title {
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.1px;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Category Pill Badge */
.suggestion-cat-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
  flex-shrink: 0;
}

.suggestion-cat-badge.cat-workspace {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  border-color: rgba(255, 255, 255, 0.16);
}

.suggestion-cat-badge.cat-design {
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.2);
}

.suggestion-cat-badge.cat-music {
  background: rgba(168, 85, 247, 0.1);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.2);
}

.suggestion-cat-badge.cat-game {
  background: rgba(34, 197, 94, 0.1);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.2);
}

.suggestion-cat-badge.cat-ai {
  background: rgba(234, 179, 8, 0.1);
  color: #fde047;
  border-color: rgba(234, 179, 8, 0.2);
}

.suggestion-cat-badge.cat-tools {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}

/* Matched Term Highlight Marker */
.search-highlight {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 700;
  padding: 0 3px;
  border-radius: 4px;
  text-decoration: none;
}

/* Open Arrow Action Indicator */
.suggestion-arrow {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
  transition: transform 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}

.suggestion-item:hover .suggestion-arrow,
.suggestion-item.active .suggestion-arrow {
  color: #ffffff;
  transform: translateX(2px);
}

/* Fallback / Web Search Item */
.suggestion-item.web-search-item {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 2px;
  padding-top: 10px;
}

.suggestion-item.web-search-item .suggestion-icon {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.suggestion-item.web-search-item .suggestion-title {
  color: #ffffff;
}

/* Empty State Box */
.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
  gap: 6px;
}

.search-empty-icon {
  width: 36px;
  height: 36px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 4px;
}

.search-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.search-empty-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

@media (max-width: 640px) {
  .search-bar-container {
    width: 92%;
    max-width: 440px;
    margin: 0 auto;
  }

  .search-input {
    height: 58px;
    font-size: 16px;
    padding: 0 88px 0 24px;
    border-radius: 9999px;
  }
  
  .search-input::placeholder {
    font-size: 15px;
  }

  .search-submit-btn {
    width: 44px;
    height: 44px;
    right: 7px;
  }

  .search-submit-btn svg {
    width: 19px;
    height: 19px;
  }

  .search-clear-btn {
    right: 56px;
    width: 28px;
    height: 28px;
  }

  .search-clear-btn svg {
    width: 13px;
    height: 13px;
  }

  .search-suggestions-dropdown {
    border-radius: 20px;
    margin-top: 8px;
    max-height: 320px;
  }

  .suggestion-item {
    padding: 8px 10px;
    gap: 10px;
  }

  .suggestion-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }
}

/* ==========================================================================
   Standard History & Trending Suggestions Dropdown (Cốc Cốc / Google Style)
   ========================================================================== */
.search-suggestions-dropdown.modern-dropdown {
  padding: 8px 0;
  gap: 0;
  background: rgba(36, 36, 36, 0.98);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.search-suggestions-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-radius: 0;
  border: none;
}

.search-suggestions-dropdown .dropdown-item:hover,
.search-suggestions-dropdown .dropdown-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.search-suggestions-dropdown .dropdown-item-icon,
.dropdown-item-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  max-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
  border-radius: 5px;
  overflow: hidden;
}

.search-suggestions-dropdown .dropdown-item-icon img,
.dropdown-item-icon img,
.dropdown-icon-img {
  width: 20px;
  height: 20px;
  max-width: 20px;
  max-height: 20px;
  border-radius: 5px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.search-suggestions-dropdown .dropdown-item-icon svg,
.dropdown-item-icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.search-suggestions-dropdown .dropdown-item:hover .dropdown-item-icon,
.search-suggestions-dropdown .dropdown-item.active .dropdown-item-icon {
  color: rgba(255, 255, 255, 0.85);
}

.search-suggestions-dropdown .dropdown-item-text {
  font-size: 14.5px;
  font-weight: 400;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

.search-suggestions-dropdown .dropdown-item-remove {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.32);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.search-suggestions-dropdown .dropdown-item-remove:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: scale(1.1);
}

.search-suggestions-dropdown .dropdown-section-header {
  padding: 12px 20px 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: -0.1px;
  user-select: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
}

.search-suggestions-dropdown .dropdown-section-header:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 6px;
}


.search-suggestions-dropdown .dropdown-section-header.recommendation-header,
.dropdown-section-header.recommendation-header {
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 8px;
  padding-top: 10px;
}

.search-suggestions-dropdown .dropdown-section-header.recommendation-header svg {
  flex-shrink: 0;
}

.search-suggestions-dropdown .dropdown-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-suggestions-dropdown .dropdown-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.search-suggestions-dropdown .dropdown-item-meta {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.1px;
}

.search-suggestions-dropdown .dropdown-tag-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 7px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  flex-shrink: 0;
}

.search-suggestions-dropdown .dropdown-tag-badge.recommendation-pill,
.dropdown-tag-badge.recommendation-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.search-suggestions-dropdown .dropdown-item.is-recommendation,
.dropdown-item.is-recommendation {
  background: rgba(255, 255, 255, 0.04);
}

.search-suggestions-dropdown .dropdown-item.is-recommendation:hover,
.search-suggestions-dropdown .dropdown-item.is-recommendation.active,
.dropdown-item.is-recommendation:hover,
.dropdown-item.is-recommendation.active {
  background: rgba(255, 255, 255, 0.1);
}
