:root {
    --accent-color: #0c466d;
    --accent-color-light: color-mix(in srgb, var(--accent-color) 40%, white 60%);
    --farthest-color: #ffd000;
    --farthest-color-soft: color-mix(in srgb, var(--farthest-color) 50%, black 50%);
    
    --speed: 0.1s;
}

body,
html {
    margin: 0;
    height: 100%;
    color-scheme: light dark;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

#map {
    height: 100vh;
}

.leaflet-container {
    background: color-mix(in srgb, var(--accent-color) 30%, #000000 70%);
}

.photo-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;

    /* overflow: hidden; */
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.55);
    position: absolute;
}

.photo-marker svg {
    width: 50%;
    height: 50%;
    color: color-mix(in srgb, var(--farthest-color) 80%, #ff0000 20% );

    z-index: 10;
    position: absolute;
    top: -15px;
    right: -3px;
    rotate: 29deg;
}

/*Crop image to circular container*/
.photo-marker-wrapper{
    width: 100% !important;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.photo-marker-wrapper img {
    width:  100% !important;
    height: 100% !important;

    object-fit: cover  !important; 
} 

.photo-marker.farthest {
    border: 3px solid var(--farthest-color);
    animation: glow 4s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 4px var(--farthest-color);
    }    
    to {
        box-shadow: 0 0 8px var(--farthest-color);
    }
}

.photo-marker:hover img {
    transform: scale(1.1);
}


.farthest .leaflet-popup-content-wrapper{
    position: relative;
    border: 3px solid var(--farthest-color);
    background: #171600;
    color: #fff;
    overflow: hidden;
    background: linear-gradient(-45deg, #171600 30%, var(--farthest-color-soft) 35%, #171600 40%, var(--farthest-color-soft), #171600 60%);
    background-size: 500%;
    background-position-x: 100%;
    animation: epic 5s infinite linear;

    box-shadow: 0 0 8px var(--farthest-color);
}
.farthest .leaflet-popup-content-wrapper .popup-content {
    color: #fff;
}


/* animation moves the streak across */
@keyframes epic {
    0% {
        background-position-x: 100%
    }
    20%{
        background-position-x: 0%
    }
    100%{
        background-position-x: 0%
    }
}


.leaflet-popup-content-wrapper .leaflet-popup-content {
    margin: 8px;
    border-radius: 8px;
}



.popup-content {
    max-width: 70vw;
    min-width: 250px;
    max-height: 80vh;
    /* limit popup height */
    box-sizing: border-box;
    font-family: sans-serif;
    font-size: 14px;
    color: #333;
    text-align: center;
    overflow: auto;
    pointer-events: none;
}

.popup-image img,
.popup-image video {
    width: 100%;
    height: auto;
    /* maintain aspect ratio */
    object-fit: contain;
    border-radius: 6px;
    margin-top: 5px;
    margin-bottom: 10px;
    display: block;
}

.popup-text {
    font-size: 14px;
    text-align: left;
}

.title-row {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
}

.datetime {
    text-align: left;
    font-size: 10px;
    color: #909090;
}

.city-name {
    text-align: left;
    font-size: 16px;
}

.distance {
    font-size: 12px;
    font-family: monospace;
}

.custom-cluster-wrapper {
    background: transparent;
}

.custom-cluster {
    width: var(--cluster-size);
    height: var(--cluster-size);
    font-size: calc(var(--cluster-size) * .6);

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    border: 3px solid var(--accent-color);

    background: var(--accent-color-light);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.75);

    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 800;

    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(32, 32, 32, 0.318);

    transition: var(--speed);
    cursor: pointer;
}

.control-button {
    width: 35px;
    height: 35px;

    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-color-light);
    border: 3px solid var(--accent-color) !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.75);

    color: var(--accent-color);
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 800;
    font-size: 20px;
    cursor: pointer;

    transition: var(--speed);
    overflow: hidden;
}

.control-button:hover,
.custom-cluster:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease-in-out;
}

.control-button svg {
    width: 65%;
    height: 65%;
}

.layer-switcher-panel {
    visibility: hidden;
    overflow: hidden;
    position: absolute;
    right: 45px;
    top: 0;
    min-width: 150px;
    max-height: 0;
    font-size: 14px;

    color: var(--accent-color);
    background: var(--accent-color-light);

    border-radius: 8px;
    border: 3px solid var(--accent-color);

    opacity: 0;
    transition: visibility 0s, opacity 0.1s ease, max-height 0.1s ease;
}

.control-button,
.layer-switcher-panel {
    /* Prevents text selection because it is annoying*/
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.layer-switcher-panel.visible {
    visibility: visible;
    max-height: 300px;
    opacity: 1;
}

.layer-switcher-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--speed);
    font-weight: 100;
}

.layer-switcher-item img {
    height: 40px;
    border-radius: 5px;
}

.layer-switcher-item:hover {
    background: color-mix(in srgb, var(--accent-color) 10%, rgba(255, 255, 255, 0.3) 90%);
    transform: scale(1.05);
}

.layer-switcher-item.selected {
    background: color-mix(in srgb, var(--accent-color) 10%, rgba(255, 255, 255, 0.3) 90%);
    transform: scale(1.05);
    font-weight: 700;
}

.layer-switcher-item.selected img {
    background: color-mix(in srgb, var(--accent-color) 10%, rgba(255, 255, 255, 0.3) 90%);
    transform: scale(1.05);
    border: 3px solid var(--accent-color) !important;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(2px);
    background: color-mix(in srgb, var(--accent-color) 50%, rgba(0, 0, 0, 0.5) 50%);
    color: black;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--accent-color-light);
    border: 3px solid var(--accent-color);

    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    box-shadow: 0 2px 100px rgba(0, 0, 0, 0.4);
    font-family: sans-serif;
}

.close-modal {
    float: right;
    font-size: 20px;
    cursor: pointer;
}