/* ============================================================
   Ollama GPU Hosts Globe — Dark Hacker Terminal Theme
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: #00ff88;
}

#cesiumContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Hide all default Cesium UI chrome */
.cesium-viewer-toolbar,
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer,
.cesium-viewer-fullscreenContainer,
.cesium-viewer-infoBoxContainer,
.cesium-viewer-selectionIndicatorContainer,
.cesium-viewer-geocoderContainer,
.cesium-viewer-bottom,
.cesium-credit-logoContainer,
.cesium-credit-textContainer,
.cesium-creditDisplay-cesiumLogo,
.cesium-widget-credits {
  display: none !important;
}

/* ---- Header ---- */
#header {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 100;
  pointer-events: none;
}

#header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #00ff88;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
  margin-bottom: 4px;
}

#header .subtitle {
  font-size: 11px;
  color: rgba(0, 255, 136, 0.6);
  font-weight: 400;
  margin-bottom: 14px;
}

#search-box {
  pointer-events: auto;
  position: relative;
}

#search-input {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #00ff88;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 8px 14px;
  width: 280px;
  outline: none;
  border-radius: 2px;
}

#search-input::placeholder {
  color: rgba(0, 255, 136, 0.35);
}

#search-input:focus {
  border-color: #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.2);
}

/* ---- Autocomplete Dropdown ---- */
#autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 380px;
  max-height: 340px;
  overflow-y: auto;
  background: rgba(0, 8, 4, 0.95);
  border: 1px solid rgba(0, 255, 136, 0.35);
  border-top: none;
  border-radius: 0 0 3px 3px;
  z-index: 300;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

#autocomplete-dropdown.hidden {
  display: none;
}

.ac-group-label {
  padding: 6px 12px 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(0, 255, 136, 0.35);
  border-top: 1px solid rgba(0, 255, 136, 0.1);
}

.ac-group-label:first-child {
  border-top: none;
}

.ac-item {
  padding: 6px 12px;
  font-size: 11px;
  color: rgba(0, 255, 136, 0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-item:hover,
.ac-item.ac-active {
  background: rgba(0, 255, 136, 0.1);
  color: #00ff88;
}

.ac-item .ac-tag {
  flex-shrink: 0;
  font-size: 8px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(0, 255, 136, 0.12);
  color: rgba(0, 255, 136, 0.5);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ac-item .ac-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-item .ac-count {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 9px;
  color: rgba(0, 255, 136, 0.35);
}

.ac-highlight {
  color: #00ff88;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(0, 255, 136, 0.3);
}

#autocomplete-dropdown::-webkit-scrollbar {
  width: 4px;
}

#autocomplete-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

#autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 136, 0.25);
  border-radius: 2px;
}

/* ---- Stats ---- */
#stats {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 100;
  text-align: right;
  font-size: 13px;
  line-height: 1.65;
  pointer-events: none;
}

.stat-row {
  color: rgba(0, 255, 136, 0.7);
}

.stat-value {
  color: #00ff88;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
}

/* ---- Legend ---- */
#legend {
  position: absolute;
  bottom: 40px;
  left: 20px;
  z-index: 100;
  font-size: 11px;
  pointer-events: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: rgba(0, 255, 136, 0.7);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

/* ---- Rotation Toggle ---- */
#rotation-toggle {
  position: absolute;
  bottom: 40px;
  right: 20px;
  z-index: 100;
}

#rotation-btn {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #00ff88;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  border-radius: 2px;
}

#rotation-btn:hover {
  border-color: #00ff88;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

#rotation-btn.active {
  border-color: #00ff88;
  background: rgba(0, 255, 136, 0.1);
}

/* ---- Controls Hint ---- */
#controls-hint {
  position: absolute;
  bottom: 14px;
  right: 20px;
  z-index: 100;
  font-size: 10px;
  color: rgba(0, 255, 136, 0.35);
  pointer-events: none;
}

/* ---- Info Popup ---- */
#info-popup {
  position: absolute;
  z-index: 200;
  background: rgba(0, 8, 4, 0.92);
  border: 1px solid rgba(0, 255, 136, 0.4);
  border-radius: 4px;
  padding: 12px 16px;
  min-width: 280px;
  max-width: 420px;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(0, 255, 136, 0.8);
  pointer-events: auto;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.1);
}

#info-popup.hidden {
  display: none;
}

#info-popup .info-label {
  color: rgba(0, 255, 136, 0.5);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#info-popup .info-val {
  color: #00ff88;
  font-weight: 700;
}

.info-ip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.ip-addr {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(0, 255, 136, 0.4);
  transition: text-shadow 0.15s;
}

.ip-addr:hover {
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
  text-decoration-color: #00ff88;
}

.copy-hint {
  font-size: 9px;
  color: rgba(0, 255, 136, 0.35);
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: color 0.15s;
  flex-shrink: 0;
}

.copy-hint.copied {
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

#info-popup .info-models {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 255, 136, 0.15);
  max-height: 100px;
  overflow-y: auto;
  font-size: 10px;
  color: rgba(0, 255, 136, 0.6);
  word-break: break-all;
}

/* ---- Footer ---- */
#footer {
  position: absolute;
  bottom: 14px;
  left: 20px;
  z-index: 100;
  display: none; /* hidden, credits in legend area */
}

#footer a {
  color: rgba(0, 255, 136, 0.3);
  font-size: 9px;
  text-decoration: none;
}

/* ---- Atmosphere Glow (CSS overlay) ---- */
#atmosphere-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    ellipse at center,
    transparent 30%,
    rgba(0, 60, 30, 0.06) 50%,
    rgba(0, 40, 20, 0.12) 70%,
    rgba(0, 20, 10, 0.25) 85%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* Custom scrollbar for info popup */
#info-popup .info-models::-webkit-scrollbar {
  width: 4px;
}

#info-popup .info-models::-webkit-scrollbar-track {
  background: transparent;
}

#info-popup .info-models::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 136, 0.3);
  border-radius: 2px;
}
