/* Tiled Map Styles */
.egsw-tiled-map {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f0f0f0;
}
.egsw-map-frontend>p{
    display:none;
}
.egsw-tiled-map-viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
}

.egsw-tiled-map-content {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.egsw-tiled-map-content:active {
    cursor: grabbing;
}

.egsw-tiles-container {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.egsw-tile {
    position: absolute;
    background: #f9f9f9;
    border: 1px solid #eee;
    box-sizing: border-box;
}

.egsw-pins-container {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.egsw-tiled-pin {
    position: absolute;
    pointer-events: all;
    z-index: 100;
}

.egsw-tiled-map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 200;
}

.egsw-tiled-map-controls button {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.egsw-tiled-map-controls button:hover {
    background: white;
    border-color: #999;
    transform: scale(1.05);
}

.egsw-zoom-indicator {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 200;
}

.egsw-loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
}

.egsw-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: egsw-spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes egsw-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tiled pin styles */
.egsw-tiled-pin .egsw-pin-marker {
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.egsw-tiled-pin:hover .egsw-pin-marker {
    background: #c0392b;
    transform: translate(-50%, -50%) scale(1.2);
}

.egsw-tiled-pin .egsw-pin-tooltip {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 300;
}

.egsw-tiled-pin .egsw-pin-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.egsw-tiled-pin:hover .egsw-pin-tooltip {
    opacity: 1;
    visibility: visible;
}


.egsw-map-frontend {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    background: #f9f9f9;
    max-width: 100%;
}

/* PDF Container */
.egsw-pdf-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.egsw-pdf-pins-list {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    max-width: 300px;
}

.egsw-pdf-pins-list h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
}

.egsw-pdf-pins-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.egsw-pdf-pins-list li {
    margin: 5px 0;
}

.egsw-pdf-pins-list a {
    color: #0073aa;
    text-decoration: none;
    font-size: 13px;
}

.egsw-pdf-pins-list a:hover {
    text-decoration: underline;
}

/* Image Map Container */
.egsw-image-map-container {
    position: relative;
    width: 100%;
    height: auto;
}

.egsw-map-viewport {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    touch-action: none; /* Prevent browser touch handling */
}

.egsw-map-content {
    position: relative;
    width: 100%;
    height: auto;
    transform-origin: center center;
    transition: transform 0.3s ease;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.egsw-map-content:active {
    cursor: grabbing;
}

/* Prevent text selection during drag */
body.egsw-dragging {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

body.egsw-dragging * {
    cursor: grabbing !important;
}

.egsw-map-image {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Map Pins */
.egsw-map-pins {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.egsw-pin {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
    z-index: 10;
    box-sizing: border-box;
}

.egsw-pin:hover,
.egsw-pin.clicked {
    background: #c0392b;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Pin Tooltip */
.egsw-pin-tooltip {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 20;
}

.egsw-pin-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
}

.egsw-pin:hover .egsw-pin-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Map Controls */
.egsw-map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 30;
}

.egsw-map-controls button {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.egsw-map-controls button:hover {
    background: white;
    border-color: #999;
    transform: scale(1.05);
}

.egsw-map-controls button:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    .egsw-pin-marker {
        width: 20px;
        height: 20px;
    }
    
    .egsw-pin-tooltip {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .egsw-map-controls {
        top: 5px;
        right: 5px;
    }
    
    .egsw-map-controls button {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .egsw-pdf-pins-list {
        max-width: 250px;
        padding: 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .egsw-pin-tooltip {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        border-radius: 5px;
        z-index: 1000;
    }
    
    .egsw-pin-tooltip::after {
        display: none;
    }
    
    .egsw-pdf-pins-list {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 10px;
        max-width: none;
    }
}

/* Animation for pin clicks */
@keyframes egsw-pin-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.egsw-pin-marker.clicked {
    animation: egsw-pin-pulse 0.3s ease;
}
