/* Premium Search Styles for Vozzo API Docs */

/* Close button base */
[data-slot="dialog-content"]>button {
  position: absolute !important;
  top: 7px !important;
  left: 92% !important;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: #f3f4f6 !important;
  border: none !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12) !important;
  cursor: pointer;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Remove any existing SVG inside the button */
[data-slot="dialog-content"]>button svg {
  display: none !important;
}

/* Create the X icon using pseudo-elements */
[data-slot="dialog-content"]>button::before,
[data-slot="dialog-content"]>button::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 2.5px;
  background-color: #374151;
  /* dark gray */
  border-radius: 1px;
  transition: background-color 0.2s ease;
}

/* Rotate lines to form X */
[data-slot="dialog-content"]>button::before {
  transform: rotate(45deg);
}

[data-slot="dialog-content"]>button::after {
  transform: rotate(-45deg);
}

/* Hover effect */
[data-slot="dialog-content"]>button:hover {
  background: #ef4444 !important;
  transform: scale(1.1);
}

[data-slot="dialog-content"]>button:hover::before,
[data-slot="dialog-content"]>button:hover::after {
  background-color: #fff;
  /* white on hover */
}

/* Search Modal Overlay Glassmorphism */
[data-radix-portal]>div[style*="background-color: rgba(0, 0, 0, 0.8)"] {
  background-color: rgba(0, 0, 0, 0.4) !important;
  backdrop-filter: blur(8px) !important;
}

/* Search Modal Container */
[data-radix-portal] [role="dialog"] {
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  padding: 0 !important;
}

.dark [data-radix-portal] [role="dialog"] {
  background: rgba(15, 23, 42, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

/* Header & Input Field */
.search-modal-header {
  padding: 16px 20px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.dark .search-modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

/* Search Results Area */
.search-modal-content {
  padding: 20px !important;
  min-height: 300px;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Animation for Modal Entry */
[data-radix-portal] [role="dialog"][data-state="open"] {
  animation: modal-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Custom Search Trigger Button */
.premium-search-trigger {
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.03) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 12px !important;
  padding: 8px 14px !important;
  color: #64748b !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease !important;
  width: 100%;
  max-width: 280px;
}

.dark .premium-search-trigger {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}

.premium-search-trigger:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  color: #1e293b !important;
  transform: translateY(-1px);
}

.dark .premium-search-trigger:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: #f1f5f9 !important;
}

.premium-shortcut {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 2px 6px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dark .premium-shortcut {
  background: rgba(30, 41, 59, 1);
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

/* Close Button - Premium Position & Style */
[data-radix-portal] [role="dialog"] button[aria-label="Close"],
[data-radix-portal] [role="dialog"] button.absolute {
  left: auto !important;
  right: 1.25rem !important;
  top: 1.25rem !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: white !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #64748b !important;
  opacity: 1 !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  z-index: 100 !important;
}

.dark [data-radix-portal] [role="dialog"] button[aria-label="Close"],
.dark [data-radix-portal] [role="dialog"] button.absolute {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
}

[data-radix-portal] [role="dialog"] button[aria-label="Close"]:hover,
[data-radix-portal] [role="dialog"] button.absolute:hover {
  transform: scale(1.1) rotate(90deg) !important;
  background: #ef4444 !important;
  color: white !important;
  border-color: #ef4444 !important;
  box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.4) !important;
}

/* Make the icon inside larger */
[data-radix-portal] [role="dialog"] button[aria-label="Close"] svg,
[data-radix-portal] [role="dialog"] button.absolute svg {
  width: 24px !important;
  height: 24px !important;
}

/* Fix for overlapping header content and layout stability */
[data-radix-portal] [role="dialog"]>div {
  padding-top: 20px !important;
}

[data-radix-portal] [role="dialog"] input {
  font-size: 1.25rem !important;
  padding: 24px !important;
  height: auto !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 0 !important;
}

.dark [data-radix-portal] [role="dialog"] input {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Polishing the 'error' message area to look professional even when results are missing */
[data-radix-portal] [role="dialog"] .text-sm.text-muted-foreground {
  font-size: 1rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.025em !important;
  color: #64748b !important;
  padding: 60px 40px !important;
  display: block !important;
  text-align: center !important;
}

.dark [data-radix-portal] [role="dialog"] .text-sm.text-muted-foreground {
  color: #94a3b8 !important;
}