:root {
  --font-family: 'Outfit', sans-serif;
  --bg-color: #050510;
  --text-main: #ffffff;
  --text-dim: #a0a0b0;
  --accent: #4d9fff;
  --panel-bg: rgba(20, 20, 35, 0.6);
  --panel-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-blur: blur(10px);
}

body,
html {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: var(--font-family);
  color: var(--text-main);
}

#app {
  width: 100%;
  height: 100%;
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  padding: 24px;
  box-sizing: border-box;
}



h1 {
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 4px 0 0 0;
}

#controls-panel {
  position: absolute;
  bottom: 130px;
  left: 24px;
  background: var(--panel-bg);
  backdrop-filter: var(--glass-blur);
  border: var(--panel-border);
  padding: 16px;
  border-radius: 12px;
  pointer-events: auto;
  min-width: 200px;
}

.control-group {
  margin-bottom: 12px;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
}

.radio-group {
  display: flex;
  gap: 12px;
  font-size: 0.9rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

#zoom-indicator {
  position: absolute;
  bottom: 24px;
  right: 24px;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--text-dim);
  pointer-events: auto;
}

/* Context Menu */
.context-menu {
  position: absolute;
  background: rgba(15, 15, 25, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  padding: 8px 0;
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  pointer-events: auto;
}

.context-menu.hidden {
  display: none;
}

.context-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.context-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* About Button (Consistent across visualizations) */
.hud-btn {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(20, 20, 35, 0.7);
  color: #a0a0b8;
  cursor: pointer;
  backdrop-filter: blur(8px);
  font-family: var(--font-family);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  pointer-events: auto;
}

.hud-btn:hover {
  background: rgba(40, 40, 60, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
  color: #e0e0ff;
  transform: translateY(-1px);
}

/* Modal Styles */
.modal-overlay {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #1a1a2e;
  color: #eee;
  padding: 40px;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  font-family: var(--font-family);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content.hidden,
.modal-overlay.hidden {
  display: none;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #888;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

/* Markdown Content Styling */
#modal-body h1,
#modal-body h2 {
  color: #fff;
  margin-top: 0;
}

#modal-body code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
}

/* Animal Image Tooltip */
.animal-tooltip {
  position: fixed;
  z-index: 150;
  width: 200px;
  background: rgba(15, 15, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.animal-tooltip.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.animal-tooltip-image-container {
  width: 100%;
  height: 140px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(40, 40, 60, 0.5);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animal-tooltip-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.animal-tooltip-image-container img.loading {
  opacity: 0;
}

.animal-tooltip-loading {
  position: absolute;
  font-family: var(--font-family);
  font-size: 0.8rem;
  color: var(--accent);
  animation: tooltip-pulse 1.5s infinite ease-in-out;
}

.animal-tooltip-loading.hidden {
  display: none;
}

.animal-tooltip-name {
  margin-top: 10px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* No image fallback */
.animal-tooltip-image-container.no-image {
  background: var(--panel-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.animal-tooltip-image-container.no-image::after {
  content: 'Image not available';
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  opacity: 0.8;
  text-align: center;
}

@keyframes tooltip-pulse {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.6;
  }
}