.hlm-search-wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hlm-search-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("https://storage.cloud.google.com/graphic_design_storage/images/Daguanyuan.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.7; /* Increased opacity for the background image */
  z-index: -2;
}

.hlm-search-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4); /* Darker overlay */
  z-index: -1;
}

.hlm-search-centered {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 650px;
  padding: 0 20px;
}

.hlm-search-field-container {
  position: relative;
  margin-bottom: 15px;
  width: 100%;
  max-width: 800px;
}

#hlm-search-input {
  width: 100%;
  padding: 18px 45px 18px 20px;
  font-size: 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  background-color: rgba(255, 255, 255, 0.95);
  margin: 0 auto;
  display: block;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

#hlm-search-input:focus {
  outline: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.hlm-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 50%;
}

.hlm-search-icon:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateY(-50%) scale(1.1);
}

.hlm-search-icon:active {
  transform: translateY(-50%) scale(0.95);
}

.hlm-search-history-container {
  display: flex;
  justify-content: center;
  gap: 15px; /* Add space between buttons */
  width: 100%;
  margin-top: 20px; /* Add some space below the search input */
}

/* Base styles for both buttons */
.hlm-button {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 8px 22px; /* Reduced padding */
  border-radius: 20px; /* Slightly smaller radius */
  cursor: pointer;
  font-size: 15px; /* Slightly smaller font */
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  text-decoration: none; /* Remove underline from link */
  color: #333; /* Set default text color */
  display: inline-block; /* Ensure proper sizing and alignment */
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Hover effect for both buttons */
.hlm-button:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  color: #000; /* Darken text on hover */
}

/* Active effect for both buttons */
.hlm-button:active {
  transform: translateY(1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Optional: Shine effect on hover for both buttons */
.hlm-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.7s;
}

.hlm-button:hover::before {
  left: 100%;
}

/* Specific class for history button (inherits from .hlm-button) */
.hlm-search-history-btn {
  /* No specific styles needed currently, inherits all from .hlm-button */
  /* margin-top: 15px; Removed, margin handled by container */
}

/* Specific class for advanced search button (inherits from .hlm-button) */
.hlm-advanced-search-btn {
  /* No specific styles needed currently, inherits all from .hlm-button */
}

.hlm-search-history-dropdown {
  position: absolute;
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
  margin-top: 55px;
  z-index: 100;
  max-height: 250px;
  overflow-y: auto;
  width: 100%;
  max-width: 610px;
  backdrop-filter: blur(5px);
  background-color: rgba(255, 255, 255, 0.95);
  padding: 5px 0;
}

.hlm-search-history-dropdown ul {
  list-style: none;
  padding: 5px 0;
  margin: 0;
}

.hlm-search-history-dropdown li {
  padding: 10px 20px;
  border-bottom: 1px solid rgba(240, 240, 240, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hlm-search-history-dropdown li:hover {
  background: rgba(248, 248, 248, 0.8);
  transform: translateX(5px);
}

.hlm-search-history-dropdown li:last-child {
  border-bottom: none;
}

.hlm-search-history-dropdown::-webkit-scrollbar {
  width: 8px;
}

.hlm-search-history-dropdown::-webkit-scrollbar-track {
  background: rgba(240, 240, 240, 0.3);
  border-radius: 10px;
}

.hlm-search-history-dropdown::-webkit-scrollbar-thumb {
  background: rgba(180, 180, 180, 0.5);
  border-radius: 10px;
}

.hlm-search-history-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.8);
}

/* Scroll indicator at bottom */
.hlm-scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  animation: bounce 2s infinite;
  cursor: pointer;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-20px) translateX(-50%);
  }
  60% {
    transform: translateY(-10px) translateX(-50%);
  }
}

/* Hide elements until scrolled */
.hlm-scroll-hidden {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Show elements after scroll */
.theme-list:not(.hlm-scroll-hidden),
.category-section:not(.hlm-scroll-hidden),
.main-categories:not(.hlm-scroll-hidden) {
  opacity: 1;
}

/* Loading Indicator */
.hlm-loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 20px;
  z-index: 10; /* Ensure it's above the background but potentially below the final form if needed */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 767px) {
  .hlm-search-wrapper {
    height: 100vh;
    padding: 0 20px;
  }

  .hlm-search-centered {
    padding: 0 10px;
  }

  #hlm-search-input {
    font-size: 16px;
    padding: 15px 40px 15px 15px;
  }

  .hlm-search-history-btn {
    padding: 10px 20px;
    font-size: 14px;
  }
}

/* Adjust for WordPress admin bar */
body.admin-bar .hlm-search-wrapper {
  height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar .hlm-search-wrapper {
    height: calc(100vh - 46px);
  }
}
