/* Hotspot Map Wrapper */
.hotspot-map-wrapper {
    width: 100%;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}

/* Desktop: rounded corners and natural height */
@media (min-width: 1025px) {
    .hotspot-map-wrapper {
        border-radius: 5px;
        height: auto;
    }
    
    .hotspot-map-wrapper img {
        border-radius: 5px;
    }
}

/* Map Container */
.hotspot-map-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Background Image - responsive across all devices */
.hotspot-map-container img {
    width: 100%;
    height: auto;
    display: block;
    pointer-events: none;
}

/* Desktop: natural image sizing */
@media (min-width: 1025px) {
    .hotspot-map-container img {
        object-fit: contain;
    }
}

/* Tablet: horizontal scroll with proportional height */
@media (max-width: 1024px) and (min-width: 768px) {
    .hotspot-map-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        height: auto;
        position: relative;
    }
    
    .hotspot-map-container {
        min-width: 1024px;
        width: auto;
    }
    
    .hotspot-map-container img {
        width: 1024px;
        height: auto;
        max-width: none;
    }
}

/* Mobile: horizontal scroll with proportional height */
@media (max-width: 767px) {
    .hotspot-map-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        height: auto;
        position: relative;
        scroll-padding-left: 0;
    }
    
    .hotspot-map-container {
        min-width: 767px;
        width: auto;
    }
    
    .hotspot-map-container img {
        width: 767px;
        height: auto;
        max-width: none;
    }
}

/* Swipe indicator for mobile/tablet */
@media (max-width: 1024px) {
    .hotspot-map-wrapper::before {
        content: '';
        position: absolute;
        bottom: 20px;
        right: 20px;
        width: 24px;
        height: 24px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 14a8 8 0 0 1-8 8'/%3E%3Cpath d='M18 11v-1a2 2 0 0 0-2-2a2 2 0 0 0-2 2'/%3E%3Cpath d='M14 10V9a2 2 0 0 0-2-2a2 2 0 0 0-2 2v1'/%3E%3Cpath d='M10 9.5V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v10'/%3E%3Cpath d='M18 11a2 2 0 1 1 4 0v3a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        opacity: 0.5;
        z-index: 1000;
        pointer-events: none;
        animation: swipeHint 2s ease-in-out infinite;
        transition: opacity 0.3s ease;
    }
    
    .hotspot-map-wrapper.scrolled::before {
        opacity: 0;
    }
    
    @keyframes swipeHint {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(-10px); }
    }
}

/* Scrollbar styling */
.hotspot-map-wrapper::-webkit-scrollbar {
    height: 8px;
}

.hotspot-map-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.hotspot-map-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.hotspot-map-wrapper::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Hotspot Marker */
.hotspot-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none !important;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.hotspot-marker:hover {
    opacity: 0.85;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 100;
}

/* Ensure text color inheritance works */
.hotspot-marker,
.hotspot-marker:visited,
.hotspot-marker:active,
.hotspot-marker:focus,
.hotspot-marker span {
    color: inherit !important;
    text-decoration: none !important;
}

/* Hotspot Icon - force small size */
.hotspot-marker i,
.hotspot-marker i svg,
.hotspot-marker svg {
    width: 10px !important;
    height: 10px !important;
    min-width: 10px !important;
    min-height: 10px !important;
    max-width: 10px !important;
    max-height: 10px !important;
    flex-shrink: 0;
}

.hotspot-marker i {
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    padding: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Hotspot Label */
.hotspot-marker span {
    line-height: 1;
}

/* Tooltip */
.hotspot-tooltip {
    position: absolute;
    bottom: calc(100% + 20px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--e-global-color-secondary);
    color: var(--e-global-color-primary);
    padding: 12px 16px;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 99999;
    white-space: normal;
}

.hotspot-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--e-global-color-secondary);
}

.hotspot-marker:hover .hotspot-tooltip {
    opacity: 1;
    visibility: visible;
}

.hotspot-tooltip p {
    margin: 0 0 8px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--e-global-color-primary);
}

.hotspot-tooltip p:last-child {
    margin-bottom: 0;
}

.hotspot-tooltip-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--e-global-color-primary);
    margin-top: 8px;
}

/* Category-specific default colors (fallback) */
.hotspot-marker[data-category="boligprosjekter"] {
    background-color: #1a1a1a;
    color: #ffffff;
}

.hotspot-marker[data-category="opplevelser"] {
    background-color: #22d3ee;
    color: #1a1a1a;
}

.hotspot-marker[data-category="kulturminner"] {
    background-color: #fb923c;
    color: #ffffff;
}

/* Tablet adjustments */
@media (max-width: 1024px) {
    .hotspot-marker {
        font-size: 13px;
        padding: 5px 8px;
        gap: 6px;
    }
    
    .hotspot-marker i,
    .hotspot-marker i svg,
    .hotspot-marker svg {
        width: 9px !important;
        height: 9px !important;
        min-width: 9px !important;
        min-height: 9px !important;
        max-width: 9px !important;
        max-height: 9px !important;
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .hotspot-marker {
        font-size: 12px;
        padding: 4px 8px;
        gap: 5px;
    }
    
    .hotspot-marker i,
    .hotspot-marker i svg,
    .hotspot-marker svg {
        width: 8px !important;
        height: 8px !important;
        min-width: 8px !important;
        min-height: 8px !important;
        max-width: 8px !important;
        max-height: 8px !important;
    }
    
    .hotspot-tooltip {
        min-width: 180px;
        max-width: 240px;
        padding: 10px 12px;
    }
}

/* Accessibility */
.hotspot-marker:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.hotspot-marker:focus:not(:focus-visible) {
    outline: none;
}

/* Animation for markers on load - only on page load */
@keyframes markerFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.hotspot-marker:not(.hidden) {
    animation: markerFadeIn 0.4s ease forwards;
}

.hotspot-marker:nth-child(2) { animation-delay: 0.05s; }
.hotspot-marker:nth-child(3) { animation-delay: 0.1s; }
.hotspot-marker:nth-child(4) { animation-delay: 0.15s; }
.hotspot-marker:nth-child(5) { animation-delay: 0.2s; }
.hotspot-marker:nth-child(n+6) { animation-delay: 0.25s; }

/* Disable animation after initial load to prevent flashing on filter */
.hotspot-map-container.loaded .hotspot-marker {
    animation: none !important;
}

/* Category Filter - Minimal text-based style */
.hotspot-category-filter {
    display: flex;
    gap: 60px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* Tablet: same spacing as desktop + left padding */
@media (max-width: 1024px) and (min-width: 768px) {
    .hotspot-category-filter {
        gap: 60px;
        padding-left: 60px;
    }
}

/* Mobile: horizontal scroll synchronized with map + left padding */
@media (max-width: 767px) {
    .hotspot-category-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 30px;
        padding-bottom: 8px;
        padding-left: 30px;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    .hotspot-category-filter::-webkit-scrollbar {
        display: none;
    }
}

.hotspot-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    color: var(--e-global-color-primary);
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
    position: relative;
    opacity: 0.4;
    white-space: nowrap;
}

.hotspot-filter-btn:hover {
    opacity: 0.7;
}

.hotspot-filter-btn.active {
    opacity: 1;
    font-weight: 500;
}

.hotspot-filter-btn .filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

/* Force override any inherited styles */
.hotspot-category-filter .hotspot-filter-btn,
.hotspot-category-filter .hotspot-filter-btn:hover,
.hotspot-category-filter .hotspot-filter-btn:focus,
.hotspot-category-filter .hotspot-filter-btn:active {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    text-decoration: none !important;
}

/* Hidden markers - instant hide/show without animation */
.hotspot-marker.hidden {
    display: none !important;
    animation: none !important;
}

.hotspot-marker:not(.hidden) {
    display: inline-flex !important;
}