@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

/* "Default" */

:root {
    --mobile-width: 768px;
    --offset-hide-form-mobile: 0px;
}

* {
    box-sizing: border-box;
    font-family: "Montserrat", sans-serif;
}

body {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.5rem 0 1rem;
    background-color: white;
    color: black;
}

body.no-scroll {
    /*overflow: hidden;*/
}

.appContent {
    position: relative;
}

label {
    display: block;
}

input:not([type="radio"]):not([type="checkbox"]),
select {
    border: 2px solid #c8c8c8;
    border-radius: 8px;
    padding: 0 8px;
    height: 40px;
    width: 100%;
    font-size: 13px;
}

input[type="range"].slider {
    height: 24px;
}

input[type="radio"] {
    accent-color: #201f1f;
    height: 16px;
    width: 16px;
}

/* Utility */

.mt-4 {
    margin-top: 1rem;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #564946;
    color: white;
    border: 2px solid black;
    border-radius: 8px;
    height: 40px;
    width: 100%;
    max-width: 400px;
    padding: 0;
    transition: 0.2s ease-in-out;
    gap: 6px;
    font-size: 13px;
}

.btn:hover:not(:disabled) {
    cursor: pointer;
    opacity: 0.9;
}

.btn:disabled {
    background-color: lightgrey;
    border-color: grey;
    color: grey;
}

.btn-secondary {
    position: relative;
    background-color: white;
    color: #201f1f;
    max-width: 450px;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #eeeded;
    border-color: rgba(32, 31, 31, 0.6);
    opacity: 1;
}

.btn-secondary.active {
    background-color: #e2453c;
    /* border-color: #E2453C; */
    color: white;
    opacity: 1;
}

/* Animation */

@keyframes spin {
    100% {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

/* Leaflet */

#map {
    height: 500px;
}

/* .cursor-marker {
    cursor: url(./../images/marker.png) 16 38, auto !important;
} */
.cursor-marker-0 {
    cursor:
        url(../assets/images/markerSD.png) 16 43,
        auto !important;
}

.cursor-marker-1 {
    cursor:
        url(../assets/images/markerRedSD.png) 16 43,
        auto !important;
}

.leaflet-interactive {
    cursor: inherit;
}

.display-mode-container {
    align-items: center;
    display: flex;
    margin-top: 12px;
}

.display-mode-container label {
    display: inline-block;
    user-select: none;
}

.display-mode-container label:not(:first-child) {
    margin-left: 18px;
}

.display-mode-container input {
    position: relative;
    top: 3.5px;
}

.btn-cancel-request {
    background-color: #e2453c;
    border-color: #e2453c;
}

.btn-cancel-request img {
    animation: spin 1s linear infinite;
}

/* Mobile */
.coord-mobile {
    display: none;
}

@media only screen and (max-width: 900px) {
    :not(.hide-form) .toggle-form-display {
        /* position: fixed; */
        top: -56px;
        right: 0;
        transition: 0.5s ease-in-out;
    }

    .hide-form .toggle-form-display {
        top: 0;
        right: -56px;
        transition: 0.5s ease-in-out;
    }

    .coord-mobile {
        display: block;
        position: fixed;
        width: calc(100% - 64px);
    }

    .aiming.hide-form > .coord-mobile {
        bottom: 32px;
        /* offset form */
        left: 32px;
        transition: 0.5s ease-in-out;
    }

    .coord-mobile {
        bottom: -128px;
        left: 32px;
        transition: 0.5s ease-in-out;
    }

    /* Legends */

    .legend-controls {
        width: 72px;
    }
}

@media only screen and (orientation: landscape) and (max-width: 900px) {
    :not(.hide-form) .toggle-form-display {
        /* position: fixed; */
        top: 56px;
        right: -56px;
        transition: 0.5s ease-in-out;
    }
}

/* That awesome spinner ! */

.lds-dual-ring,
.lds-dual-ring:after {
    box-sizing: border-box;
}
.lds-dual-ring {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: auto;
    color: #20202080;
}
.lds-dual-ring:after {
    content: " ";
    display: block;
    width: 16px;
    height: 16px;
    color: #20202080;
    border-radius: 50%;
    border: 6.4px solid currentColor;
    border-color: currentColor transparent currentColor transparent;
    animation: lds-dual-ring 1.2s linear infinite;
}
@keyframes lds-dual-ring {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Toast */

#toast {
    --loader-width: 24px;

    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    /* background-color: #E2453C; */
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.17);
    z-index: 1000;
    transition:
        top 0.5s ease-in-out,
        width 1s ease-in-out;
    background: white linear-gradient(to bottom, white, #f0f0f0);
}

#toast .loader {
    box-sizing: content-box;
    width: var(--loader-width);
    height: var(--loader-width);
    top: 1px;
    left: 1px;
    bottom: 1px;
    right: 1px;
    margin: 8px;
    border-radius: 50%;
    position: relative;

    animation: rotate 12s linear infinite;
}
#toast .loader::before,
.loader::after {
    content: "";
    top: 2px;
    left: 2px;
    bottom: 2px;
    right: 2px;
    box-sizing: border-box;
    position: absolute;
    border-radius: 50%;
    animation: go 2s ease-in-out infinite;
    border: 2px solid #201f1f;
}
#toast .loader::after {
    border-color: #e2453c;
    top: 6px;
    left: 6px;
    bottom: 6px;
    right: 6px;
    animation: go 2s ease-in-out infinite reverse;
}

#toast p {
    line-height: normal;
    position: relative;
    margin: auto;
    opacity: 1;
    transition:
        opacity 0.5s ease-in-out,
        line-height 0.5s ease-in-out;
}

#toast p.noline {
    line-height: 0;
}

#toast p.hidden {
    opacity: 0;
    transition:
        opacity 0.5s ease-in-out,
        line-height 0.5s ease-in-out;
}

#toast.hidden {
    top: -120px;
    transition: top 0.5s ease-in-out;
}

#toast-content {
    font-weight: 500;
    /* transition: opacity 0.5s ease-in-out; */
}

#toast-spacer {
    height: 16px;
    position: relative;
    opacity: 0;
}

@keyframes go {
    0% {
        clip-path: polygon(
            50% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%
        );
    }
    10% {
        transform: rotate(0deg);
        clip-path: polygon(
            50% 50%,
            0% 0%,
            50% 0%,
            50% 0%,
            50% 0%,
            50% 0%,
            50% 0%,
            50% 0%,
            50% 0%
        );
    }
    20% {
        clip-path: polygon(
            50% 50%,
            0% 0%,
            50% 0%,
            100% 0%,
            100% 50%,
            100% 50%,
            100% 50%,
            100% 50%,
            100% 50%
        );
    }
    30% {
        clip-path: polygon(
            50% 50%,
            0% 0%,
            50% 0%,
            100% 0%,
            100% 50%,
            100% 100%,
            50% 100%,
            50% 100%,
            50% 100%
        );
    }
    40% {
        clip-path: polygon(
            50% 50%,
            0% 0%,
            50% 0%,
            100% 0%,
            100% 50%,
            100% 100%,
            50% 100%,
            0% 100%,
            0% 50%
        );
    }
    50% {
        clip-path: polygon(
            50% 50%,
            50% 0%,
            50% 0%,
            100% 0%,
            100% 50%,
            100% 100%,
            50% 100%,
            0% 100%,
            0% 50%
        );
    }
    60% {
        clip-path: polygon(
            50% 50%,
            100% 50%,
            100% 50%,
            100% 50%,
            100% 50%,
            100% 100%,
            50% 100%,
            0% 100%,
            0% 50%
        );
    }
    70% {
        clip-path: polygon(
            50% 50%,
            50% 100%,
            50% 100%,
            50% 100%,
            50% 100%,
            50% 100%,
            50% 100%,
            0% 100%,
            0% 50%
        );
    }
    80% {
        clip-path: polygon(
            50% 50%,
            0% 100%,
            0% 100%,
            0% 100%,
            0% 100%,
            0% 100%,
            0% 100%,
            0% 100%,
            0% 50%
        );
    }
    90% {
        transform: rotate(360deg);
        clip-path: polygon(
            50% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%
        );
    }
    100% {
        clip-path: polygon(
            50% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%,
            0% 50%
        );
    }
}
