:root {
  --bg: #fdfcf8;
  --fg: #1a1a1a;
  --accent: #e85d04;
  --accent-light: #ffba08;
  --ocean: #caf0f8;
  --border: #2a2a2a;
  --muted: #6b6b6b;
  --card: #fff;
  --sidebar-bg: #fff8e7;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background:
    radial-gradient(circle at 10% 20%, rgba(232, 93, 4, 0.08) 0%, transparent 25%),
    radial-gradient(circle at 90% 80%, rgba(202, 240, 248, 0.5) 0%, transparent 30%),
    var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration: none;
}

button, .link-button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

button[type="submit"], .button {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  border-radius: 2px;
  background: var(--card);
  color: var(--fg);
  box-shadow: 3px 3px 0 var(--accent);
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

button[type="submit"]:hover, .button:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--accent);
}

button[type="submit"]:active, .button:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--accent);
}

.link-button {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  box-shadow: none;
}

.link-button:hover {
  text-decoration: none;
  transform: none;
  box-shadow: none;
}

.link-button.danger {
  color: #d00000;
}

.inline-form {
  display: inline;
  margin: 0;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 3px solid var(--border);
  background: var(--sidebar-bg);
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 2px solid var(--border);
  background: var(--accent-light);
}

.profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border: 3px solid var(--border);
  border-radius: 50%;
  background: var(--card);
}

.logo {
  display: block;
  font-weight: bold;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--fg);
  line-height: 1.2;
}

.tagline {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.3;
}

.sidebar-nav {
  padding: 1rem 0;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav li {
  margin: 0;
}

.sidebar-nav a,
.nav-form .link-button {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--fg);
  text-decoration: none;
  border-left: 4px solid transparent;
  font-weight: normal;
}

.sidebar-nav a:hover,
.sidebar-links a:hover,
.nav-form .link-button:hover {
  background: var(--bg);
  border-left-color: var(--accent);
}

.sidebar-nav a.active {
  background: var(--bg);
  border-left-color: var(--accent);
  font-weight: bold;
}

@media (max-width: 760px) {
  .sidebar-links a:hover {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
}

.nav-form {
  margin: 0;
  display: block;
}

.nav-form .link-button {
  width: 100%;
  text-align: left;
  border-radius: 0;
  border: 0;
  border-left: 4px solid transparent;
}

.sidebar-stats {
  margin: 0 1rem;
  padding: 1rem;
  border: 2px solid var(--border);
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ocean);
}

.sidebar-stats h3 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.sidebar-stats ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-stats li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.stat-number {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.1rem 0.4rem;
  margin-right: 0.25rem;
  font-weight: bold;
  background: var(--accent-light);
  border: 2px solid var(--border);
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 2px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.sidebar-links {
  padding: 1rem 0;
  border-top: 2px solid var(--border);
}

.sidebar-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-links li {
  margin: 0;
}

.sidebar-links a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--fg);
  text-decoration: none;
  border-left: 4px solid transparent;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
}

.content > h1 {
  margin-top: 0;
  font-weight: bold;
  letter-spacing: -0.03em;
}

.content > h2 {
  font-weight: bold;
  margin: 1.5rem 0 1rem;
}

form label {
  display: block;
  margin-bottom: 1rem;
}

.hint {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.coords {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .coords {
    grid-template-columns: 1fr;
  }
}

input, textarea {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 2px solid var(--border);
  border-radius: 2px;
  background: var(--card);
  color: var(--fg);
  font-family: inherit;
  font-size: inherit;
}

input:focus, textarea:focus, button:focus, a:focus {
  outline: 3px solid var(--accent-light);
  outline-offset: 2px;
}

.place-list, .pin-list {
  margin-top: 1.5rem;
}

.place-list ul, .pin-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.place-list li, .pin-list li {
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid var(--border);
  border-radius: 2px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ocean);
}

.place-list li:last-child, .pin-list li:last-child {
  margin-bottom: 0;
}

.place-list .meta, .pin-list .meta {
  display: inline-block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-right: 0.5rem;
}

.place-list .note, .pin-list .note {
  color: var(--fg);
  margin: 0.5rem 0 0;
}

.error {
  color: #d00000;
  padding: 0.75rem;
  border: 2px solid #d00000;
  background: #fff0f0;
}

.visit-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.8rem;
  font-weight: bold;
  border: 2px solid var(--border);
  background: var(--accent-light);
}

.visit-list {
  list-style: none;
  padding: 0.5rem 0 0;
  margin: 0.75rem 0 0;
  border-top: 1px dashed var(--border);
}

.visit-list li {
  padding: 0.5rem 0;
  margin-bottom: 0.25rem;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.add-visit-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
}

.add-visit-form .inline-label {
  flex: 1 1 140px;
  margin-bottom: 0;
}

.add-visit-form .small-button {
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--fg);
  box-shadow: 2px 2px 0 var(--accent);
}

.add-visit-form .small-button:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--accent);
}

.globe-preview {
  width: 100%;
  height: 520px;
  margin: 0 0 1.5rem;
  border: 3px solid var(--border);
  border-radius: 2px;
  background: var(--ocean);
  box-shadow: 6px 6px 0 var(--accent-light);
  overflow: hidden;
}

#globe-viz {
  width: 100%;
  height: 100%;
}

.globe-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
  text-shadow:
    -1px -1px 0 #1a1a1a,
    1px -1px 0 #1a1a1a,
    -1px 1px 0 #1a1a1a,
    1px 1px 0 #1a1a1a,
    0 0 4px #1a1a1a;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -120%);
}

.pin-tooltip {
  background: rgba(26, 26, 26, 0.95);
  color: #fff;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 2px;
  box-shadow: 4px 4px 0 var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 240px;
  white-space: normal;
  pointer-events: none;
}

.pin-tooltip__name {
  font-weight: bold;
  color: var(--accent-light);
  margin-bottom: 0.25rem;
}

.pin-tooltip__tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.3rem;
  font-size: 0.7rem;
  font-weight: normal;
  background: var(--ocean);
  color: #1a1a1a;
  border: 1px solid var(--border);
}

.pin-tooltip__meta {
  color: #ccc;
  font-size: 0.8rem;
}

.pin-tooltip__note {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.3);
  color: #eee;
  font-size: 0.8rem;
}

/* Make sure the tooltip wrapper doesn't override the box text color */
.scene-container .scene-tooltip {
  color: inherit;
}

.admin-add {
  max-width: 600px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--border);
  background: var(--card);
  box-shadow: 4px 4px 0 var(--accent-light);
}

.admin-add h2 {
  margin-top: 0;
}

.login-box {
  max-width: 400px;
  padding: 1rem;
  border: 2px solid var(--border);
  background: var(--card);
  box-shadow: 4px 4px 0 var(--accent-light);
}

.login-box h1 {
  margin-top: 0;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 2px dashed var(--border);
  border-radius: 2px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  margin-bottom: 1rem;
}

.secondary-button:hover {
  background: var(--sidebar-bg);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.home-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.8rem;
  font-weight: bold;
  border: 2px solid var(--border);
  background: var(--ocean);
}

#use-location-btn {
  margin-top: 1rem;
}

#location-suggestions {
  margin-bottom: 1rem;
}

.suggestion-group {
  margin-bottom: 1rem;
}

.suggestion-group h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.suggestion-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.suggestion-list li {
  margin-bottom: 0.5rem;
}

.suggestion-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: 2px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ocean);
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}

.suggestion-card:hover {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--ocean);
}

.suggestion-card strong {
  font-weight: bold;
  color: var(--fg);
}

.suggestion-location,
.suggestion-coords,
.suggestion-distance,
.suggestion-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.suggestion-hint {
  color: var(--accent);
  font-weight: bold;
}

.suggestion-card--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  box-shadow: 3px 3px 0 var(--accent-light);
}

.suggestion-card--inline:hover {
  box-shadow: 2px 2px 0 var(--accent-light);
}

.suggestion-info {
  flex: 1 1 200px;
}

.suggestion-visit-form {
  flex: 1 1 auto;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.suggestion-visit-form .inline-label {
  flex: 1 1 120px;
}

@media (max-width: 760px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: auto;
    border-right: 0;
    border-bottom: 3px solid var(--border);
  }

  .sidebar-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 1rem;
  }

  .sidebar-nav li {
    flex: 0 0 auto;
  }

  .sidebar-nav a,
  .nav-form .link-button {
    padding: 0.5rem 0.75rem;
    border-left: 2px solid transparent;
    border-bottom: 2px solid transparent;
  }

  .sidebar-nav a:hover,
  .nav-form .link-button:hover,
  .sidebar-nav a.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .sidebar-stats {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .content {
    padding: 1rem;
  }

  .globe-preview {
    height: 360px;
    box-shadow: 4px 4px 0 var(--accent-light);
  }

  .secondary-button {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
  }

  .suggestion-card,
  .suggestion-card--inline {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem;
  }

  .suggestion-visit-form {
    width: 100%;
  }

  .suggestion-visit-form .small-button {
    width: 100%;
  }
}
