/* Semantic Search Styles */
.semantic-search-container {
  max-width: 800px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.search-form-container {
  position: relative;
  margin-bottom: 20px;
}

.semantic-search-form {
  position: relative;
}

.search-input-container {
  display: flex;
  background: #fff;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.search-input-container:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.semantic-search-input {
  flex: 1;
  padding: 16px 20px;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
}

.semantic-search-input::placeholder {
  color: #9ca3af;
}

.search-button {
  padding: 16px 20px;
  background: #3b82f6;
  border: none;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-button:hover {
  background: #2563eb;
}

.search-button:active {
  background: #1d4ed8;
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e1e5e9;
  border-top: none;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
}

.suggestions-list {
  padding: 8px 0;
}

.suggestion-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f3f4f6;
}

.suggestion-item:hover {
  background: #f8fafc;
}

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

.suggestion-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  margin-right: 12px;
  object-fit: cover;
  background: #f3f4f6;
}

.suggestion-content {
  flex: 1;
  min-width: 0;
}

.suggestion-name {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
  font-size: 14px;
}

.suggestion-category {
  display: inline-block;
  background: #e5e7eb;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin: 0;
}

.suggestion-similarity {
  color: #9ca3af;
  font-size: 12px;
  margin-left: 8px;
}

.suggestion-icon {
  color: #9ca3af;
  margin-left: 8px;
}

/* Search Results */
.search-results {
  margin-top: 20px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}

.results-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 24px;
}

.results-count {
  color: #6b7280;
  font-size: 14px;
}

.results-list {
  display: grid;
  gap: 16px;
}

.coupon-card {
  background: linear-gradient(135deg, #ffffff 0%, #fef7ff 100%);
  border: 2px solid #e8d5e8;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(178, 46, 102, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* .coupon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #B22E66 0%, #E91E63 50%, #FF4081 100%);
} */

.coupon-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(178, 46, 102, 0.15);
  border-color: #b22e66;
}

.coupon-card:active {
  transform: translateY(0);
}

.coupon-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.coupon-logo {
  width: 48px;
  /* height: 48px; */
  /* border-radius: 12px; */
  object-fit: cover;
  /* background: linear-gradient(135deg, #b22e66 0%, #e91e63 100%); */
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  font-size: 18px;
  /* box-shadow: 0 4px 12px rgba(178, 46, 102, 0.3); */
}

.coupon-info {
  flex: 1;
  min-width: 0;
}

.coupon-store {
  font-size: 20px;
  font-weight: 700;
  color: #b22e66;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.coupon-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.coupon-category {
  background: linear-gradient(135deg, #fce4ec 0%, #f8bbd9 100%);
  color: #b22e66;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #f8bbd9;
}

/* Coupon Title Section */
.coupon-title-section {
  margin: 16px 0;
  padding: 16px 0;
  border-bottom: 2px solid #fce4ec;
}

.coupon-title {
  font-size: 18px;
  font-weight: 600;
  color: #2d1b2e;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.coupon-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.coupon-discount {
  background: linear-gradient(135deg, #b22e66 0%, #e91e63 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(178, 46, 102, 0.3);
}

.coupon-code {
  background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  color: #b22e66;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
  border: 1px solid #e1bee7;
}

.coupon-expiry {
  background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
  color: #e65100;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #ffcc80;
}

.verified-badge {
  background: linear-gradient(135deg, #4caf50 0%, #66bb6a 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.coupon-description {
  color: #6a4c93;
  font-size: 14px;
  line-height: 1.6;
  margin: 16px 0;
  padding: 12px;
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  border-radius: 8px;
  border-left: 4px solid #b22e66;
}

.coupon-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid #fce4ec;
}

.coupon-similarity {
  display: flex;
  align-items: center;
  color: #b22e66;
  font-size: 14px;
  font-weight: 600;
  gap: 6px;
}

.coupon-actions {
  display: flex;
  gap: 8px;
}

.visit-store-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #b22e66 0%, #e91e63 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(178, 46, 102, 0.3);
}

.visit-store-btn:hover {
  background: linear-gradient(135deg, #e91e63 0%, #ff4081 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(178, 46, 102, 0.4);
}

.visit-store-btn:active {
  transform: translateY(0);
}

.visit-store-btn svg {
  width: 16px;
  height: 16px;
}

.visit-store-btn.disabled {
  background: #bdbdbd;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.visit-store-btn.disabled:hover {
  background: #bdbdbd;
  transform: none;
  box-shadow: none;
}

.similarity-icon {
  margin-right: 4px;
}

/* Loading States */
.loading {
  text-align: center;
  padding: 40px 20px;
  color: #6b7280;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

/* Infinite Scroll Loading */
.infinite-loading {
  text-align: center;
  padding: 20px;
  color: #6b7280;
  background: #f8fafc;
  border-radius: 8px;
  margin: 16px 0;
}

.infinite-loading .loading-spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
  margin: 0 auto 8px;
}

.infinite-loading p {
  margin: 0;
  font-size: 14px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .semantic-search-container {
    padding: 0 16px;
  }

  .search-input-container {
    border-radius: 8px;
  }

  .semantic-search-input {
    padding: 14px 16px;
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .search-button {
    padding: 14px 16px;
  }

  .coupon-card {
    padding: 16px;
  }

  .coupon-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .coupon-logo {
    margin-right: 0;
    margin-bottom: 12px;
  }

  .coupon-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .visit-store-btn {
    width: 100%;
    justify-content: center;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* WordPress Theme Compatibility */
.semantic-search-container * {
  box-sizing: border-box;
}

/* Override theme styles that might interfere */
.semantic-search-container input,
.semantic-search-container button {
  font-family: inherit;
}

.semantic-search-container a {
  text-decoration: none;
  color: inherit;
}

.semantic-search-container a:hover {
  text-decoration: none;
}
