/* Smart Tooltip Component - Based on MapSVG's Tooltip Architecture */

.smart-tooltip {
  background: rgba(31, 41, 55, 0.95);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 320px;
  min-width: 180px;
  transition: opacity 0.15s ease-in-out;
  -webkit-user-select: none;
          user-select: none;
  pointer-events: none;
}

/* Position-based styling for arrows and positioning hints */

/* Content styling */
.smart-tooltip .tooltip-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

.smart-tooltip .tooltip-content {
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.smart-tooltip .tooltip-meta {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Cities list styling */
.smart-tooltip .cities-list {
  margin-top: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.smart-tooltip .cities-list::-webkit-scrollbar {
  width: 4px;
}

.smart-tooltip .cities-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.smart-tooltip .cities-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.smart-tooltip .cities-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.smart-tooltip .cities-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.smart-tooltip .cities-list li {
  margin-bottom: 0.25rem;
}

.smart-tooltip .cities-list a {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.15s;
}

.smart-tooltip .cities-list a:hover {
  color: #dbeafe;
  text-decoration: underline;
}

/* Loading states */
.smart-tooltip .loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

.smart-tooltip .loading::before {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Error states */
.smart-tooltip .error {
  color: #fca5a5;
  font-size: 0.75rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .smart-tooltip {
    max-width: 280px;
    min-width: 160px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
  
  .smart-tooltip .tooltip-title {
    font-size: 0.875rem;
  }
  
  .smart-tooltip .cities-list {
    max-height: 120px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .smart-tooltip {
    background: #000;
    border: 2px solid #fff;
  }
  
  .smart-tooltip::before {
    border-top-color: #000;
    border-bottom-color: #000;
    border-left-color: #000;
    border-right-color: #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .smart-tooltip {
    transition: none;
  }
  
  .smart-tooltip .loading::before {
    animation: none;
  }
}

