/* MapLibre Google StreetView Plugin Styles */

/* Pegman Control styling based on Google Maps implementation */
.maplibre-streetview-pegman-container {
    /* Top position is set dynamically in JavaScript */
    z-index: 1;
    width: 29px;
    height: 29px;
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    cursor: grab;
    transition: background 0.2s ease;
    position: relative !important;
    top: 0px !important;
    right: 0px !important;
    left: 0px !important;
    bottom: 0px !important;
}

.maplibre-streetview-pegman-container:hover {
    background: linear-gradient(#d1d1d1, #F5F5F5, #fbfbfb);
}

.maplibre-streetview-pegman-container.dragging {
    cursor: grabbing;
}

/* Add styling for when Street View coverage is active */
.maplibre-streetview-pegman-container.streetview-layer-active {
    background: linear-gradient(#d1d1d1, #F5F5F5, #fbfbfb);
}

.maplibre-streetview-pegman {
    width: 29px;
    height: 29px;
    background-image: url("/assets/pegman-25798cd6.png");
    background-position: 0px -35px; /* Default state */
    background-size: 29px;
    background-repeat: no-repeat;
}

.maplibre-streetview-pegman-container:hover .maplibre-streetview-pegman {
    background-position: 3px -95px; /* Hover state */
}

.maplibre-streetview-pegman.dragging {
    background-position: -3px -104px; /* Dragging state */
}

/* Style for active pegman when coverage layer is showing */
.maplibre-streetview-pegman.active {
    background-position: -3px -7px; /* Active state from sprite */
}

/* Street View overlay styling */
.maplibre-streetview-street-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background: #fff;
    display: none;
    overflow: hidden;
}

.maplibre-streetview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

/* Close button with improved mobile support */
.maplibre-streetview-close {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 50px;
    height: 50px; /* Increased touch target size (Apple's recommended minimum) */
    background: #444444; /*rgba(0, 0, 0, 1);*/
    color: #b3b3b3; /*#fff;*/
    border-radius: 5%;
    text-align: center;
    line-height: 44px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* Remove tap highlight on mobile */
    touch-action: manipulation; /* Optimize for touch */
    user-select: none; /* Prevent text selection */
}

/*
.maplibre-streetview-close:hover {
    background: rgba(0, 0, 0, 1);
}
*/

/* Ensure close button is accessible on smaller screens */
@media (max-width: 768px) {
    .maplibre-streetview-close {
        top: 15px;
        right: 15px;
        width: 48px;
        height: 48px;
        line-height: 48px;
    }
}

/* Pegman dragging element */
.maplibre-streetview-pegman-marker {
    position: absolute;
    z-index: 9999;
    width: 19px;
    height: 32px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.maplibre-streetview-pegman-marker.active {
    opacity: 1 !important;
}

.maplibre-streetview-pegman-marker::before {
    position: relative;
    z-index: 5;
    display: block;
    width: 19px;
    height: 32px;
    content: ' ';
    background-image: url("/assets/cb_scout5-676657f3.png");
    background-repeat: no-repeat;
    background-position: -112px -4px;
}

.maplibre-streetview-pegman-marker::after {
    position: absolute;
    width: 22px;
    height: 22px;
    content: ' ';
    bottom: -18px;
    left: 50%;
    margin-left: -11px;
    z-index: 4;
    display: block;
    border: 1px dotted rgba(51, 51, 51, 0.9);
    border-radius: 30px;
    background-color: rgba(105, 185, 70, 0.7);
    box-shadow: 3px 10px 25px rgba(105, 185, 70, 0.9);
}

.gm-control-active gm-fullscreen-control {
    display: none;
}

/* Street View not available notification */
.maplibre-streetview-notification {
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    animation: fade-in-out 3s ease-in-out;
}

@keyframes fade-in-out {
    0% { opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; }
}

/* Hide Google Maps fullscreen control */
.gm-fullscreen-control {
    display: none !important;
}