@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

html,
body {
    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background: #263d19;
}

/* ============================================================
   BACK TO MAIN SITE
   ============================================================ */

#header {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    height: 0;
    z-index: 20;
}

#header .back-link {
    position: absolute;
    left: 12px;
    top: 12px;

    padding: 7px 10px;

    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 5px;

    background: rgba(38, 61, 25, 0.75);

    color: white;

    font-family: "Lato", sans-serif;
    font-size: 14px;
    font-weight: 700;

    text-decoration: none;

    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

#header .back-link:hover {
    background: rgba(38, 61, 25, 0.95);
}


/* ============================================================
 * BROWSER WARNING POPUP
 * ============================================================ */

#browser-warning-popup {
    display: none;

    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: 90vw;
    max-width: 420px;
    max-height: 80vh;
    max-height: 80dvh;
    overflow-y: auto;

    box-sizing: border-box;
    padding: 24px;

    background: white;
    color: #333;
    font-family: Arial, Helvetica, sans-serif;

    z-index: 120;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#browser-warning-popup h2 {
    margin: 0 0 20px;
    font-size: 22px;
}

#browser-warning-popup p {
    font-size: 17px;
    line-height: 1.5;
}


/* ============================================================
   MAP
   ============================================================ */

#map-container {

    position: absolute;

    left: 0;
    top: 0px;
    right: 0;
    bottom: 52px;

    overflow: hidden;

    background: #263d19;

    touch-action: none;
}


#map-image {

    position: absolute;

    left: 0;
    top: 0;

    transform-origin: 0 0;

    user-select: none;

    -webkit-user-select: none;

    -webkit-user-drag: none;

    pointer-events: none;
}


/* ============================================================
   GPS POSITION MARKER
   ============================================================ */

#position-marker {

    position: absolute;

    width: 24px;
    height: 24px;

    margin-left: -12px;
    margin-top: -12px;

    border-radius: 50%;

    background:
        rgba(255, 150, 210, 0.60);

    border:
        2px solid
        rgba(0, 0, 0, 0.95);

    box-sizing: border-box;

    z-index: 10;

    display: none;

    pointer-events: none;
}


/* ============================================================
   GPS ACCURACY CIRCLE
   ============================================================ */

#accuracy-circle {

    position: absolute;

    border-radius: 50%;

    background:
        rgba(0, 120, 255, 0.15);

    border:
        1px solid
        rgba(0, 100, 255, 0.45);

    box-sizing: border-box;

    transform:
        translate(-50%, -50%);

    z-index: 8;

    pointer-events: none;

    display: none;
}


/* ============================================================
   BOTTOM CONTROLS
   ============================================================ */

#controls {

    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    height: 52px;

    background:
        rgba(255, 255, 255, 0.95);

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 6px 8px;

    box-sizing: border-box;

    z-index: 20;

    box-shadow:
        0 -1px 5px
        rgba(0, 0, 0, 0.20);
}


/* ============================================================
   GPS BUTTON
   ============================================================ */

#gps-button {
    height: 40px;
    min-width: 0;
    padding: 0 10px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid #888;
    border-radius: 6px;
    background: #cccccc;
    color: #222;
    box-sizing: border-box;
    white-space: nowrap;
    touch-action: manipulation;
    text-align: center;
}


#gps-button:active {
    background: #d5d5d5;
}


/* ============================================================
   MAP OPTIONS POPUP
   ============================================================ */

#options-popup {
    display: none;

    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: 90vw;
    max-width: 420px;
    max-height: 80vh;
    max-height: 80dvh;
    overflow-y: auto;

    box-sizing: border-box;
    padding: 24px;

    background: white;
    color: #333;
    font-family: Arial, Helvetica, sans-serif;

    z-index: 110;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#options-popup h2 {
    margin: 0 0 20px;
    font-size: 22px;
}

#options-popup label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 1px;
    padding-bottom: 1px;
    font-size: 17px;
}

#poi-checkbox,
#manholes-checkbox,
#manholes1-checkbox 
{
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.options-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.options-actions button {
    padding: 10px 16px;
    font-size: 16px;
    cursor: pointer;
    touch-action: manipulation;
}


/* ============================================================
   KEY
   ============================================================ */

.overlay-option {
    display: flex;
    align-items: center;
    gap: 8px;
}


.overlay-option button {
    box-sizing: border-box;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}


.overlay-empty-checkbox {
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid #888;
    border-radius: 3px;
    display: block;
}

.image-overlay-symbol {
    box-sizing: border-box;
    margin: 0;
}

.legend-marker {
    display: block;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    box-sizing: border-box;
    border-radius: 50%;
    margin: 0;
    padding: 0;
    position: static;
    transform: none;
}


/* ============================================================
   IMAGE OVERLAY
   ============================================================ */


#overlay-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;

    pointer-events: none;

    z-index: 5;
}

.map-image-overlay {
    position: absolute;
    left: 0;
    top: 0;

    transform-origin: 0 0;

    pointer-events: none;

    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

/* ============================================================
   POINTS OF INTEREST BUTTON
   ============================================================ */

#option-button {
    height: 40px;
    min-width: 0;
    margin-left: 8px;
    padding: 0 10px;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid #888;
    border-radius: 6px;
    background: #cccccc;
    color: #222;
    box-sizing: border-box;
    white-space: nowrap;
    touch-action: manipulation;
    text-align: center;    
}


#option-button:active {
    background: #d5d5d5;
}


#poi-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;

    pointer-events: none;

    z-index: 9;
}

/* ============================================================
   POINTS OF INTEREST PINS
   ============================================================ */

.poi-pin {
    position: absolute;
    width: 28px;
    height: 28px;
    margin-left: -14px;
    margin-top: -28px;

    background: #d22;
    border: 2px solid white;
    border-radius: 50% 50% 50% 0;

    transform: rotate(-45deg);

    box-shadow:
        0 1px 4px
        rgba(0, 0, 0, 0.45);

    z-index: 9;

    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
}


/*
 * The centre of the pin.
 */
.poi-pin::after {
    content: "";
    position: absolute;

    width: 9px;
    height: 9px;

    left: 7px;
    top: 7px;

    background: white;
    border-radius: 50%;
}


/* Shared style for all map points. */
.map-point,
.map-point-square {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    z-index: 9;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    box-sizing: content-box;
}

/* Circular map point. */
.map-point {
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 50%;
}

/* Square map point. */
.map-point-square {
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 0;
}

/* Centre circular and square markers in the options button. */
.overlay-marker-control .map-point,
.overlay-marker-control .map-point-square {
    position: static;
    margin: 0;
    transform: none;
    cursor: default;
    pointer-events: none;
    z-index: auto;
}

/* ============================================================
   VISITED POI MARKERS
   ============================================================ */

.poi-pin.visited,
.map-point.visited,
.map-point-square.visited {
    border-color: #010101;
}


/* ============================================================
   POI VISITED BUTTON
   ============================================================ */

#poi-visited {
    display: none;
    margin-top: 12px;
    padding: 8px 16px;
    width: auto;
    cursor: pointer;
    touch-action: manipulation;
}

.legend-marker-frame {
    position: relative;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.legend-marker-frame .poi-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    margin: 0;
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
    cursor: default;
}
/* ============================================================
   POINTS OF INTEREST POPUP
   ============================================================ */

#poi-popup {
    position: fixed;

    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    width: 90vw;
    max-width: 400px;
    max-height: 80vh;
    max-height: 80dvh;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;

    background: white;
    padding: 20px;
    box-sizing: border-box;

    z-index: 100;

    display: none;

    font-family: Arial, Helvetica, sans-serif;
}

/* ============================================================
   POI POPUP CLOSE BUTTON
   ============================================================ */

#poi-close {
    position: absolute;

    right: 8px;
    top: 8px;

    width: 36px;
    height: 36px;

    padding: 0;

    font-size: 26px;
    line-height: 32px;

    border: none;
    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.90);

    color: #333;

    z-index: 2;

    touch-action: manipulation;
}


#poi-close:active {
    background: #ddd;
}


/* ============================================================
   POI POPUP IMAGE
   ============================================================ */

#poi-image {
    display: none;

    width: 100%;
    height: auto;

    max-height: 400px;

    object-fit: contain;
}

/* ============================================================
   POI POPUP TEXT
   ============================================================ */

#poi-title {
    margin:
        4px 40px
        8px 4px;

    font-size: 22px;
    line-height: 1.2;
}


#poi-text {
    margin:
        0 4px
        6px 4px;

    font-size: 16px;
    line-height: 1.45;

    white-space: pre-line;

}

/* ============================================================
   ZOOM BUTTONS
   ============================================================ */

#zoom-controls {

    position: absolute;

    right: 12px;
    top: 12px;

    z-index: 30;

    display: flex;

    flex-direction: column;

    gap: 6px;
}


#zoom-controls button {

    width: 44px;
    height: 44px;

    padding: 0;

    font-size: 28px;

    line-height: 40px;

    background:
        rgba(255, 255, 255, 0.90);

    border:
        1px solid #777;

    border-radius: 6px;

    box-shadow:
        0 1px 4px
        rgba(0, 0, 0, 0.35);

    touch-action: manipulation;
}


#zoom-controls button:active {

    background: #ddd;
}


#gps-status {
    margin-left: 10px;

    font-size: 14px;

    color: #555;

    white-space: nowrap;
}
