/* main things */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Heebo", sans-serif;
    overflow: hidden;
}

:root {
    --background: #ffffff;
    --text-on-white: #000000;
    --text-on-black: #ffffff;
    --accent: #4421AE;
    --white-accent: #CCD5FF;
    --accent-accent: #CCD5FF;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #060A1C;
        --text-on-white: #fff;
        --text-on-black: #000;
        --accent: #4421AE;
        --white-accent: #060A1C;
        --accent-accent: #27273a;
    }
}

/* map styles (not much) */
#map {
    width: 100%;
    height: 100%;
    overflow: hidden;
    scrollbar-width: none;
    background-color: var(--background)
}

/* map controls */
.maplibregl-ctrl-top-left {
    float: left;   
    margin: 80px 0 0 5px;
}

.maplibregl-ctrl-group:not(:empty) {
    box-shadow: none;
    border: 1px solid var(--accent);
}

/* map controls */
#map-controls {
    position: fixed;
    top: 90px;
    left: 15px;
    width: 35px;
    z-index: 40000;
    display: flex;
    flex-direction: column;
}
#position-controls {
    background-color: var(--background);
    border-radius: 5px;
    border: 1px solid var(--accent);
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}
#other-controls {
    background-color: var(--background);
    border-radius: 5px;
    border: 1px solid var(--accent);
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}
#position-controls div {
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}
#other-controls div {
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}
#position-controls img {
    width: 15px;
    height: 15px;
}
#other-controls img {
    width: 15px;
    height: 15px;
}
#query-img {
    width: 20px !important;
    height: 20px !important;
}

/* slider styles */
#slider-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

#current-date-display {
    position: absolute;
    justify-self: calc(100% + 10px);
    bottom: 100px;  
    left: 100px;
    background-color: var(--accent);
    padding: 15px 20px;
    border-radius: 100px;
    margin-bottom: 10px;
    white-space: nowrap;
    color: white;
}

#slider-box {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    color: var(--background);
}

#slider {
    padding: 10px;
    min-width: 150px;
    width: 100%;
    appearance: none;
    cursor: pointer;
    outline: none;
    background-color: var(--background);
    background: var(--background);
    height: 30px;
    border-radius: 50px;
    border: 1px solid var(--accent);
    align-self: center;
    margin: 0;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 30px;
    background: linear-gradient(
        to right,
        var(--accent) 0%,
        var(--accent) var(--val),
        var(--white-accent) var(--val),
        var(--white-accent) 100%
    );
    border-radius: 20px;
}

input[type="range"]::-moz-range-track {
  height: 15px;
  background: var(--accent);
  border-radius: 16px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 90px;
    width: 30px;
    background: url('../images/slider-control.png');
    border: 0;
    position: relative;
    margin-top: calc((20px - 90px) / 2);

}

input[type="range"]::-moz-range-thumb {
    height: 90px;
    width: 30px;
    background: url('../images/slider-control.png') center/contain no-repeat;
    border: 0;
    border-radius: 0;
}

/* min and max date box styles */
#min-date-container, #max-date-container {
    position: relative;
    background-color: var(--accent);
    border-radius: 50px;
    width: auto;    
    min-width: 150px;
}
#min-date-box, #max-date-box {
    position: relative;
    margin: 10px;
    background-color: var(--accent);
    white-space: nowrap;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 60px;
    border-radius: 100px;
    padding: 10px 20px;
    z-index: 2;
}

#min-date, #max-date {
    font-size: 40px;
    font-weight: bold;
    color: #fff;
}

#min-era, #max-era {
    font-size: 30px;
    padding-top: 8px;
    color: #CCD5FF;
}

    /* and the inputs */

#selection-box {
    position: absolute;
    border: 2px solid white;
    width: 100%;
    height: 100%;
    top: -2px;
    left: -2px;
    border-radius: 100px;
    pointer-events: none;
}
#min-date-selection, #max-date-selection {
    padding: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    pointer-events: auto;
    background-color: var(--accent);
    border-radius: 50px;
    height: 100px;
}
#min-date-selection input:focus, 
#max-date-selection input:focus,
#min-date-selection select:focus, 
#max-date-selection select:focus {
    outline: none;
    border: none;
}
#min-date-selection input, #max-date-selection input {
    font-size: 40px;
    min-width: 1ch;
    margin: 0;
    height: 60px;
    background-color: var(--accent);
    border: none;
    font-weight: 700;
    color: white;
    align-self: center;
    font-family: "Heebo", sans-serif
}

#min-date-selection input::-webkit-outer-spin-button,
#min-date-selection input::-webkit-inner-spin-button,
#max-date-selection input::-webkit-outer-spin-button,
#max-date-selection input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#min-date-selection select, #max-date-selection select {
    font-size: 40px;
    margin: 0;
    height: 60px;
    background-color: var(--accent);
    border: none;
    font-weight: 700;
    color: white;
    align-self: center;
    font-family: "Heebo", sans-serif;
}

/* nav bar styles */
nav {
    display: flex;
    flex-direction: row;
    justify-content: left;
    position: fixed;
    z-index: 9999999;
}

.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    background-color: var(--background);
    margin: 10px 20px 0 10px;
    border: 1px solid var(--accent);
    padding: 10px;
    border-radius: 400px;
    height: 30px;
}

.nav-item h1 {
    font-size: 20px;
    color: var(--accent);
    padding: 0 5px;
}

.nav-item h3 {
    font-size: 15px;
    padding: 0 10px;
    white-space: nowrap;
    margin: 0;
    cursor: pointer;
    color: var(--text-on-white);
    user-select: none;
}

.greyed-out {
    color: rgb(158, 158, 158)
}
.nav-item img {
    width: 30px;
    height: 30px;
}

#scroll {
    display: flex;

    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
    height: 30px;
}

#scroll h3 {
    cursor: pointer;
    user-select: none;
}
    /* images */
#export img {
    padding: 0 10px;
    cursor: pointer;
}

#filter img {
    padding: 0 10px;
    cursor: pointer;
}

/* options */
#options-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000000;
    background-color: rgb(0 0 0 / 50%);
    display: flex;
    justify-content: center;
}
/* loading screen */
#loading-screen {
    background-color: white;
    justify-self: center;
    align-self: center;
    z-index: 20000001;
    border-radius: 10px;
    scrollbar-width: none;
    display: flex;
    flex-direction: row;
    align-items: center;
}
#load-text {
    padding: 10px;
    font-size: 1.2rem;
    font-family: 'Heebo', sans-serif;
}
#spinner {
    width: 50px;
    height: 50px;
    border: 15px solid rgba(0, 0, 0, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* layer selection */
#layer-selection {
    background-color: var(--background);
    width: 50%;
    min-width: 500px;
    max-width: 800px;
    height: auto;
    overflow-y: scroll;
    justify-self: center;
    align-self: center;
    z-index: 20000001;
    border-radius: 50px;
    scrollbar-width: none;
    padding: 40px 50px 50px 50px;
}
#top {
    display: flex;
    height: 50px;
    justify-content: space-between;
    padding: 0;
    color: var(--accent);
    align-items: center;
    padding-bottom: 20px;
}
#top img {
    width: 20px;
    height: 20px;
    cursor: pointer;
    align-self: center;
}
#top h2 { 
    margin: 0;
}

#filters {
    margin: 0;
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
}
#column-1, #column-2 {
    padding: 0;
    width: calc(100% - 30px);
}
#column-1 {
    padding-right: 5px;
}
#column-2 {
    padding-left: 5px;
}
.filter {
    width: calc(100% - 30px);
    background-color: #CCD5FF;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    animation: ease;
    animation-duration: 1000ms;
    transition: transform 150ms ease, box-shadow 150ms ease;
    user-select: none;
}
.filter:hover {
    transform: scale(1.02, 1.02);
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}
.filter-head {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 10px 5px 0 5px;
}
.filter-head h3, .filter h3, .filter h4{
    margin: 0;
    user-select: none;
}
.filter h3 {
    font-weight: 700;
    font-size: 24px;
    user-select: none;
}
.filter-subcategory h4 {
    font-weight: 600;
    font-size: 17px;
    line-height: 20px;
}
.subcategories {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    padding-bottom: 10px;
    justify-content: center;
}
.filter-subcategory {
    border-radius: 10px;
    margin: 5px;
    width: calc(50% - 35px);
    height: 40px;
    border: 1px solid white;
    background-color: #fff;
    color: black;
    padding: 5px 10px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.filter-subcategory h4 {
    margin: 0;
    text-align: center;
}
.centered-text {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-items: center;
    align-items: center;
}
#column-2 {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
#column-1 .filter {
    padding: 0;
    width: 100%;
}
#column-2 .filter {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
#labels {
    border-top-left-radius: 17px;
}
#background {
    border-top-right-radius: 17px;
}
#borders {
    border-bottom-left-radius: 17px;
}
#battles {
    border-bottom-right-radius: 17px;
}

/* styles for when an element is on */
.filter.on {
    background-color: #4421AE;
    color: white;
}

.filter.on .filter-subcategory.on {
    background-color: #4421AE;
    color: white;
    border: 1px solid #4421AE;
}


/* Save As */
#save-img-select {
    background-color: var(--background);
    width: 80%;
    max-width: 800px;
    min-width: 500px;
    overflow-y: scroll;
    justify-self: center;
    align-self: center;
    z-index: 20000001;
    border-radius: 50px;
    scrollbar-width: none;
    color: var(--text-on-white)
}
#save-img-select #top {
    margin: 30px 50px 0 50px;
}

#save-as-close-button {
    width: 25px;
    height: 25px;
}
#save-img-select li {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}
#save-img-select h3 {
    font-family: "Heebo", sans-serif;
    font-weight: 700;
    font-size: 20px;
    user-select: none;
}
#save-img-select input, #save-img-select select {
    background-color: var(--background);
    border-radius: 5px;
    font-family: "Heebo", sans-serif;
    border: none;
    padding: 0;
    font-size: 20px;
    height: 35px;
    color: var(--text-on-white);
    text-align: right;
    padding-right: 5px;
}

#save-img-select input:focus, #save-img-select select:focus {
    border: none;
}
#save-img-select hr {
    border: 1px solid rgba(0, 0, 0, 0.5);
    margin: 0 50px 10px 50px;
}
#save-img-select ol {
    margin: 0 50px 30px 50px;
    padding: 0;
}
#download-button {
    background-color: var(--accent);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 50px;
    font-size: 20px;
    margin-left: auto;
    margin-top: 20px;

}

/* right click */
#right-click {
    position: fixed;
    top: 500px;
    left: 500px;
    min-width: 150px;
    min-height: 20px;
    background-color: var(--background);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.438);
    border-radius: 20px;
    z-index: 10000;
}
#right-click ol {
    padding: 10px 0;
    margin: 5px 0;
}
#right-click li {
    padding: 0 10px;
    list-style-type: none;
    white-space: nowrap;
    font-size: 15px;
    cursor: pointer;
    color: var(--text-on-white)
}
#right-click a {
    color: var(--text-on-white);
    min-width: 100%;
}
#right-click li:hover {
    background: var(--accent-accent)
}
#right-click input {
    background-color: var(--background);
    border: none;
    color: var(--text-on-white);
    margin: 0 15px;
}
#marker {
    color:#495049; 
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.75); 
    font-size: 15px; 
    font-weight: bold;
}
/* phone styles */
#rotate-phone {
    display: none;
}
@media (max-width: 600px) and (orientation: portrait) {
    /* nav bar */
    #logo, #export, #filter {
        margin: 10px 10px 0 10px;
    }
    #logo h1 {
        display: none;
    }
    #export h3 {
        display: none;
        user-select: none;
    }
    #export {
    }
    #export img {
        align-self: center;
    }
    #scroll {
        display: none;
    }
    #filter h3 {
        display: none;
        user-select: none;
    }

    /* slider */
    #slider-box {
        height: 50px;
    }
    input[type="range"] {
        padding: 5px !important;
        height: 15px !important;
        align-self: center;
        width: 100% !important;
    }
    input[type="range"]::-webkit-slider-runnable-track {
        height: 15px;
    }
    input[type="range"]::-webkit-slider-thumb {
        box-shadow: none;
        appearance: none;
        background-size: contain; 
        height: 50px;
        width: 17px;
        margin-top: -18px;
    }
    #current-date-display {
        bottom: 50px;
        font-size: 15px;
        padding: 7px 10px;
    }
    /* date inputs */
    #min-date, #max-date {
        font-size: 20px
    }
    #min-era, #max-era {
        font-size: 15px;
    }
    #min-date-container, #max-date-container {
        min-width: 60px;
    }
    #min-date-selection select, #max-date-selection select {
        font-size: 20px;
        height: 30px;
        padding: 0;
        margin-right: 10px;
    } 
    #min-date-selection input, #max-date-selection input {
        font-size: 20px;
        height: 30px;
        width: 4ch;
        padding: 0;
    } 
    #min-date-selection, #max-date-selection {
        height: 40px;
        display: flex;
    }
    #min-date-box, #max-date-box {
        height: 40px;
        margin: 5px;
        padding: 0 10px;
        width: auto;
    }
    #selection-box {
        top: -1px;
        left: -1px;
        border: 1px solid white;
    }

}

@media (orientation: landscape) and (max-height: 600px) {
    /* nav bar */
    #logo, #export, #filter {
        margin: 10px 10px 0 10px;
    }
    #logo h1 {
        display: none;
    }
    #export h3 {
        display: none;
        user-select: none;
    }
    #export {
    }
    #export img {
        align-self: center;
    }
    #scroll {
        display: none;
    }
    #filter h3 {
        display: none;
        user-select: none;
    }


    /* slider */
    #slider-box {
        height: 50px;
    }
    input[type="range"] {
        padding: 5px !important;
        height: 15px !important;
        align-self: center;
        width: 100% !important;
    }
    input[type="range"]::-webkit-slider-runnable-track {
        height: 15px;
    }
    input[type="range"]::-webkit-slider-thumb {
        box-shadow: none;
        appearance: none;
        background-size: contain; 
        height: 50px;
        width: 17px;
        margin-top: -18px;
    }
    #current-date-display {
        bottom: 50px;
        font-size: 15px;
        padding: 7px 10px;
    }
    /* date inputs */
    #min-date, #max-date {
        font-size: 20px
    }
    #min-era, #max-era {
        font-size: 15px;
    }
    #min-date-container, #max-date-container {
        min-width: 60px;
    }
    #min-date-selection select, #max-date-selection select {
        font-size: 20px;
        height: 30px;
        padding: 0;
        margin-right: 10px;
    } 
    #min-date-selection input, #max-date-selection input {
        font-size: 20px;
        height: 30px;
        width: 4ch;
        padding: 0;
    } 
    #min-date-selection, #max-date-selection {
        height: 40px;
        display: flex;
    }
    #min-date-box, #max-date-box {
        height: 40px;
        margin: 5px;
        padding: 0 10px;
        width: auto;
    }
    #selection-box {
        top: -1px;
        left: -1px;
        border: 1px solid white;
    }


    /* controls */
    #map-controls {
        top: 15px;
        left: auto;
        right: 15px;
    }

    /* filters */
    #layer-selection {
        min-height: auto;
        min-width: 300px;
        width: 60%;
        border-radius: 25px;
    }
    #top {
        padding: 15px 50px 0 50px;
    }
    #top h2 {
        font-size: 20px;
    }
    #filters li {
        font-size: 20px;
    }
}

/* other dark mode styles */
@media (prefers-color-scheme: dark) {
    #logo h1 {
        color: white;
    }
    .greyed-out {
        color: #31353A !important;
        color: #ff0000;
    }
    #save-img-select hr {
        border: 1px solid #ffffff;
    }
    #layer-selection {
        color: white;
    }
    #top h2 {
        color: white;
    }
    .filter {
        background-color: #060A1C;
        border: 2px solid #060A1C;
    }
    .filter.on {
        background-color: #4421AE;
        border: 2px solid #4421AE;
        color: white;
    }
    .filter-subcategory {
        background-color: #060A1C;
        border: 1px solid #060A1C;
        color: white;
    }
    .filter.on .filter-subcategory.on {
        background-color: #4421AE;
        color: white;
        border: 1px solid #4421AE;
    }


}

#layer-selection div.filter-img {
    background-size: contain;
    background-repeat: no-repeat;
}
#column-1 div.filter-img{
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
}
#column-2 div.filter-img {
    width: 35px;
    height: 35px;
    min-height: 35px;
    min-width: 35px;
}

@media (prefers-color-scheme: light) {
    /* column 1 */
    #label-checkbox-img {
        background-image: url("../images/icons/unchecked.svg");
    }
    #capital-img {
        background-image: url("../images/icons/major-cities.svg");
    }
    #minor-cities-img {
        background-image: url("../images/icons/minor-cities.svg");
    }
    #state-labels-img {
        background-image: url("../images/icons/state.svg");
    }
    #custom-markers-img {
        background-image: url("../images/icons/custom-markers.svg");
    }
    #borders-checkbox-img {
        background-image: url("../images/icons/unchecked.svg");
    }
    #country-borders-img {
        background-image: url("../images/icons/country.svg");
    }
    #state-borders-img {
        background-image: url("../images/icons/state.svg");
    }

    /* column 2 */
    #background-img {
        background-image: url("../images/icons/background.svg");
    }
    #rivers-img {
        background-image: url("../images/icons/river.svg");
    }
    #battles-img {
        background-image: url("../images/icons/battles.svg");
    }

    /* any overrides for applied/not applied filters */

    /* column 1 */
    .filter.on #label-checkbox-img {
        background-image: url("../images/icons/unchecked-dark.svg");
    }
    .filter.on .filter-subcategory.on #capital-img {
        background-image: url("../images/icons/major-cities-dark.svg");
    }
    .filter.on .filter-subcategory.on #minor-cities-img {
        background-image: url("../images/icons/minor-cities-dark.svg");
    }
    .filter.on .filter-subcategory.on #state-labels-img {
        background-image: url("../images/icons/state-dark.svg");
    }
    .filter.on .filter-subcategory.on #custom-markers-img {
        background-image: url("../images/icons/custom-markers-dark.svg");
    }
    .filter.on #borders-checkbox-img {
        background-image: url("../images/icons/unchecked-dark.svg");
    }
    .filter.on .filter-subcategory.on #country-borders-img {
        background-image: url("../images/icons/country-dark.svg");
    }
    .filter.on .filter-subcategory.on #state-borders-img {
        background-image: url("../images/icons/state-dark.svg");
    }

    /* column 2 */
    .filter.on #background-img {
        background-image: url("../images/icons/background-dark.svg");
    }
    .filter.on #rivers-img {
        background-image: url("../images/icons/river-dark.svg");
    }
    .filter.on #battles-img {
        background-image: url("../images/icons/battles-dark-dark.svg");
    }

    /* column 1 */
    .filter-subcategory #label-checkbox-img {
        background-image: url("../images/icons/unchecked.svg");
    }
    .filter-subcategory #capital-img {
        background-image: url("../images/icons/major-cities.svg");
    }
    .filter-subcategory #minor-cities-img {
        background-image: url("../images/icons/minor-cities.svg");
    }
    .filter-subcategory #state-labels-img {
        background-image: url("../images/icons/state.svg");
    }
    .filter-subcategory #custom-markers-img {
        background-image: url("../images/icons/custom-markers.svg");
    }
    .filter-subcategory #borders-checkbox-img {
        background-image: url("../images/icons/unchecked.svg");
    }
    .filter-subcategory #country-borders-img {
        background-image: url("../images/icons/country.svg");
    }
    .filter-subcategory #state-borders-img {
        background-image: url("../images/icons/state.svg");
    }

    /* column 2 */
    .filter-subcategory #background-img {
        background-image: url("../images/icons/background.svg");
    }
    .filter-subcategory #rivers-img {
        background-image: url("../images/icons/river.svg");
    }
    .filter-subcategory #battles-img {
        background-image: url("../images/icons/battles.svg");
    }
}


@media (prefers-color-scheme: dark) {
    /* column 1 */
    #label-checkbox-img {
        background-image: url("../images/icons/unchecked-dark.svg");
    }
    #capital-img {
        background-image: url("../images/icons/major-cities-dark.svg");
    }
    #minor-cities-img {
        background-image: url("../images/icons/minor-cities-dark.svg");
    }
    #state-labels-img {
        background-image: url("../images/icons/state-dark.svg");
    }
    #custom-markers-img {
        background-image: url("../images/icons/custom-markers-dark.svg");
    }
    #borders-checkbox-img {
        background-image: url("../images/icons/unchecked-dark.svg");
    }
    #country-borders-img {
        background-image: url("../images/icons/country-dark.svg");
    }
    #state-borders-img {
        background-image: url("../images/icons/state-dark.svg");
    }

    /* column 2 */
    #background-img {
        background-image: url("../images/icons/background-dark.svg");
    }
    #rivers-img {
        background-image: url("../images/icons/river-dark.svg");
    }
    #battles-img {
        background-image: url("../images/icons/battles-dark.svg");
    }
}
/* a lot of stupid dark/light mode image stuff */


/* misc */
.invisible {
    display: none !important;
}