/* Global Search Styles */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow-y: auto;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-container {
  width: 90%;
  max-width: 800px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  transform: translateY(-30px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.search-overlay.active .search-container {
  transform: translateY(0);
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: #318161;
  color: #fff;
}

.search-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.search-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.search-close-btn:hover {
  transform: rotate(90deg);
}

.search-body {
  padding: 20px;
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

.global-search-input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 30px;
  font-size: 1.1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.global-search-input:focus {
  outline: none;
  border-color: #318161;
  box-shadow: 0 0 0 3px rgba(49, 129, 97, 0.2);
}

.search-clear-btn {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #777;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.search-clear-btn:hover {
  background-color: #f0f0f0;
}

.search-loader {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
}

.search-loader.active {
  display: flex;
}

.loader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(49, 129, 97, 0.3);
  border-radius: 50%;
  border-top-color: #318161;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.search-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-filter {
  background: none;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-filter:hover {
  background-color: #f5f5f5;
}

.search-filter.active {
  background-color: #318161;
  color: #fff;
  border-color: #318161;
}

.search-results-info {
  margin-bottom: 15px;
  padding: 10px;
  border-radius: 4px;
  font-size: 0.9rem;
}

.search-results-info.success {
  background-color: rgba(49, 129, 97, 0.1);
  color: #318161;
}

.search-results-info.error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.search-results {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 10px;
}

.search-result-item {
  display: flex;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-result-item:last-child {
  border-bottom: none;
}

.result-category {
  flex-shrink: 0;
  margin-right: 15px;
  padding-top: 5px;
}

.result-category span {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.result-category.news span {
  background-color: #e3f2fd;
  color: #1976d2;
}

.result-category.blogs span {
  background-color: #e8f5e9;
  color: #388e3c;
}

.result-category.initiatives span {
  background-color: #fff8e1;
  color: #ffa000;
}

.result-content {
  flex-grow: 1;
}

.result-title {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.result-title a {
  color: #333;
  text-decoration: none;
  transition: color 0.3s ease;
}

.result-title a:hover {
  color: #318161;
}

.result-excerpt {
  margin: 0 0 10px 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
}

.result-meta {
  font-size: 0.8rem;
  color: #888;
}

.result-date {
  display: inline-flex;
  align-items: center;
}

.result-date i {
  margin-right: 5px;
}

mark {
  background-color: rgba(255, 213, 79, 0.4);
  padding: 0 2px;
  border-radius: 2px;
}

/* Responsive styles */
@media (max-width: 768px) {
  .search-overlay {
    padding-top: 5vh;
  }

  .search-header h2 {
    font-size: 1.2rem;
  }

  .search-result-item {
    flex-direction: column;
  }

  .result-category {
    margin-right: 0;
    margin-bottom: 10px;
  }
}

/* Search trigger button styles */
.search-trigger {
  background: none;
  border: none;
  color: #333;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.search-trigger:hover {
  color: #318161;
}

/* For when search is active */
body.search-active {
  overflow: hidden;
}

/* Floating search button */
.floating-search-btn {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #318161;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 99;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.floating-search-btn:hover {
  transform: scale(1.1);
  background-color: #266a4e;
}

.floating-search-btn i {
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  .floating-search-btn {
    bottom: 70px;
  }
}

