/* UnifiedLocationSearch Component Styles */

.unified-location-search {
  position: relative;
  width: 100%;
}

/* Container Positioning Variants */
.unified-location-search.map-search-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 10;
}

.unified-location-search.mobile-location-search-container {
  width: 100%;
}

/* Search Input Wrapper */
.unified-location-search .search-input-wrapper {
  display: flex;
  align-items: stretch;
  background: rgba(33, 37, 41, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: none;
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  position: relative;
}

/* Location Button */
.unified-location-search .location-btn {
  background: rgba(245, 72, 77, 0.9);
  border: none;
  padding: 8px 12px;
  border-radius: 0;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.unified-location-search .location-btn:hover {
  background: rgba(245, 72, 77, 1);
}

.unified-location-search .location-btn.active {
  background: rgba(185, 255, 102, 0.9);
}


/* Unified Search Input */
.unified-location-search .unified-search-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.unified-location-search .unified-search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Clear Search Button */
.unified-location-search .clear-search-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 8px 16px;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0;
}

.unified-location-search .clear-search-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

/* Detected Gym Logo */
.unified-location-search .detected-gym-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0px !important;
  background: #f8f9fa;
  flex-shrink: 0;
  border: none;
}

.unified-location-search .detected-gym-logo.fallback-logo {
  padding: 4px;
  background: #fff;
}

/* Suggestions Dropdown */
.unified-location-search .suggestions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(33, 37, 41, 0.95) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: none !important;
  border-radius: 12px !important;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100500;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: slideDown 0.2s ease-out;
}

.unified-location-search .suggestions-dropdown--upward {
  top: auto;
  bottom: calc(100% + 8px);
}

/* Special handling for dropdowns in map bottom controls to avoid cropping */
.sector-create-inline-wrapper .unified-location-search .suggestions-dropdown,
.sector-edit-inline-wrapper .unified-location-search .suggestions-dropdown {
  position: absolute !important;
  z-index: 100700 !important;  /* Ensure it's above everything */
  max-height: 280px !important;  /* Reasonable height when opening upward */
}

/* Ensure the dropdown opens with proper spacing when in edit/create forms */
.sector-create-inline-wrapper .unified-location-search .suggestions-dropdown--upward,
.sector-edit-inline-wrapper .unified-location-search .suggestions-dropdown--upward {
  bottom: calc(100% + 12px) !important;  /* Add more space from input */
}

/* Dropdown Animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Premium Section Styles */
.unified-location-search .gym-suggestions.premium-section {
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-left: 0.5px solid #ffd700 !important;
  border-radius: 10px 0 0 0 !important;
}

.unified-location-search .gym-suggestions.premium-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
  pointer-events: none;
}

/* Suggestion Header */
.unified-location-search .suggestion-header {
  padding: 12px 16px 8px !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.unified-location-search .header-crown-icon {
  color: #ffd700;
  font-size: 14px;
}

/* Suggestion Item */
.unified-location-search .suggestion-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 16px !important;
  min-height: 40px !important;
  transition: all 0.2s !important;
}

.unified-location-search .suggestion-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

.unified-location-search .suggestion-item:active {
  background: rgba(255, 255, 255, 0.08) !important;
}

/* Gym Mini Logo in Suggestions */
.unified-location-search .gym-mini-logo {
  width: 48px !important;
  height: 48px !important;
  border-radius: 0px !important;
  object-fit: cover !important;
  margin-right: 8px;
  background: #f8f9fa;
  flex-shrink: 0;
}

.unified-location-search .gym-mini-logo.fallback-logo {
  width: 48px !important;
  height: 48px !important;
  border: none !important;
  opacity: 0.35 !important;
  mix-blend-mode: overlay !important;
  background: rgba(255, 255, 255, 0) !important;
}

/* Suggestion Content */
.unified-location-search .suggestion-content {
  flex: 1;
  min-width: 0;
}

.unified-location-search .suggestion-content strong {
  display: block;
  color: #fff;
  font-size: 14px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unified-location-search .suggestion-subtitle {
  color: rgba(255, 255, 255, 0.5) !important;
  font-size: 0.85rem !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unified-location-search .inactive-notice {
  color: #f5484d;
  font-size: 11px;
  margin-top: 2px;
  font-style: italic;
}

/* Scrollbar Styles */
.unified-location-search .suggestions-dropdown::-webkit-scrollbar {
  width: 6px;
}

.unified-location-search .suggestions-dropdown::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.unified-location-search .suggestions-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.unified-location-search .suggestions-dropdown::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Disabled State */
.unified-location-search.disabled-search .unified-search-input {
  opacity: 0.6;
  pointer-events: none;
}

.unified-location-search.disabled-search .location-btn {
  opacity: 0.6;
  pointer-events: none;
}

.unified-location-search.disabled-search .search-input-wrapper {
  background: rgba(33, 37, 41, 0.5);
}

/* Mobile Responsive */
@media (max-width: 767px) {
  .unified-location-search .unified-search-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  .unified-location-search .suggestions-dropdown {
    max-height: 280px;
  }
}

@media (min-width: 769px) {
  .unified-location-search .suggestions-dropdown {
    max-height: 480px;
  }
}