/* VWR Mapbox Plugin Styles */

.vwr-mapbox-wrapper {
    position: relative;
    margin: 20px 0;
}

.vwr-mapbox-map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Mobile overlay for better visual separation */
.vwr-mapbox-mobile-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.vwr-mapbox-mobile-overlay.active {
    opacity: 1;
    pointer-events: auto; /* Allow clicks to close overlay */
}

/* Panel container */
.vwr-mapbox-info-card {
    margin: 25px;
    position: sticky;
    float: right;
    top: 200px;
    right: 30px;
    width: 360px;
    max-width: calc(100% - 32px);
    max-height: calc(100% - 32px);
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.12);
    overflow: auto;
    padding: 0;
    display: none;
    color: #111827;
    font: 14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
    z-index: 1000;
}

.vwr-mapbox-info-card a:hover{
    color: #64a622;
}

/* Province Selector Styles */
.vwr-mapbox-province-selector {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    border: 1px solid rgba(0,0,0,.08);
    padding: 10px;
}

.vwr-province-select {
    padding: 0px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    cursor: pointer;
    outline: none;
    min-width: 200px;
    border-radius: 8px;
}

.vwr-province-select:hover {
    background: #f9fafb;
}

.vwr-province-select:focus {
    background: #f9fafb;
    box-shadow: 0 0 0 2px rgba(100, 166, 34, 0.2);
}

.vwr-city-select {
    padding: 0px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    cursor: pointer;
    outline: none;
    min-width: 200px;
    border-radius: 8px;
    width: 100%;
}

.vwr-city-select:hover {
    background: #f9fafb;
}

.vwr-city-select:focus {
    background: #f9fafb;
    box-shadow: 0 0 0 2px rgba(100, 166, 34, 0.2);
}

/* Header (uses the first h3 as the title) */
.vwr-mapbox-info-card h3:first-child {
    margin: 0;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,.06);
    position: sticky;
    top: 0;
    background: #fff;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

/* Left / right chevrons (decorative) */
.vwr-mapbox-info-card h3:first-child::before,
.vwr-mapbox-info-card h3:first-child::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    opacity: .55;
    /* background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2399a1a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'%3E%3C/polyline%3E%3C/svg%3E") center/18px 18px no-repeat; */
}

.vwr-mapbox-info-card h3:first-child::before {
    left: 14px;
}

.vwr-mapbox-info-card h3:first-child::after {
    right: 14px;
    transform: translateY(-50%) scaleX(-1);  /* mirror arrow */
}

/* Body spacing */
.vwr-mapbox-info-card > div {
    padding: 14px 16px;
    font-weight: 600;
}

/* Draw a subtle divider between sections */
.vwr-mapbox-info-card > div + div {
    border-top: 1px solid rgba(0,0,0,.06);
}

/* Make values bold and labels light */
.vwr-mapbox-info-card > div > strong {
    display: block;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: .01em;
    margin: 4px 0 6px;
}

/* Optional: nicer numbers & links */
.vwr-mapbox-info-card a {
    color: #111827;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.vwr-mapbox-info-card .muted {
    color: #6b7280;
    font-weight: 500;
}

/* Mobile toggle button */
.vwr-mapbox-mobile-toggle {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    z-index: 1001;
    min-width: 120px;
    text-align: center;
}

.vwr-mapbox-mobile-toggle:hover {
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,.2);
}

.vwr-mapbox-mobile-toggle::after {
    content: ' ▼';
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.vwr-mapbox-mobile-toggle.active::after {
    content: ' ▲';
    transform: none;
}

/* Pin highlight marker styles */
.vwr-highlight-marker {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(100, 166, 34, 0.3);
    border: 3px solid #64a622;
    animation: vwr-pulse 2s infinite;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(100, 166, 34, 0.7);
}

/* Search Box Styling */
.mapboxgl-ctrl-geocoder {
    padding: 10px 25px !important;
}

/* Pulsing animation for highlight marker */
@keyframes vwr-pulse {
    0% { 
        transform: scale(0.8); 
        box-shadow: 0 0 0 0 rgba(100, 166, 34, 0.7); 
    }
    50% { 
        transform: scale(1.1); 
        box-shadow: 0 0 0 15px rgba(100, 166, 34, 0); 
    }
    100% { 
        transform: scale(0.8); 
        box-shadow: 0 0 0 0 rgba(100, 166, 34, 0); 
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .vwr-mapbox-info-card {
        width: 280px;
        top: 20px;
        right: 20px;
    }
    
    .vwr-mapbox-info-card h3:first-child {
        padding: 12px 36px;
        font-size: 14px;
    }
    
    .vwr-mapbox-info-card > div {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    /* Province selector adjustments for tablet */
    .vwr-mapbox-province-selector {
        top: 15px;
        left: 15px;
    }
    
    .vwr-province-select {
        min-width: 180px;
        font-size: 13px;
        padding: 10px 14px;
    }
}

@media (max-width: 600px) {
    .vwr-mapbox-mobile-toggle {
        display: block;
        bottom: 20px;
        top: auto;
        right: 20px;
        left: auto;
        z-index: 1002; /* Above info card */
    }
    
    .vwr-mapbox-info-card {
        /* Reset desktop positioning */
        position: absolute !important;
        float: none !important;
        margin: 0 !important;
        
        /* Mobile bottom positioning */
        width: calc(100% - 20px);
        top: auto;
        bottom: 75px;
        right: 10px;
        left: 10px;
        max-width: none;
        max-height: 60vh; /* Allow more space for content */
        
        /* Slide animation */
        transform: translateY(100%); /* Start below viewport */
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        
        /* Mobile-specific styling */
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        box-shadow: 0 -4px 20px rgba(0,0,0,.15);
        z-index: 1002; /* Above mobile toggle */
    }
    
    .vwr-mapbox-info-card.mobile-visible {
        transform: translateY(0); /* Slide up into view */
        opacity: 1;
        visibility: visible;
    }
    
    /* Compact mobile header */
    .vwr-mapbox-info-card h3:first-child {
        padding: 16px 20px;
        font-size: 16px;
        text-align: center;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    /* Hide decorative arrows on mobile */
    .vwr-mapbox-info-card h3:first-child::before,
    .vwr-mapbox-info-card h3:first-child::after {
        display: none;
    }
    
    /* Compact mobile content */
    .vwr-mapbox-info-card > div {
        padding: 16px 20px;
        font-size: 14px;
    }
    
    /* Province selector adjustments for mobile */
    .vwr-mapbox-province-selector {
        top: 70px; /* Below mobile toggle button */
        left: 10px;
        right: 10px;
        width: auto;
    }
    
    .vwr-province-select {
        width: 100%;
        min-width: auto;
        font-size: 14px;
        padding: 12px 16px;
    }
    
    /* Show mobile overlay only on mobile */
    .vwr-mapbox-mobile-overlay {
        display: block;
    }
}

/* Custom marker styles */
.custom-marker {
    display: block;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
    z-index: 1;
}

.custom-marker:hover {
    filter: brightness(1.3);
}

/* Ensure markers are above other map elements */
.mapboxgl-marker {
    z-index: 1000;
}
