/* Ultra-Minimal Clean Style */
:root {
  --bg-island: rgba(255, 255, 255, 0.94);
  --border: rgba(0, 0, 0, 0.08);
  --border-subtle: #f1f5f9;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --text-main: #18181b;
  --text-muted: #52525b;
  --text-sub: #a1a1aa;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --radius-full: 9999px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  background: #f4f4f5;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

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

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

/* Loading */
.loading-screen {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader {
  width: 24px;
  height: 24px;
  border: 2px solid #e4e4e7;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Islands */
.island {
  position: absolute;
  background: var(--bg-island);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-full);
  z-index: 30;
  display: flex;
  align-items: center;
}

.divider {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 8px;
}

/* Top Island */
.top-island {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px 6px 14px;
  gap: 6px;
  max-width: 94vw;
  overflow-x: auto;
}

.top-island::-webkit-scrollbar {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
  white-space: nowrap;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.chips {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

.chip-btn.active {
  background: var(--text-main);
  color: #ffffff;
}

.help-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.help-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--accent);
}

.help-btn svg {
  width: 17px;
  height: 17px;
}

/* Bottom Island */
.bottom-island {
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  gap: 12px;
}

.control-unit {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.control-unit .label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.control-unit input[type="range"] {
  width: 100px;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}

.control-unit .val {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  min-width: 28px;
}

.stats {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Tooltip */
.tooltip {
  position: absolute;
  z-index: 100;
  background: rgba(24, 24, 27, 0.92);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  pointer-events: none;
  transform: translate(-50%, -130%);
  white-space: nowrap;
}

/* Modal Dialog */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  width: 580px;
  max-width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  padding: 18px 22px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-sub);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close:hover {
  background: #f4f4f5;
  color: var(--text-main);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-section p {
  margin-bottom: 8px;
}

.info-section p:last-child {
  margin-bottom: 0;
}

.info-section ul {
  padding-left: 20px;
  margin-top: 6px;
}

.info-section li {
  margin-bottom: 4px;
}

.callout {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
}

.ref-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ref-card {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-decoration: none;
  transition: all 0.15s;
}

.ref-card:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.ref-type {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.ref-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.ref-authors {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 2px;
}

.modal-footer {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-sub);
}

.modal-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 5px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 4px;
}
