/* Font declarations */
@font-face {
    font-family: "RWC Regular";
    src: url("https://cdn.iventis.co.uk/iventis-assets/fonts/RWC Regular/0-255.pbf") format("opentype"),
        url("https://cdn.iventis.co.uk/iventis-assets/fonts/RWC Regular/256-511.pbf") format("opentype"),
        url("https://cdn.iventis.co.uk/iventis-assets/fonts/RWC Regular/512-767.pbf") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "RWC Bold";
    src: url("https://cdn.iventis.co.uk/iventis-assets/fonts/RWC Bold/0-255.pbf") format("opentype"),
        url("https://cdn.iventis.co.uk/iventis-assets/fonts/RWC Bold/256-511.pbf") format("opentype"),
        url("https://cdn.iventis.co.uk/iventis-assets/fonts/RWC Bold/512-767.pbf") format("opentype");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

body {
    margin: 0;
    padding: 0;
    font-family: "RWC Regular", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden; /* Prevent scrolling */
}

/* Map container */
.map-container {
    width: 100vw;
    height: 100vh; /* Fallback */
    height: 100dvh; /* Use dynamic viewport height for better mobile support */
    height: calc(var(--vh, 1vh) * 100); /* Custom calculated height as fallback */
    position: relative;

    @media (max-width: 640px) {
        height: 100dvh; /* Use dynamic viewport height for mobile */
        height: calc(var(--vh, 1vh) * 100); /* Custom calculated height as fallback */
    }
}

/* Map element */
#map {
    width: 100%;
    height: 100%;
    visibility: hidden; /* Hide the map until it's fully loaded */
}

/* Legend */
.legend {
    display: none;
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 0;
    background-image: url("./assets/legend/legend-outer.svg");
    background-size: contain;
    background-position: left;
    background-position-y: bottom;
    background-repeat: no-repeat;
    padding: 0;
    z-index: 100;
    width: calc((100vh - 10px) * 0.5); /* width of the legend svg divided by height */


    @media (max-width: 640px) {
        width: calc(100vw - 5px);
        height: calc(100vw * 5/3);
        top: auto;
        bottom: 75px;
        left: 5px;
        background-image: url("./assets/legend/legend-outer-medium.svg");
        background-position: center center;
        background-size: cover; 
    }

    @media (max-height: 500px) {
        height: 80vh;
    }
}

.heading {
    padding: 15px;
    padding-top: 15vh;
    max-width: 90%;

    @media screen and (max-width: 640px) {
        padding: 15px;
        padding-top: 12vh;
    }
}

.city {
    font-size: 0.75rem;
    color: #a57e00;
    margin: 0;
    margin-bottom: 5px;

    @media screen and (max-width: 640px) {
        font-size: 0.875rem;
    }
}

.venue {
    margin: 0;
    font-size: 1.25rem;
    font-family: "RWC Regular";

    @media screen and (max-width: 640px) {
        font-size: 2rem;
        font-size: 1.5rem;
        max-width: 80vw;
    }
}

/* Legend items styling */
.information {
    padding: 0;
    padding-left: 15px;
    padding-right: 25px;
    overflow-y: auto;
    max-height: 46vh;
    text-align: left; /* Ensures text still aligns to the left */
    display: grid;
    grid-template-areas:
        "gold gold"
        "pink pink"
        "black black";
    grid-template-columns: 1fr 1fr;
    gap: 15px;

    @media (max-width: 1000px) {
        max-height: 42vh;
    }

}

.legend-category {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.legend-category.gold {
    grid-area: gold;
}

.legend-category.black {
    grid-area: black;
}

.legend-category.pink {
    grid-area: pink;
}

.legend-item {
    display: flex;
    align-items: center;
}

.legend-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.legend-icon.icon-image {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.legend-icon.icon-line {
    height: 5px;
    width: 24px;
    border-radius: 4px;
}

.icon-line-dash {
    height: 4px;
    width: 8px;
    border-radius: 4px;
    margin: auto;
    background-color: #e018bd;
}

.legend-icon.icon-area {
    background-color: #9a2bff;
    opacity: 0.25;
}

.legend-name {
    font-size: 0.875rem;
    color: #333;
    font-family: "DM Sans", sans-serif;
    font-weight: 500;

    @media screen and (max-width: 640px) {
        font-size: 0.875rem;
    }
}

#legend-button {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 500;
    font-size: 1rem;
    font-family: "RWC Bold";
    border: none;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(165, 126, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.6);
    background-color: #e1b300;
    color: #000000;
    padding: 10px;


    @media (max-width: 640px) {
        display: none;
    }
}

/* Out-of-bounds venue indicators */
.out-of-bounds-indicators {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.venue-indicator {
    position: absolute;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    pointer-events: auto;
    cursor: pointer;
    max-width: 180px;
}

.venue-indicator:hover {
    transform: scale(1.05);
}

.venue-indicator-icon {
    width: 44px;
    height: 44px;
    background-image: url("./assets/icons/venue.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.venue-indicator-distance {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.venue-indicator-arrow svg {
    width: 24px;
    height: 24px;
    fill: #e018bd;
    transform-origin: center;
}

.level-selector {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.level-selector-button {
    border: none;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(165, 126, 0, 0.15), 0 1px 4px rgba(0, 0, 0, 0.6);
    background-color: #e1b300;
    color: #000000;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    padding: 0;
    text-decoration: none;
    font-family: "RWC Bold", sans-serif;
    font-size: 1rem;
}

.level-selector-button-selected {
    background-color: #000000;
    color: #ffffff;
}
