/* ============================================
   Teleport Destination UI Styles for OpenMUD
   Grouped destination window with search
   Uses theme variables from theme.css
   ============================================ */

/* Teleport window positioning and base styles */
#teleport-window {
  position: absolute;
  top: 120px;
  left: 300px;
  width: 460px;
  max-width: 90vw;
  max-height: 65vh;
  background: var(--theme-bg-secondary);
  border: 2px solid var(--theme-border-primary);
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: none;
  flex-direction: column;
}

/* Dragging state */
#teleport-window.window-dragging {
  transition: none !important;
  user-select: none;
}

/* Window header drag handle */
#teleport-window .window-header {
  cursor: move;
  user-select: none;
  background: var(--theme-bg-tertiary);
  border-bottom: 1px solid var(--theme-border-secondary);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#teleport-window .window-header:active {
  cursor: grabbing;
}

#teleport-window .window-title {
  font-weight: bold;
  color: var(--theme-text-primary);
  font-size: 14px;
}

#teleport-window .window-controls {
  display: flex;
  gap: 4px;
}

#teleport-window .window-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
  color: var(--theme-text-muted);
  transition: all 0.2s;
}

#teleport-window .window-btn:hover {
  background: var(--theme-bg-hover);
  color: var(--theme-text-primary);
}

#teleport-window .window-close:hover {
  background: var(--theme-error);
  color: var(--theme-text-highlight);
}

/* Override window-content */
#teleport-window .window-content {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  overflow: hidden;
  flex: 1;
}

/* ============================================
   Search Bar
   ============================================ */

.teleport-search-container {
  padding: 10px 12px;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.teleport-search-input {
  width: 100%;
  padding: 8px 10px;
  background: var(--theme-bg-input);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 3px;
  color: var(--theme-text-primary);
  font-family: var(--theme-font-family);
  font-size: 12px;
  box-sizing: border-box;
}

.teleport-search-input:focus {
  outline: none;
  border-color: var(--theme-accent-blue);
}

.teleport-search-input::placeholder {
  color: var(--theme-text-muted);
}

/* ============================================
   Destinations List (Scrollable)
   ============================================ */

.teleport-destinations-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.teleport-destinations-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ============================================
   Region Headers
   ============================================ */

.teleport-region-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 4px;
  margin-top: 4px;
  color: var(--theme-text-muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--theme-border-secondary);
}

.teleport-region-header:first-child {
  margin-top: 0;
}

.teleport-region-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(33, 150, 243, 0.15);
  color: var(--theme-accent-blue);
  letter-spacing: 0.5px;
}

/* ============================================
   Destination Rows
   ============================================ */

.teleport-destination {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--theme-bg-tertiary);
  border: 1px solid var(--theme-border-secondary);
  border-radius: 3px;
  transition: all 0.15s;
}

.teleport-destination:hover {
  background: var(--theme-bg-hover);
  border-color: var(--theme-border-primary);
}

.teleport-dest-info {
  flex: 1;
  min-width: 0;
}

.teleport-dest-name {
  color: var(--theme-text-primary);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teleport-dest-description {
  color: var(--theme-text-muted);
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ============================================
   Action Button
   ============================================ */

.teleport-action-btn {
  padding: 5px 12px;
  background: var(--theme-accent-blue);
  border: none;
  border-radius: 3px;
  color: var(--theme-text-highlight);
  cursor: pointer;
  font-family: var(--theme-font-family);
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.teleport-action-btn:hover {
  background: var(--theme-accent-blue-hover);
  transform: scale(1.02);
}

.teleport-action-btn:active {
  transform: scale(0.98);
}

/* ============================================
   Empty State
   ============================================ */

.teleport-empty {
  text-align: center;
  color: var(--theme-text-muted);
  padding: 40px 20px;
  font-style: italic;
  font-size: 13px;
}

/* ============================================
   Footer
   ============================================ */

.teleport-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--theme-border-secondary);
  background: var(--theme-bg-tertiary);
  font-size: 11px;
  color: var(--theme-text-muted);
  display: flex;
  justify-content: space-between;
  font-style: italic;
}

/* ============================================
   Scrollbar Styling
   ============================================ */

.teleport-destinations-container::-webkit-scrollbar {
  width: 8px;
}

.teleport-destinations-container::-webkit-scrollbar-track {
  background: var(--theme-bg-primary);
}

.teleport-destinations-container::-webkit-scrollbar-thumb {
  background: var(--theme-border-primary);
  border-radius: 4px;
}

.teleport-destinations-container::-webkit-scrollbar-thumb:hover {
  background: var(--theme-border-highlight);
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 600px) {
  #teleport-window {
    width: 95vw;
    left: 2.5vw;
    top: 50px;
  }

  .teleport-dest-description {
    display: none;
  }
}
