/* Variable for brand colors */
:root {
    --brand-purple: #7733FF;
    --ripple-pink: #bc2566;
    --brand-blue: #33BBFF;
}

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

html,
body {
    background: var(--brand-purple);
}

main {
    background-color: white;
    padding: 20px;
}

#map-canvas {
    height: calc(100% - 50px);
    background-color: #fff;
}

#wordmark {
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
}

h1 {
    font-family: 'Montserrat-Alt1', Arial, sans-serif;
    font-size: 27px;
    font-weight: 300;
    color: #eff0fa;
    margin: 0;
    text-transform: uppercase;
    margin-top: 4px;
}

h1 a {
    color: #eff0fa;
    text-decoration: none;
}

h1 svg {
    vertical-align: middle;
    height: 30px;
    margin-bottom: 8px;
    margin-right: -2px;
}

h1 svg polygon,
h1 svg polyline {
    stroke: var(--brand-blue);
}

h1 svg circle {
    fill: var(--brand-blue);
}

#info-box {
    position: absolute;
    bottom: 55px;
    right: 10px;
    padding: 8px;
    width: 220px;
    font-family: sans-serif;
    border: 1px solid black;
    background: #fff;
    font-size: 12px;
    color: black;
    z-index: 400;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    border-radius: 4px;
}

#info-box h2 {
    font-family: sans-serif;
    font-size: 12px;
    font-weight: bold;
    margin: 0;
}

#info-box a {
    color: black;
}

#info-box.multi-swimmer {
    width: 285px;
    border: 1px solid white;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    left: 10px;
    bottom: 60px;
    right: auto;
}

#time-box {
    position: absolute;
    top: 60px;
    left: 5px;
    padding: 8px;
    font-family: sans-serif;
    border: 1px solid #050733;
    background: #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    border-radius: 4px;
    font-size: 12px;
    color: black;
    z-index: 400;
}

/* Ripple effect for latest position markers */
.ripple {
    width: 37px;
    height: 37px;
}

.ripple svg {
    width: 37px;
    height: 37px;
    display: block;
}

.ripple circle {
    animation-duration: 2.5s;
    animation-name: ripple;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in;
    fill: none;
    cx: 18;
    cy: 18;
    r: 0;
    stroke-width: 2;
}

.ripple circle:last-child {
    animation-delay: 1.25s;
}

@keyframes ripple {
    0% {
        r: 0;
        opacity: 0.5;
        stroke: #EFE3E9;
    }

    90% {
        r: 16;
        opacity: 0.9;
        stroke: var(--ripple-pink);
    }

    100% {
        r: 16;
        opacity: 0.4;
        stroke: var(--ripple-pink);
    }
}

/* Name label for markers */
.name-label {
    width: 60px;
    height: 20px;
    font-size: 12px;
    color: white;
    background: rgba(0, 0, 0, .7);
    border: 2px solid black;
    border-radius: 3px;
    top: -25px;
    left: -20px;
    position: absolute;
    overflow: hidden;
    text-align: center;
}

.name-label.small {
    width: 24px;
    left: -3px;
}

/* Abandoned marker style */
.maplibregl-marker.abandoned svg>g>g,
.maplibregl-marker.abandoned svg>g>g:last-child circle:last-child {
    display: none;
}

.maplibregl-marker.abandoned svg>g>g:last-child {
    display: block;
}

.maplibregl-marker.abandoned svg>g>g:last-child circle {
    fill: black;
    stroke: white;
    stroke-width: 2px;
    cx: 14;
    cy: 14;
    r: 12;
    opacity: 1;
    translate: -8px;
}

.maplibregl-marker.abandoned .name-label {
    font-size: 10px;
    width: 40px;
    height: 15px;
    left: -16px;
    top: -16px;
    line-height: 15px;
}

.maplibregl-marker.abandoned .name-label.small {
    width: 17px;
    left: -4px;
}

/* Copy to clipboard icon in popups */
.maplibregl-popup-content > a > svg {
    height: 14px;
    margin-bottom: -4px;
}

.camera-marker {
    width: 18px;
    height: 18px;
}

.camera-marker::after {
    content: '📷';
    display: block;
    width: 18px;
    height: 18px;
    font-size: 18px;
}
