@font-face {
    font-family: SpaceInvaders;
    src: url(../fonts/space_invaders.ttf);
}
@font-face {
    font-family: Volter;
    src: url(../fonts/Volter.ttf);
}
@font-face {
    font-family: Adore;
    src: url(../fonts/adore64-webfont.ttf) format("truetype");
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "adore64regular";
    src: url(../fonts/adore64-webfont.woff2) format("woff2");
    font-weight: normal;
    font-style: normal;
}

body,
html,
#map {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

#map {
    background: #000;
}

.user-marker {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 1);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transform-origin: center center;
    z-index: 0;
    /* transition: transform 0.3s ease-in-out; */
}

.user-marker::before {
    content: "";
    position: absolute;
    /* bottom: -10px; */
    bottom: -10px;
    left: 50%;
    width: 60px;
    height: 85px;
    /* border-radius: 50%; */
    background: conic-gradient(
        from -22.5deg at bottom,
        #0000,
        rgba(0, 122, 255, 0.8) 1deg 45deg,
        #0000 46deg
    );
    -webkit-mask: linear-gradient(#0000 20%, #000 80%);
    transform: translateX(-50%);
    /* clip-path: polygon(0 20%, 100% 20%, 100% 100%, 0 100%); */
    clip-path: rect(0% 100% 60px 0%);
    /* masque le bas 20% */
    z-index: -1;
    visibility: hidden;
}

.user-marker.orientation-found::before {
    visibility: visible;
}

.user-marker.orientation-not-found::before {
    visibility: visible;
    /* MAke a radiating ligne blue transparent circle with animation */
    background: conic-gradient(
        from -22.5deg at bottom,
        #0000,
        rgba(0, 122, 255, 0.4) 1deg 45deg,
        #0000 46deg
    );
    animation: pulse 2s infinite;
}

.user-marker::after {
    box-sizing: border-box;
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 2.1px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Default: nothing visible */
.user-marker::before {
    content: "";
    position: absolute;
    visibility: hidden;
}

/* Orientation found beam */
.user-marker.orientation-found::before {
    /* reset circle */
    border-radius: 0;
    animation: none;
    top: auto;
    right: auto;

    bottom: -10px;
    left: 50%;
    width: 60px;
    height: 85px;
    background: conic-gradient(
        from -22.5deg at bottom,
        #0000,
        rgba(0, 122, 255, 0.8) 1deg 45deg,
        #0000 46deg
    );
    -webkit-mask: linear-gradient(#0000 20%, #000 80%);
    transform: translateX(-50%);
    clip-path: rect(0% 100% 60px 0%);
    z-index: -1;
    visibility: visible;
}

/* Orientation not found pulsing circle */
.user-marker.orientation-not-found::before {
    /* reset beam */
    clip-path: none;
    background: none;
    -webkit-mask: none;

    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 122, 255, 0.8);
    border-radius: 50%;
    animation: pulse 2s infinite;
    visibility: visible;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
    border-bottom-color: #000;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
    border-top-color: #000;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: #000;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: #000;
}

.maplibregl-popup-content {
    z-index: 1;
    background: #000;
    padding: 0px;
    color: #fff;
    font-family: SpaceInvaders, sans-serif;
    width: 140px;
    overflow: hidden;
    padding: 4px;
}

.maplibregl-popup-content .si-info {
    padding: 4px;
}

.maplibregl-popup-content img {
    width: 140px;
    height: 140px;
    display: block;
    border-radius: 2px;
}

.maplibregl-popup-content .header {
    font-size: 12px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.maplibregl-popup-content .general {
    font-size: 10px;
    line-height: 16px;
}

.maplibregl-popup-content .general div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.maplibregl-popup-content .links {
    display: flex;
    flex-direction: row; /* horizontal row */
    align-items: center; /* vertical alignment */
    /* justify-content: space-between;  */
    /* gap: 8px; */
    margin-top: 8px;
    /* padding-left: 17px;
    padding-right: 17px; */
}

.maplibregl-popup-content .links a {
    margin-top: 0 !important; /* override any margin from inline styles */
    margin-left: -2px;
    margin-right: 10px;
}

.maplibregl-popup-content .links img {
    width: 32px;
    height: 32px;
    object-fit: contain; /* keep aspect ratio, no stretch */
    display: block;
    /* padding-left: -1px; */
    /* transform: translate(-1px -1px); */
}

/* Fullscreen overlay (dim background) */
#overlay {
    display: none; /* hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(44, 44, 44, 0.5); /* semi-transparent filter */
    z-index: 998; /* just below the popup */
}

/* Popups */
.popup {
    display: none;
    position: fixed;
    width: 90%;
    max-width: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999; /* above the overlay */
    background: black;
    color: white;
    font-family: SpaceInvaders, sans-serif;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Settings popup */

/* Container for custom checkbox */
.checkbox-container {
    display: flex;
    align-items: left;
    gap: 12px; /* space between box and label text */
    cursor: pointer;
    user-select: none;
    width: fit-content;
    margin: 4px;
    /* margin-top: 8px; */
}

.checkbox-container img {
    width: 20px;
    height: 20px;
    margin-right: -4px;
    transform: translateY(-1px);
}

.sub-category {
    margin-left: 24px; /* indent under parent checkbox */
    margin-top: 4px;
    margin-bottom: 4px;
}

.sub-category .checkbox-container {
    margin-top: 4px;
}

/* Hide native checkbox */
.checkbox-container input {
    display: none;
}

/* Outer square pixel box */
.checkbox-box {
    width: 30px;
    height: 20px;
    background-color: gray;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* dot starts left */
    transition: justify-content 0.2s ease;
    box-sizing: border-box;
    padding: 2px;
}

/* Inner moving dot */
.checkbox-dot {
    width: 10px;
    height: 10px;
    background-color: white;
    transition: all 0.2s ease;
}

/* Checked: move dot to right and change color */
.checkbox-container input:checked + .checkbox-box {
    justify-content: flex-end;
}

.checkbox-container input:checked + .checkbox-box {
    background-color: seagreen;
}

.category-header {
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-weight: bold;
    margin-bottom: 4px;
}
.category-toggle {
    margin-left: auto;
}

.color-seagreen {
    filter: invert(52%) sepia(13%) saturate(1807%) hue-rotate(94deg)
        brightness(84%) contrast(92%);
}
.color-blueviolet {
    filter: invert(18%) sepia(80%) saturate(4174%) hue-rotate(268deg)
        brightness(92%) contrast(92%);
}
.color-crimson {
    filter: invert(8%) sepia(100%) saturate(5442%) hue-rotate(343deg)
        brightness(130%) contrast(88%);
}
.color-hotpink {
    filter: invert(55%) sepia(99%) saturate(1225%) hue-rotate(295deg)
        brightness(101%) contrast(101%);
}
.color-darkgoldenrod {
    filter: invert(72%) sepia(62%) saturate(6159%) hue-rotate(20deg)
        brightness(95%) contrast(91%);
}
.color-gray {
    filter: invert(51%) sepia(26%) saturate(0%) hue-rotate(254deg)
        brightness(93%) contrast(86%);
}
.color-royalblue {
    filter: invert(23%) sepia(83%) saturate(1912%) hue-rotate(209deg)
        brightness(99%) contrast(100%);
}
.color-amber {
    filter: invert(61%) sepia(93%) saturate(660%) hue-rotate(2deg)
        brightness(107%) contrast(103%);
    color: orange;
}
.color-orange {
    filter: invert(70%) sepia(92%) saturate(2735%) hue-rotate(360deg)
        brightness(102%) contrast(107%);
}
.color-darkorange {
    filter: invert(52%) sepia(78%) saturate(733%) hue-rotate(357deg)
        brightness(98%) contrast(109%);
}

h3 {
    text-align: center;
}

#search-form {
    display: inline-flex;
    align-items: center;
    height: 80px;
}

#search-popup {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 70%;
    max-width: 300px;
}

#search-popup hr {
    width: 100%;
    display: block;
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    margin-inline-start: auto;
    margin-inline-end: auto;
    unicode-bidi: isolate;
    overflow: hidden;
    border-style: inset;
    border-width: 1px;
}

#search-input {
    height: 32px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 4px 0 0 4px;
    box-sizing: border-box;
    outline: none;
}

/* Button styling */
.search-btn {
    height: 32px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ccc;
    border-left: none;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    padding: 0;
}

/* Icon centering */
.search-btn .icon {
    font-size: 16px;
    line-height: 1;
}

.menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    text-align: center;
    width: 100%;
}

.menu ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.menu ul li {
    margin: 24px 0;
}

.menu ul li a {
    color: #55ff55;
    text-decoration: none;
    font-family: Adore;
    padding: 8px;
    font-size: 1.2rem;
    /* font-weight: bold; */
    /* font-size: 18px; */
    word-spacing: -5px;
}

.menu ul li a:hover {
    color: white;
}

#player-popup {
    max-width: 300px;
}

.player-container {
    display: flex;
    flex-direction: column;
    padding: 32px 48px;
}

.player-sub-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.player-sub-container > span:first-child {
    color: #105bff;
}

hr {
    border-color: #105bff;
}
