/* Frontend styles for NS AI Search */

.ns-ai-search-container {
  position: relative;
  display: inline-block;
}

.ns-ai-search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.ns-ai-search-toggle:hover {
  background-color: #f0f0f0;
}

.ns-ai-search-toggle svg {
  display: block;
}

.ns-ai-search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.ns-ai-search-modal-content {
  background: #ffffff;
  border-radius: 12px;
  width: 92%;
  max-width: 760px;
  max-height: 88vh;
  overflow: hidden;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  animation: nsAiModalIn 140ms ease-out;
}

.ns-ai-search-modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fafbfc;
}

.ns-ai-search-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #1f2937;
  letter-spacing: 0.2px;
}

.ns-ai-search-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ns-ai-search-close:hover {
  color: #333;
}

.ns-ai-search-modal-body {
  padding: 18px 22px 22px 22px;
  flex: 1;
  overflow-y: auto;
}

.ns-ai-search-form {
  margin-bottom: 20px;
}

.ns-ai-search-input-container {
  display: flex;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.ns-ai-search-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  font-size: 1rem;
  outline: none;
}

.ns-ai-search-submit {
  background: #2563eb;
  border: none;
  color: white;
  padding: 0 18px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.ns-ai-search-submit:hover {
  background: #1d4ed8;
}

.ns-ai-search-results {
  margin-top: 20px;
}

.ns-ai-search-result-item {
  padding: 14px 16px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-bottom: 12px;
}

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

.ns-ai-search-result-title {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
}

.ns-ai-search-result-title a {
  text-decoration: none;
  color: #2563eb;
}

.ns-ai-search-result-title a:hover {
  text-decoration: underline;
}

.ns-ai-search-result-excerpt {
  margin: 0 0 10px 0;
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ns-ai-search-result-link {
  color: #2563eb;
  text-decoration: none;
  font-size: 0.9rem;
}

.ns-ai-search-result-link:hover {
  text-decoration: underline;
}

.ns-ai-search-loading {
  text-align: center;
  padding: 30px 0;
}

.ns-ai-search-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ns-ai-search-error {
  color: #d63638;
  padding: 15px;
  background-color: #fcf0f1;
  border-left: 4px solid #d63638;
  margin: 20px 0;
  border-radius: 2px;
}

.ns-ai-search-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}

.ns-ai-pagination a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  color: #374151;
}

.ns-ai-pagination a:hover {
  background: #f3f4f6;
}

@keyframes nsAiModalIn {
  0% {
    transform: translateY(8px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
