/* ============================================
   AI Search Modal
   ============================================ */

.ai-search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-search-modal.active {
  opacity: 1;
}

.ai-search-container {
  width: 90%;
  max-width: 800px;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.ai-search-modal.active .ai-search-container {
  transform: scale(1);
}

.ai-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.ai-search-header h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin: 0;
}

.close-search {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-search:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.ai-search-input-wrapper {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

#aiSearchInput {
  flex: 1;
  padding: 1rem 1.5rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

#aiSearchInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.ai-search-btn {
  padding: 1rem 2rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ai-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.ai-search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 1rem 0;
}

.ai-search-loading,
.ai-search-error,
.ai-search-no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.ai-search-results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-search-result-item {
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.ai-search-result-item:hover {
  border-color: var(--primary);
  transform: translateX(-5px);
}

.ai-search-result-item h4 {
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.ai-search-result-item p {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.ai-search-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.ai-search-link:hover {
  color: var(--primary-light);
}

.ai-search-suggestions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.ai-search-suggestions h5 {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.ai-search-suggestions ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-search-suggestions li a {
  padding: 0.5rem 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.ai-search-suggestions li a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================
   Floating Action Buttons - WhatsApp
   ============================================ */

.whatsapp-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
}

.floating-whatsapp-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
  text-decoration: none;
  border: 3px solid rgba(255, 255, 255, 0.2);
  animation: whatsappPulse 2s ease-in-out infinite;
}

.floating-whatsapp-btn:hover {
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.6);
  background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
  animation: none;
}

.floating-whatsapp-btn:active {
  transform: translateY(-2px) scale(1.05);
}

.floating-whatsapp-btn svg {
  width: 32px;
  height: 32px;
  fill: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.whatsapp-tooltip {
  position: absolute;
  right: 75px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid var(--bg-secondary);
}

.floating-whatsapp-btn:hover .whatsapp-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(-5px);
}

/* WhatsApp Pulse Animation */
@keyframes whatsappPulse {
  0% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 30px rgba(37, 211, 102, 0.8);
  }
  100% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  }
}

/* ============================================
   Legal Pages Styles
   ============================================ */

.legal-page {
  padding: 120px 0 80px;
  min-height: 100vh;
  background: var(--bg-primary);
}

.legal-page .container {
  max-width: 900px;
}

.legal-page h1 {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.last-updated {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.legal-content {
  color: var(--text-secondary);
  line-height: 1.8;
}

.legal-content h2 {
  color: var(--text-primary);
  font-size: 1.8rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.legal-content h3 {
  color: var(--text-primary);
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.legal-content p {
  margin-bottom: 1.5rem;
}

.legal-content ul {
  margin: 1rem 0 1.5rem 2rem;
  padding: 0;
}

.legal-content li {
  margin-bottom: 0.75rem;
  list-style-type: disc;
}

.footer-links-inline {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.footer-links-inline a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links-inline a:hover {
  color: var(--primary);
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .whatsapp-container {
    bottom: 15px;
    right: 15px;
  }

  .floating-whatsapp-btn {
    width: 56px;
    height: 56px;
  }

  .floating-whatsapp-btn svg {
    width: 28px;
    height: 28px;
  }

  .whatsapp-tooltip {
    display: none;
  }

  .legal-page h1 {
    font-size: 2rem;
  }

  .legal-content h2 {
    font-size: 1.5rem;
  }
}
