/* Google fonts  ---------------------------- */
.slackey {
  font-family: "Slackey", sans-serif;
  font-weight: 400;
  font-style: normal;
}
/* Layout  ---------------------------- */
:root {
  --primary: hotpink;
  --primary-hover: pink;
  --primary-focus: rgba(92, 107, 192, 0.125);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100vh;
  overflow: hidden;
  user-select:none;
  -webkit-tap-highlight-color:rgba(0,0,0,0);
}

article { margin-top: 0; }
h1, h2, h3 { font-weight: normal; font-family: "Slackey", sans-serif; }

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: none;
  padding: 0;
  margin: 0;
}

/* Header Styles */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 2rem;
  background-color: #333;
  border-bottom: 1px solid #000;
  box-shadow: 0 4px 2px -2px rgba(0, 0, 0, .4);
  flex-shrink: 0;
}

.header h1 {
  color: #fff;
  margin: 0;
  font-size: 1.5rem;
  text-shadow: -1px -1px 0 hotpink, 1px -1px 0 hotpink -1px 1px 0 hotpink 1px 1px 0 hotpink;
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-container button {
  margin: 0;
  padding: 0.5rem 1rem;
}

.nav-container details {
  margin: 0 1rem 0 0;
}

.nav-container details summary {
  padding: 0.5rem 1rem;
  margin: 0;
  cursor: pointer;
}

.nav-container details a.active,
.nav-container details a.active:hover {
  background: limegreen;
  color:#333;
}

/* Dropdown styling */
details[role="list"] summary + ul {
  right: 0;
  left: auto;
  min-width: 150px;
  background: #000;
  border: #000;
}
details[role="list"] summary + ul li a { padding: .5rem 2rem; color: #eee; }
details[role="list"] summary + ul li a:hover { background: rgba(255,255,255,0.2); }
.nav-container details summary { border: 1px solid rgba(255,255,255,0.1); }

/* Menu Layout */
#menu {
  z-index: 999999;
  display: flex;
  position: fixed;
  top: 0; right: -400px;
  width: 400px;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  border-left: 2px solid #000;
  transition: right .2s ease;
}

.menu-btn {
  display: none;
}

.menu-toggle-label {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  cursor: pointer;
  z-index: 9999999;
}


.menu-btn:checked ~ #menu {
  right: 0;
}
.menu-toggle-label .icon-menu {
  color: #ccc;
  display: block;
}
.menu-toggle-label .icon-close {
  display: none;
}
.menu-btn:checked ~ .menu-toggle-label .icon-menu {
  display: none;
}
.menu-btn:checked ~ .menu-toggle-label .icon-close {
  display: block;
}

#menu ul {
  padding-top: 3rem;
  display: block;
  margin: 0; /* Removes default margin */
  width: 100%;
}

#menu li {
  width: 100%; /* Ensures each list item is full width */
  margin-bottom: 5px; /* Adds some space between items */
}
#menu ul li { width: 100%; }
#menu.open { right: 0; }
.menu-btn:checked ~ #menu {
  right: 0;
}
#menu li button {
  display: block; 
  padding: 15px 20px;
  background-color: rgba(0,0,0,0.1);
  color: #ddd;
  border-radius: 0;
  border: none;
  text-align: left;
}

#menu li button:hover {
  background-color: limegreen;
  color: #333;
}
#menu li button svg { opacity: .5; display: inline-block; margin-right: 1rem; }


/* Main Layout */
.main-layout {
  background: #fff;
  display: flex;
  flex: 1;
  overflow: hidden;
  padding-bottom: 40px;
}

.scale {
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 5px;
  gap: 5px;
  display: flex;
  align-items: center;
}

.scale > div {
  margin-bottom: var(--spacing);
}

.scale button {
  background: transparent;
  border: 1px solid rgba(0,0,0,0.2);
  padding: .5rem;
  color: #777;
}

@media (min-width: 768px) {
  .scale {
    justify-content: center;
  }
  
  .scale > div {
    margin-bottom: 0;
  }
  
  /* Make the zoom container take up the available space */
  .scale > div:first-child {
    flex-grow: 1;
  }
  
  /* Adjust spacing between the zoom components and buttons */
  .scale > div:first-child label {
    margin-right: var(--spacing);
  }
}

/* Ensure the zoom elements are aligned horizontally */
.scale > div:first-child {
  display: flex;
  align-items: center;
}

/* Toolbar */
/* .toolbar { background: #00426f; } */
.toolbar { position: fixed; left: 0; top: 6rem; width: 50px;
  z-index: 99998;
}
.toolbar article { background: transparent; box-shadow: none; margin: 0; padding: 5px 5px 5px 0; }
.draggable {
  position: fixed;
  top: 100px;
  left: 20px;
  width: 64px;
  padding: 2px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  cursor: grab;
  transition: transform 0.1s ease-out;
  z-index: 1000;
}

.drag-handle { font-size: 70%;}
.draggable:active,
.draggable.is-dragging {
  cursor: grabbing;
}

/* Add a subtle visual cue for keyboard focus */
.draggable:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Main Content */
.main-content {
  display: flex;
  flex: 1;
  overflow: auto;
  background: white;
  justify-content: center;
}
.main-content article { box-shadow: none; }



/* Toolbar Tiles  ---------------------------- */
/* .legend { */
  /* padding: 20px; */
/* } */


.tile-selector {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2px;
}
.tile-selector div { text-align: left; }
.tile-selector span {
  padding: 5px;
}

.tile-option {
  padding: 8px;
  /* margin-left: -3px; */
  border: 2px solid rgba(0,0,0,.4);
  cursor: pointer;
  border-radius: 2px;
  text-align: center;
  font-weight: bold;
  font-size: 12px;
  transition: all 0.2s ease;
  background-color: skyblue;
  color: #222;
  background-repeat: no-repeat;
  background-size: 24px;
  background-position: 90% 90%;
}

.tile-option.selected {
  color: #222;
  border-color: crimson;
  background-color: rgba(255,255,255,.5);
}

.tile-option:hover {
  border-color: crimson;
  transform: scale(1.02);
}

.tile-option div:first-child {
  font-size: 11px;
  margin-bottom: 4px;
}

.tile-option div:last-child {
  font-size: 16px;
  font-weight: bold;
}

/* Map  ---------------------------- */
.map-container {
  transform: scale(.7);
  transform-origin: top center;
  min-height: 100%;
}

.map-grid {
  display: inline-grid;
  gap: 1px;
  background: #333;
  border: 2px solid #333;
  border-radius: 4px;
}

.tile {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}

.tile-0 { background: #fff; color: #333; }
.tile-1 { background: #444; color: #fff; }
.tile-P { background: #4CAF50; color: #fff; }
.tile-L { background: #FFD700; color: #333; }
.tile-K { background: orange; color: #333; }
.tile-D { background: #f44336; color: #fff; }
.tile-C { background: #600; color: #fff; }
.tile-S { background: hotpink; color: #fff; }
.tile-E { background: #9C27B0; color: #fff; }

/* Map  ---------------------------- */
.export-import { padding: 20px; }
.export-import h3 { margin-top: 0; margin-bottom: 15px; color: #333; }

.export-import textarea {
  width: 100%;
  height: 200px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 10px monospace;
  background: #ccc;
  color: #222;
  resize: vertical;
}

button.icon { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); transition: all .4s ease-in; }
button.icon:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }
button.icon span { display: none; }
button.icon.muted { opacity: .5; background: transparent; border: none; }
button.icon.muted:hover { opacity: 1; }

button:active {
  transform: translateY(1px);
}

#map-info { position: fixed; bottom: 0; right: 20px; background: rgba(255, 255,255,0.5); color: #222; padding: 2px; }

.status {
  position: absolute;
  bottom: 30px;
  right: 10px;
  margin-top: 10px;
  padding: 12px;
  display: none;
  font-weight: bold;
  font-size: 20px;
  box-sizing: border-box !important;
  border: 5px solid rgba(0,0,0,0.5);
  border-radius: 5px;
  opacity: 0;
  transition: opacity .5s ease;
  z-index: 99999;
}

.status.show { opacity: 1; }

.status.success {
  background: #d4edda;
  color: #155724;
  border-color: darkgreen;
}

.status.note {
  background: #cdcdcd;
  color: #333;
  border-color: #333;
}

.status.error {
  background: #f8d7da;
  color: #721c24;
  border-color: crimson;
}

/* Modals  ---------------------------- */
dialog article { width: 100%; background: transparent; border: none; box-shadow: none; }

.controls {
  position: relative;
  background: #fff;
  padding: 30px;
  border-radius: 5px;
  border-bottom: 1px solid #eee;
}

.controls .close { position: absolute; top: 40px; right: 20px; }
.controls .close:hover { color: black; cursor: pointer; }

.controls h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 200%; 
  color: crimson;
}

.control-group {
  width: 45%; display: inline-block;
  margin-bottom: 15px;
}

.control-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
  color: #555;
}

.control-group input {
  width: 80px;
  padding: 8px;
  margin-right: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #ccc; color: #222;
}

.control-buttons {
  display: flex;
  gap: 10%;
  margin-top: 15px;
}

dl {
  display: grid;
  grid-template-columns: 40% 60%;
  gap: 1em;
  color: #333;
}

dt {
  font-weight: bold; /* Optional styling for the term */
}

dd {
  margin: 0; /* Resets the default margin of the dd element */
}

