:root {
  --text-light: #e0e0e0;
  --text-muted: #a1a1aa;
  --text-secondary: #d1d5db;
  --primary-orange: #ffa500;
  --orange-hover: #ffcc33;
  --orange-tint-10: rgba(255, 165, 0, 0.1);
  --black-80: rgba(0, 0, 0, 0.8);
  --black-50: rgba(0, 0, 0, 0.5);
}

.close-button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  line-height: 1;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: color 0.3s ease;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 50;
}

.close-button:hover {
  color: #ffffff;
}

.filter-drawer-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
}

.filter-toggle-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.9);
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}

.filter-toggle-button:hover {
  background: rgba(26, 26, 26, 1);
}

.filter-toggle-button .chevron {
  margin-left: 8px;
  font-size: 0.875rem;
  transition: transform 0.3s ease;
}

.filter-toggle-button.open .chevron {
  transform: rotate(180deg);
}

.filter-drawer {
  background: rgba(26, 26, 26, 0.95);
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  position: relative;
}

.filter-drawer .close-button {
  font-size: 2.5rem;
  top: 8px;
  right: 14px;
}

.filter-drawer.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.filter-tag {
  display: inline-block;
  background: rgba(26, 26, 26, 0.8);
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 500;
  padding: 8px 16px;
  margin: 6px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  z-index: 10;
}

.filter-tag.year-tag {
  font-weight: 600;
  background: rgba(26, 26, 26, 0.85);
  padding: 6px 12px;
}

.filter-tag:hover {
  background: rgba(26, 26, 26, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.filter-tag.active {
  background: var(--primary-orange);
  border-color: var(--primary-orange);
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.5);
  color: #ffffff;
}

.filter-tag.active:hover {
  background: var(--orange-hover);
  transform: translateY(-2px);
}

.year-filter-container,
.tag-filter-container {
  padding: 0.5rem;
  border-radius: 1rem;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

#globeViz {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  width: 100%;
  z-index: 1;
}

.popover {
  z-index: 40;
}

.popover-static {
  position: fixed;
  top: 45%;
  right: 10px;
  transform: translateY(-50%);
}

.popover-content {
  background: rgba(26, 26, 26, 0.95);
  border-radius: 8px;
  padding: 15px;
  width: 300px;
  box-shadow: 0 4px 10px var(--black-50);
  position: relative;
  border: 1px solid var(--orange-tint-10);
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}

.popover-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-light);
  word-wrap: break-word;
  overflow-wrap: break-word;
  padding-right: 30px;
}

.popover-body {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.popover-footer {
  text-align: right;
}

.popover-enhanced {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

.popover-image-container {
  margin-bottom: 10px;
}

.popover-image-enhanced {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.popover-title-enhanced {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-light);
  text-align: center;
  margin: 8px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  width: 100%;
  padding-right: 30px;
}

.popover-body-enhanced {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 10px;
}

.popover-footer-enhanced {
  text-align: center;
}

.popover-link {
  display: inline-block;
  background: linear-gradient(90deg, var(--primary-orange), #ff8c00);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 9999px;
  border: 1px solid var(--primary-orange);
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease-in-out;
  cursor: pointer;
}

.popover-link:hover {
  background: linear-gradient(90deg, var(--orange-hover), #ffb84d);
  border-color: var(--orange-hover);
  box-shadow: 0 4px 10px rgba(255, 165, 0, 0.4);
  transform: scale(1.05);
  text-decoration: none;
}

.popover-link:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.3);
}

.popover-link:active {
  transform: scale(0.95);
}

#globeViz .scene-container .site-label {
  display: block !important;
  background: transparent !important;
  color: var(--primary-orange) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
  font-weight: bold !important;
  padding: 0 !important;
  border-radius: 0 !important;
  text-shadow: 0 0 6px var(--black-80), 0 0 6px var(--black-80) !important;
  white-space: nowrap !important;
  z-index: 5 !important;
  transition: none !important;
  transform: translate(-50%, 0) !important;
  text-align: center !important;
  opacity: 1 !important;
}

.hex-highlight {
  outline: 2px solid var(--primary-orange);
  outline-offset: 2px;
  box-shadow: 0 0 8px var(--primary-orange);
}

@media (max-width: 640px) {
  #globeViz {
    height: 100vh;
  }
  .filter-tag {
    font-size: 0.875rem;
    padding: 6px 12px;
    margin: 4px;
  }
  .filter-tag.year-tag {
    font-size: 0.875rem;
    padding: 5px 10px;
  }
  .year-filter-container,
  .tag-filter-container {
    padding: 0.25rem;
    gap: 6px;
  }
  .filter-drawer {
    padding: 0.5rem;
  }

  .close-button {
    top: -4px;
    right: 0px;
    font-size: 2.25rem;
    padding: 8px;
    color: var(--text-light);
    text-shadow: 0 0 4px var(--black-80);
    z-index: 51;
  }

  .popover-static {
    right: 50%;
    transform: translate(50%, -50%);
    width: 90%;
    max-width: 300px;
  }

  .popover-content {
    width: 100%;
    padding: 10px;
  }
  .popover-title {
    font-size: 1rem;
  }
  .popover-body {
    font-size: 0.75rem;
  }
  .popover-link {
    font-size: 0.875rem;
    padding: 6px 12px;
  }
  .popover-image-enhanced {
    width: 120px;
    height: 120px;
  }
  .popover-title-enhanced {
    font-size: 1rem;
  }
  .popover-body-enhanced {
    font-size: 0.75rem;
  }
}