:root {
    --primary-red: #ff6b6b;
    --primary-red-dark: #e55a5a;
    --white: #ffffff;
    --text-dark: #e55a5a;
    --shadow-light: rgba(0,0,0,0.2);
    --shadow-medium: rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    font-size: 16px;
}


/* Ensure consistent marker scaling on high-DPI devices */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .custom-marker {
        /* Force hardware acceleration for smoother rendering */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
    
    .marker-circle {
        /* Ensure crisp rendering on high-DPI displays */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

#map {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Override Mapbox's default font styling */
.mapboxgl-map {
    font: unset;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 9999;
    transition: opacity 400ms ease-out;
}

.custom-marker {
    position: absolute;
    width: 1em;
    height: 1em;
    cursor: default;
    z-index: 10; /* default */
}

.custom-marker.highlighted {
    z-index: 100;
}

.marker-circle {
    color: white;
    text-shadow: 1px 1px 0px rgba(128,128,128,0.2), -1px -1px 0px rgba(128,128,128,0.2), 1px -1px 0px rgba(128,128,128,0.2), -1px 1px 0px rgba(128,128,128,0.2);
    width: 1.5em;
    height: 1.5em;
    font-size: 1.2em;
    background-color: var(--primary-red);;
    border: 1px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 1px var(--shadow-medium);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    transition: width 0.2s ease, height 0.2s ease, top 0.2s ease, left 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Staff sign-delivery mode: undelivered = black, delivered = red */
.sign-delivery-tracking .host-container .marker-circle {
    background-color: #000000;
}
.sign-delivery-tracking .host-container.sign-delivered .marker-circle {
    background-color: var(--primary-red);
}

.highlighted .marker-circle {
    width: 2em;
    height: 2em;
    top: -0.35em;
    left: -0.35em;
    font-size: 1.4em; /* Scale the text proportionally when highlighted */
}

.marker-highlight {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 0, 0.1);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.highlighted .marker-highlight {
    opacity: 1;
}

.marker-info-container {
    position: absolute;
    top: 1.8em; /* Position just below the circle with buffer */
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.95);
    border: 0.0625em solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375em;
    padding: 0.125em 0.125em;
    box-shadow: 0 0.125em 0.5em var(--shadow-light);
    text-align: center;
}

.marker-address {
    color: var(--text-dark);
    font-size: 1.2em;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.75), -1px -1px 0px rgba(255,255,255,0.75), 1px -1px 0px rgba(255,255,255,0.75), -1px 1px 0px rgba(255,255,255,0.75);
}

.marker-title {
    color: var(--text-dark);
    font-size: 1em;
    white-space: nowrap;
    line-height: 100%;
    font-style: italic;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.75), -1px -1px 0px rgba(255,255,255,0.75), 1px -1px 0px rgba(255,255,255,0.75), -1px 1px 0px rgba(255,255,255,0.75);
}

.marker-slots {
    margin-top: .8em;
    margin-left: 1em;
    text-align: left;
    white-space: nowrap;
    line-height: 130%;
    font-size: 1.1em;
}

.marker-slots .start {
    text-align: right;
}

.marker-slots .performer-name {
    font-weight: bold;
    font-size: 1.3em;
    padding-left: .5em;
    text-decoration: underline;
}

.marker-slots .performer-name:hover {
    color: #007bff;
    cursor: pointer;
}

.debug-crosshair {
    position: fixed;
    width: 1.25em;
    height: 1.25em;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
}

.debug-crosshair::before,
.debug-crosshair::after {
    content: '';
    position: absolute;
    background-color: #000000;
}

.debug-crosshair::before {
    width: 1px;
    height: 20px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.debug-crosshair::after {
    width: 20px;
    height: 1px;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.debug-host-bounds-rect {
    position: fixed;
    border: 2px solid #00ff00;
    background-color: rgba(0, 255, 0, 0.1);
    pointer-events: none;
    z-index: 9999;
}

.debug-constraint-bounds-rect {
    position: fixed;
    border: 2px solid #ff0000;
    background-color: rgba(255, 0, 0, 0.05);
    pointer-events: none;
    z-index: 9998;
}

.marker-checkbox-container {
    margin-top: .8em;
    margin-left: 1em;
    text-align: left;
    white-space: nowrap;
    line-height: 130%;
}


.user-marker-container {
    z-index: 10000;
    pointer-events: none !important;
}
.user-marker {
    width: 1.25em;
    height: 1.25em;
    background-color: rgb(17, 29, 197, .5);
    border: 0.125em solid rgb(255, 238, 7);
    border-radius: 50%;
    animation: user-marker-animation 1s ease-in-out infinite;
}
@keyframes user-marker-animation {
    0% {
        transform: scale(1);
        -webkit-transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        -webkit-transform: scale(1.2);
    }
}
