@font-face {
    font-family: 'Medieval';
    /* This is the name you'll use in CSS */
    src: url('/assets/fonts/CloisterBlack.ttf') format('truetype');
    font-weight: normal;
    /* You can specify other weights if available */
    font-style: normal;
    /* Specify if the font is italic, etc. */
}

/* Global Styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #ADD8E6;
    height: 100dvh;
    /* Ensure body fills the viewport */
    display: flex;
    flex-direction: column;

    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);

    overflow-x: hidden;
}

/* Navigation Bar */
nav {
    background-color: #005EB8;
    color: white;
    padding: 15px 0;
    position: relative;
    z-index: 10;
    /* Ensure it stays on top */
}

nav ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
}

/* Main Content */
main {
    flex-grow: 1;
    /* This will make the main content fill the remaining space */
    display: flex;
    position: relative;
}

#interactive-map {
    width: 100%;
    flex: 1;
    /* This makes the map section take up the remaining height */
    display: flex;
    position: relative;
    z-index: 1;
}

#map {
    flex-grow: 1;
    /* Ensures the map takes all the space of #interactive-map */
    width: 100%;
    /* Full width */
    background-color: #add8e6;
}

canvas#mapCanvas {
    width: 100%;
    height: 100%;
    /* Ensure canvas fills the container */
    position: absolute;
    top: 0;
}

.timestamp-text {
    color: white;
    font-size: 5dvh;
    font-family: "Medieval", sans-serif;
    position: absolute;
    left: 50%;
    /* Move to the center horizontally */
    transform: translate(-50%, 0%);
    /* Adjust by 50% of its own width and height */
    text-align: center;
    /* Center the text inside the box */
}

.overlay-text {
    color: white;
    font-size: 4dvh;
    font-family: "Medieval", sans-serif;
    position: absolute;
    left: 50%;
    /* Move to the center horizontally */
    transform: translate(-50%, 0%);
    /* Adjust by 50% of its own width and height */
    text-align: center;
    /* Center the text inside the box */

    left: env(safe-area-inset-left);
    right: env(safe-area-inset-right);
    bottom: env(safe-area-inset-bottom);
}

.leaflet-container {
    cursor: default !important;
    /* This will change the cursor to the default arrow */
    z-index: 2;
}

.info-box {
    background-color: #005EB8;
    /* Blue background */
    border: 2px solid #B37E31;
    /* Golden border */
    color: white;
    /* White text */
    padding: 10px;
    position: absolute;
    bottom: 20px;
    /* Position near the bottom */
    left: 20px;
    /* Position near the left */
    width: 300px;
    /* Set a fixed width */
    font-family: Arial, sans-serif;
    z-index: 20;
    display: none;
    /* Hide by default */
}

button {
    background-color: #005EB8;
    color: white;
    /* White text */
    font-size: 3vh;
    font-weight: bold;
    width: 25vh;
    height: 8vh;
    border: 2px solid #B37E31;
    border-radius: 1vh;
    /* Rounded corners */
    cursor: pointer;
    transition: background-color 0.3s ease;
    /* Smooth color transition on hover */
    z-index: 300;
    position: absolute;
    box-sizing: border-box;
}

/* Hover effect */
button:hover {
    background-color: #335896;
    /* Darker blue on hover */
}

/* Dropdown search container */
.dropdown-container {
    position: absolute;
    top: 3dvh;
    left: 3dvh;
    width: min(30dvw, 300px);
}

.dropdown-container.collapsed {
    transform: translateX(-100%);
    /* Hide the container off-screen */
    visibility: hidden;
}

#progenitor-search {
    box-sizing: border-box;
    width: 100%;
    padding: 2dvh;
    font-size: 3vh;
    font-weight: bold;
    color: white;
    background-color: #005EB8;
    border: 2px solid #B37E31;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    direction: ltr;
    text-align: left;
}

.suggestions-list {
    max-height: 150px;
    overflow-y: auto;
    background-color: #005EB8;
    border: 1px solid #B37E31;
    font-size: 2vh;
    color: white;
    display: none;
    position: absolute;
    width: 100%;
}

.suggestions-list div {
    padding: 8px;
    cursor: pointer;
}

.suggestions-list div:hover {
    background-color: #335896;
}

/* Side panel with tree options */
.tree-options-container {
    position: absolute;
    right: 3dvh;
    top: 3dvh;
}

.tree-options-container.collapsed {
    transform: translateX(100%);
    /* Hide the container off-screen */
    visibility: hidden;
}

.tree-options-panel {
    font-size: 2.2vh;
    font-weight: bold;
    color: white;

    background-color: #005EB8;
    border: 2px solid #B37E31;

    padding: 2dvh;
    box-sizing: border-box;
    display: block;
}

.tree-options-panel h3 {
    margin-top: 0;
}

#tree-display {
    margin-top: 50px;
    padding: 20px;
}

#tree-display-wrapper {
    width: 100vw;
    /* or 800px, etc. */
    height: 80vh;
    /* some size */
    overflow: auto;
    /* or auto */
    position: relative;
}

#tree-display {
    position: relative;
    /* your dynamic width/height get set via JS */
}


.arrow-collapse {
    position: absolute;
    background-color: #005EB8;
    color: white;
    border: none;
    cursor: pointer;

    top: 0%;
    height: 100%;

    width: 5dvh;

    transform: rotate(0deg);
    transition: transform 0.3s;
}

.arrow-collapse.collapsed {
    transform: rotate(180deg);
    visibility: visible;
}

#toggle-search {
    left: 100%;
}

#toggle-options {
    right: 100%;
}

.tree-node {
    margin: 10px 0;
    padding-left: 20px;
    border-left: 2px solid #B37E31;
}

.tree-node-abs {
    font-family: Arial, sans-serif;
}

.descendants-container,
.ancestors-container {
    margin-left: 30px;
}