/* Some colours are referenced from: https://codeberg.org/comaps/comaps/src/branch/main/android/app/src/main/res/values/colors.xml */
:root {
    --bg-light: #eeeeee;
    --bg-dark: #111111;
    --alt-green: #558b2f;
    --secondary-light: #7cbc7b;
    --secondary-dark: #37653f;
    --primary: #588157;
    --white: #ffffff;
    --black: #000000;
    --button-pressed: #999999;
    --button-pressed-dark: #666666;
    --map-border: #828282;
    --middle-grey: rgba(125, 125, 125, 0.5);
}

@font-face {
    font-family: Roboto;
    src: url(3party/roboto/RobotoVariable.ttf);
}

/* inter-200 - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: normal;
    font-weight: 200;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-200.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-200italic - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: italic;
    font-weight: 200;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-200italic.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-300 - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: normal;
    font-weight: 300;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-300.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-300italic - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: italic;
    font-weight: 300;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-300italic.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-regular - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: normal;
    font-weight: 400;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-regular.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-italic - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: italic;
    font-weight: 400;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-italic.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-500 - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: normal;
    font-weight: 500;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-500.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-500italic - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: italic;
    font-weight: 500;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-500italic.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-600 - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: normal;
    font-weight: 600;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-600.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-600italic - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: italic;
    font-weight: 600;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-600italic.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-700 - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: normal;
    font-weight: 700;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-700.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* inter-700italic - cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese */
@font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: "Inter";
    font-style: italic;
    font-weight: 700;
    src: url("./3party/inter/inter-v19-cyrillic_cyrillic-ext_greek_greek-ext_latin_latin-ext_vietnamese-700italic.woff2")
        format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh; /* fallback */
    height: 100dvh;
    background-color: var(--bg-light);
}

h1,
h2,
button {
    padding-left: 6px;
    font-weight: normal;
    padding-right: 6px;
}

body,
button {
    font-family: "Inter", Roboto, sans-serif !important;
    margin: 0;
}

header {
    height: 40px;
    background-color: var(--primary);
    color: var(--white);
    padding: 10px;
    font-size: 30px;
    display: flex;
    align-items: center;
}

#logomark {
    display: flex;
    align-items: center;
}

#logomark img {
    width: 150px;
}

#download-comaps {
    position: fixed;
    right: 10px;
    font-weight: bold;
}

#download-comaps button {
    background-color: var(--white);
    color: var(--primary);
    border: 1px solid rgba(0, 0, 0, 0);
    transition: 300ms ease;
}

#download-comaps button:hover {
    background-color: var(--secondary-dark);
    color: var(--white);
    border: 1px solid var(--white);
}

/* UI is mobile first */

#map {
    width: 100vw;
    border-bottom: var(--map-border) solid 1px;
    flex-grow: 1;
}

#poi-info {
    order: 99;
    left: 0;
    bottom: 0;
    z-index: 8000;
    min-height: 100px;
    width: 100vw;
    background-color: var(--bg-light);
    max-height: 158px;
    overflow-y: auto;
    color: var(--black);
}

#main-ui {
    max-height: 158px;
    display: flex;
    flex-direction: column;
}

#open-in,
#copy-as {
    background-color: var(--bg-light);
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100vw;
    display: none;
}

#open-in {
    z-index: 9998 !important;
}

#copy-as {
    z-index: 9999 !important;
}

button {
    background-color: var(--secondary-dark);
    color: var(--white);
    font-size: 18px;
    border-radius: 50px;
    padding: 10px;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: var(--primary);
}

#popover {
    background-color: var(--middle-grey);
    position: fixed;
    width: 100vw;
    height: 100vh;
    left: 0%;
    top: 0%;
    display: none;
}

#poi-info button {
    padding: 6px;
    width: 100%;
    background-color: var(--bg-light);
    border-radius: 0px;
    color: var(--black);
    text-align: left;
}

#poi-info h2 {
    padding-left: 6px;
}

#poi-info button:hover {
    background-color: var(--button-pressed);
}

.outline-button {
    background-color: var(--bg-light) !important;
    color: var(--alt-green) !important;
    border-color: var(--alt-green);
    border-style: solid;
    border-width: 2px !important;
    border-radius: 4px !important;
    margin-left: 4px;
    margin-right: 4px;
    max-width: 200px;
    text-align: center !important;
}

.outline-button:hover {
    background-color: var(--alt-green) !important;
    color: var(--white) !important;
}

#place-name-wrapper {
    flex-grow: 1;
    overflow-y: auto;
}

#place-name {
    word-wrap: break-word;
    margin-top: 12px;
}

#mobile-controls {
    display: flex;
    padding: 4px;
    justify-content: center;
    height: 48px;
    bottom: 0px;
    background-color: var(--bg-light);
}

.mobile-only {
    display: block;
}

.full-screen-error {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10000;
    background-color: var(--bg-light);
    color: var(--black);
    width: 100vw;
    height: 100vh;
}

#full-screen-error p,
#full-screen-error h1 {
    padding-left: 6px;
    padding-right: 6px;
}

#map p {
    font-size: 18px;
}

#copy-as button span {
    word-wrap: break-word;
}

#toast {
    z-index: 10000;
    min-width: 200px;
    background-color: var(--secondary-dark);
    color: var(--white);
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    padding: 14px;
    border-radius: 32px;
    text-align: center;
    visibility: hidden;
}

#toast.toast-active {
    visibility: visible;
    -webkit-animation:
        fadein 0.5s,
        fadeout 0.5s 2.5s;
    animation:
        fadein 0.5s,
        fadeout 0.5s 2.5s;
}

@-webkit-keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@-webkit-keyframes fadeout {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fadeout {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Desktop mode */
@media (min-width: 60em) {
    body {
        display: block;
    }

    #poi-info {
        position: fixed;
        left: 0;
        top: 60px;
        z-index: 8000;
        width: 350px;
        max-height: none;
        padding: 15px;
        overflow-y: auto;
        color: var(--black);
    }

    #main-ui {
        max-height: none;
    }

    #map {
        height: calc(100vh - 60px);
        width: calc(100vw - 380px);
        position: fixed;
        left: 380px;
        top: 60px;
        border-left: var(--map-border) solid 1px;
    }

    #mobile-controls {
        display: none;
    }
    #open-in,
    #copy-as {
        position: initial;
        display: block !important;
        width: auto;
    }

    .mobile-only {
        display: none;
    }

    #popover {
        width: 0;
        height: 0;
    }
}

@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--bg-dark);
    }
    #logomark {
        color: var(--white);
    }
    #poi-info {
        background-color: var(--bg-dark);
        color: var(--white);
    }
    #poi-info,
    #poi-info button {
        background-color: var(--bg-dark);
        color: var(--white);
    }
    #poi-info button:hover {
        background-color: var(--button-pressed-dark);
    }
    #mobile-controls {
        background-color: var(--bg-dark);
    }

    .outline-button {
        background-color: var(--bg-dark) !important;
    }

    #open-in,
    #copy-as {
        background-color: var(--bg-dark) !important;
    }

    #full-screen-error {
        background-color: var(--bg-dark);
        color: var(--white);
    }
}
