/* AI Gift Search Demo */
.ai-search-demo {
  background: white;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ai-search-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.ai-search-title {
  display: flex;
  flex-direction: column;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title-group i {
  font-size: 1.25rem;
  color: var(--color-primary);
}

.title-group h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1f2937;
}

.ai-search-description {
  margin: 0;
  color: var(--color-gray-600);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  line-height: 1.4;
  text-align: left;
}

.search-example {
  background: #f9fafb;
  border-radius: 0.75rem;
  padding: 1.5rem;
  position: relative;
  margin-bottom: 2rem;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  height: 570px;
  overflow: hidden;
}

.search-query {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-query i {
  color: var(--color-primary);
  font-size: 1.25rem;
  margin-top: 0.25rem;
}

.search-query p {
  margin: 0;
  color: #1f2937;
  font-size: 1rem;
  line-height: 1.5;
}

.search-results {
  position: relative;
  padding-top: 2.5rem;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.5s ease-in-out;
  width: 100%;
  margin-bottom: 2rem;
}

/* Add loading state styles */
.search-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
  z-index: 10;
}

.search-loading i {
  font-size: 4rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

.search-loading p {
  font-size: 1.25rem;
  color: #4b5563;
  margin: 0;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

.ai-recommended-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: left;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary);
  padding: 0.75rem 1.25rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05),
              0 0 10px rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.ai-recommended-title i {
  font-size: 1.25rem;
  position: relative;
  animation: shimmer 1.5s linear infinite;
  background: linear-gradient(
    90deg,
    var(--color-primary) 0%,
    #8b5cf6 20%,
    #3b82f6 40%,
    #8b5cf6 60%,
    var(--color-primary) 80%
  );
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
  transform-origin: center;
  display: inline-block;
}

@keyframes shimmer {
  0% {
    background-position: 0% center;
    transform: scale(1);
  }
  50% {
    background-position: -100% center;
    transform: scale(1.1);
  }
  100% {
    background-position: 0% center;
    transform: scale(1);
  }
}

.result-item {
  display: flex;
  gap: 1rem;
  background: white;
  padding: 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.5s forwards;
  animation-delay: calc(var(--item-index, 0) * 0.1s);
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}

.result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
              0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.result-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.result-image {
  width: 100px;
  height: 100px;
  border-radius: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
}

.result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.result-item:hover .result-image img {
  transform: scale(1.05);
}

.store-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.store-info i {
  color: #6b7280;
  font-size: 0.875rem;
}

.result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.result-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}

.result-content p {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.price-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #374151;
  font-size: 0.875rem;
}

.original-price {
  text-decoration: line-through;
  color: #6b7280;
}

.discount {
  color: #059669;
  font-weight: 500;
}

.final-price {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 1.125rem;
}

.add-to-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: #374151;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-to-list:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.add-to-list i {
  color: #ef4444;
  font-size: 0.875rem;
}

.typing-container {
  display: flex;
  align-items: center;
}

.typing-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 500;
  position: relative;
}

.typing-cursor {
  color: var(--color-primary);
  font-weight: bold;
  animation: blink 1s step-end infinite;
  margin-left: 2px;
}

.results-container {
  position: relative;
  height: 400px;
}

.alt-results {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  pointer-events: none;
  padding-top: 2.5rem;
}

.ai-search-content {
  position: relative;
  min-height: 600px;
  height: auto;
}

/* Animations */
@keyframes blink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

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

/* Mobile Adjustments */
@media (max-width: 768px) {
  .ai-search-content {
    min-height: 1233px;
  }

  .search-example {
    height: 1233px;
  }

  .results-container {
    height: 1078px;
  }

  .search-loading {
    top: 25%;
  }

  .search-query {
    min-height: 80px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .typing-text {
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 2.8em;
  }

  .search-results {
    margin-bottom: 0;
  }

  .interests-section {
    margin-top: 1rem;
  }

  .search-query i {
    margin-top: 0.25rem;
    flex-shrink: 0;
  }

  .search-query p {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
    margin: 0;
  }

  .ai-recommended-title {
    font-size: 0.875rem;
  }

  .result-item {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }

  .result-image {
    width: 100%;
    height: 200px;
    order: 2;
  }

  .result-content {
    order: 1;
  }

  .result-content h4 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
  }

  .result-meta {
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .price-tag {
    font-size: 0.875rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .add-to-list {
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
    padding: 0.75rem;
    font-size: 1rem;
  }

  .result-left {
    width: 100%;
  }

  .store-info {
    margin-bottom: 0.5rem;
  }

  .final-price {
    font-size: 1.25rem;
  }
}

.interests-section {
  transition: all 0.3s ease;
  padding: 2rem;
  background: #f9fafb;
  border-radius: 0.75rem;
  margin-top: 2rem;
}

.search-results:not([style*="opacity: 0"]) ~ .interests-section {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  margin: 0;
  padding: 1rem;
  background: rgba(249, 250, 251, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 20;
}

.interests-section h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  color: #1f2937;
}

.interests-section p {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.interests-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .interests-section {
    padding: 1.5rem;
  }

  .search-results:not([style*="opacity: 0"]) ~ .interests-section {
    padding: 1rem;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
  }

  .interests-grid {
    gap: 0.5rem;
  }
} 