@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Saira:ital,wght@0,100..900;1,100..900&display=swap');


/* root */
:root {
    --primary-100: #0c1117;
    --primary-200: #121e2c;
    --secondary: #fdc241;
    --font-color: #ffffff;

    --font: 'Outfit', sans-serif;
    --font-alt: 'Saira', sans-serif;

    --radius-s: 6px;
    --radius-m: 12px;
    --radius-l: 18px;
}


/* base */
* {
    box-sizing: border-box;
    outline: none;
    border: none;
    padding: 0;
    margin: 0;
    text-decoration: none;
}



/* body */
body {
    background: var(--primary-100);
    color: var(--font-color);
    font-family: var(--font);
}



/* header */
header {
    display: flex;
    align-items: center;
    background: var(--primary-200);
    width: fit-content;
    padding: 0.5rem 1rem;
    margin: 0.5rem;
    border-radius: var(--radius-m);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}



/* map grid */
#map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}



/* map card */
.map-card {
    display: flex;
    flex-direction: column;
    background: var(--primary-200);
    outline: 3px solid transparent;
    user-select: none;
    transition: 0.2s ease;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);

    &:hover {
        outline-color: var(--secondary);
    }
}

/* map image */
.map-image {
    width: 100%;
    aspect-ratio: 3 / 3.7;
    object-fit: cover;
    -webkit-user-drag: none;
    z-index: 1;
}

/* map name */
.map-name {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-alt);
    text-align: center;
    color: var(--secondary);
    text-transform: uppercase;
    padding: 1rem;
    margin: 5px;
    text-decoration: none;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    background:
        linear-gradient(to right, var(--secondary), transparent) top left / 10px 1px no-repeat,
        linear-gradient(to bottom, var(--secondary), transparent) top left / 1px 10px no-repeat,
        linear-gradient(to left, var(--secondary), transparent) top right / 10px 1px no-repeat,
        linear-gradient(to bottom, var(--secondary), transparent) top right / 1px 10px no-repeat,
        linear-gradient(to right, var(--secondary), transparent) bottom left / 10px 1px no-repeat,
        linear-gradient(to top, var(--secondary), transparent) bottom left / 1px 10px no-repeat,
        linear-gradient(to left, var(--secondary), transparent) bottom right / 10px 1px no-repeat,
        linear-gradient(to top, var(--secondary), transparent) bottom right / 1px 10px no-repeat;
}

/* map preview */
.map-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
    box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.5);
    padding: 0.25rem;
    outline: 3px solid var(--primary-200);
    background:
        linear-gradient(to right, var(--secondary), transparent) top left / 10px 1px no-repeat,
        linear-gradient(to bottom, var(--secondary), transparent) top left / 1px 10px no-repeat,
        linear-gradient(to left, var(--secondary), transparent) top right / 10px 1px no-repeat,
        linear-gradient(to bottom, var(--secondary), transparent) top right / 1px 10px no-repeat,
        linear-gradient(to right, var(--secondary), transparent) bottom left / 10px 1px no-repeat,
        linear-gradient(to top, var(--secondary), transparent) bottom left / 1px 10px no-repeat,
        linear-gradient(to left, var(--secondary), transparent) bottom right / 10px 1px no-repeat,
        linear-gradient(to top, var(--secondary), transparent) bottom right / 1px 10px no-repeat;
}

/* coordinates */
.coords {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--primary-200);
    color: white;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 999;
}

/* map wrapper */
.map-wrapper {
    display: flex;
    align-self: center;
    justify-self: center;
    position: relative;
    overflow: hidden;
    width: 90%;
    height: 90vh;
    cursor: grab;
    -webkit-user-drag: none;
}

/* dragging */
.map-wrapper.dragging {
    cursor: grabbing;
}

/* map */
.map {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 50% 50%;
    transition: transform 0.1s ease;
    -webkit-user-drag: none;
    background: var(--primary-200);
}

/* marker */
.marker {
    position: absolute;
    cursor: pointer;
    pointer-events: auto;
    -webkit-user-drag: none;
    user-select: none;
}

/* map popup */
.map-popup {
    position: absolute;
    min-width: 200px;
    max-width: 350px;
    background: var(--primary-200);
    color: white;
    padding: 12px;
    border-radius: 10px;
    display: none;
    z-index: 10;
}

/* popup arrow */
.map-popup::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: var(--primary-200) transparent transparent transparent;
}

/* popup title */
.map-popup h3 {
    margin: 0 0 6px;
    font-size: 16px;
}

/* popup body */
.map-popup p {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
}

/* popup images */
.popup-images {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    overflow-x: auto;
    scroll-behavior: smooth;
    max-width: 200px;
    scrollbar-gutter: none;
}

/* popup image */
.popup-images img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
}

/* scrollable popup images */
.popup-images.scrollable {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    max-width: 240px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.popup-images.scrollable::-webkit-scrollbar {
    display: none;
}

/* popup dots */
.popup-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.popup-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #333;
    cursor: pointer;
    transition: background 0.2s;
}

/* active popup dot */
.popup-dots .dot.active {
    background: #777;
}

/* popup check */
#popup-check {
    display: flex;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 13px;
    color: white;
    margin-top: 0.5rem;
    cursor: pointer;
}

/* map controls */
.map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 220px;
    z-index: 1000;
    user-select: none;
}

/* map legend */
.map-legend {
  background: var(--primary-200);
  color: white;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 1000;
  user-select: none;
}

/* legend item */
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    opacity: 1;
    padding: 0.25rem 0.75rem;

    &:hover {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* disabled legend item */
.legend-item.disabled {
    opacity: 0.4;
}

/* legend item image */
.legend-item img {
  width: 16px;
  height: 16px;
}

/* map search */
#map-search {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* search input */
#search-input {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  background: var(--primary-200);
  font-size: 13px;
  color: white;
  border: none;
  outline: none;
}

/* search results */
#search-results {
  background: var(--primary-200);
  margin-top: 4px;
  font-size: 13px;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
}

/* search item */
.search-item {
  padding: 6px;
  cursor: pointer;
  color: white;
}

/* search item hover */
.search-item:hover {
  background: rgba(255,255,255,0.1);
}

/* progress tracker */
#progress-tracker {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: var(--primary-200);
    padding: 0.5rem;
    border-radius: 6px;
    width: max-content;
    user-select: none;
}

/* progress tracker header */
#progress-tracker h3 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
}

/* progress tracker list */
#tracker-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 400px;
    overflow-y: scroll;
    user-select: none;
}

/* progress tracker list item */
#tracker-list li {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 13px;
}

/* hidden progress tracker */
#tracker-list.hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
}

/* progress tracker button */
#progress-tracker h3 .tracker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}
