/* Menu Search Icon */
.tsacf-menu-search-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  color: inherit;
}

.tsacf-menu-search-icon:hover {
  opacity: 0.7;
}

.tsacf-menu-search-icon svg {
  width: 20px;
  height: 20px;
}

/* Header Search Button (Fallback) */
.tsacf-header-search-button {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
}

.tsacf-header-search-button svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .tsacf-header-search-button {
    right: 60px;
  }
}

/* Modal Styles */
.tsacf-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: none;
  animation: fadeIn 0.2s ease;
}

.tsacf-modal.active {
  display: flex;
  flex-direction: column;
}

.tsacf-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.tsacf-modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  margin: 5vh auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

.tsacf-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tsacf-modal-search-input {
  flex: 1;
  font-size: 1.25rem;
  border: none;
  outline: none;
  padding: 0.5rem;
  font-family: "niveau-grotesk", system-ui, BlinkMacSystemFont, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #221F54;
}

.tsacf-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  color: #666;
  transition: color 0.2s ease;
}

.tsacf-modal-close:hover {
  color: #000;
}

.tsacf-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.tsacf-modal-results {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Reuse existing search result styles */
.tsacf-modal .tsacf-section-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.tsacf-modal .tsacf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.tsacf-modal .tsacf-hit {
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.tsacf-modal .tsacf-hit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tsacf-modal .tsacf-hit-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.tsacf-modal .tsacf-hit-title a {
  color: #7259ef;
  text-decoration: none;
  font-weight: 600;
}

.tsacf-modal .tsacf-hit-title a:hover {
  text-decoration: underline;
}

.tsacf-modal .tsacf-hit-excerpt {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
  -webkit-line-clamp: 3;
}

.tsacf-modal .tsacf-noresults {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
