/* Map Container */
.map-container {
    position: relative;
    padding: 20px;
    background: #f5f5f5;
    min-height: calc(100vh - 80px);
}

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

.map-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #fff;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s;
}

.map-btn:hover {
    background: #eee;
}

.map-btn:last-child {
    font-size: 12px;
    font-weight: normal;
}

/* Map Wrapper - handles overflow for panning */
#map-wrapper {
    width: 100%;
    height: calc(100vh - 120px);
    min-height: 500px;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: grab;
}

#map-wrapper:active {
    cursor: grabbing;
}

/* Map Content - the zoomable/pannable area */
#map-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* World Map SVG */
#world-map {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Pins Container - overlays the map */
#pins-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Individual Pin */
.map-pin {
    position: absolute;
    transform: translate(-50%, -100%);
    cursor: pointer;
    pointer-events: auto;
    z-index: 10;
    display: flex;
    flex-direction: column-reverse;
}

.map-pin:hover {
    z-index: 20;
}

/* Pin Stem - the line */
.pin-stem {
    width: 2px;
    height: 20px;
    background: #222;
    margin: 0 auto;
}

/* Pin Head - the ball */
.pin-head {
    width: 12px;
    height: 12px;
    background: #222;
    border-radius: 50%;
    margin: 0 auto;
    transition: transform 0.2s, background-color 0.2s;
}

.map-pin:hover .pin-head {
    transform: scale(1.3);
    background: #da4d4d;
}

/* Pin Tooltip */
.pin-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    margin-bottom: 5px;
}

.pin-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #222;
}

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

/* Grid overlay for positioning */
.map-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.grid-line-v {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(0, 0, 0, 0.15);
}

.grid-line-h {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.15);
}

.grid-line-v.grid-line-major {
    background: rgba(0, 0, 0, 0.4);
}

.grid-line-h.grid-line-major {
    background: rgba(0, 0, 0, 0.4);
}

.grid-label-x {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 9px;
    color: #000;
    background: rgba(255, 255, 255, 0.8);
    padding: 1px 3px;
    border-radius: 2px;
}

.grid-label-y {
    position: absolute;
    left: 2px;
    top: 2px;
    font-size: 9px;
    color: #000;
    background: rgba(255, 255, 255, 0.8);
    padding: 1px 3px;
    border-radius: 2px;
}

/* No images text in tooltip */
.no-images-text {
    display: block;
    font-size: 11px;
    color: #aaa;
    margin-top: 4px;
    font-style: italic;
}

/* Grey out pins without images */
.map-pin.no-images .pin-head {
    background: #888;
}

.map-pin.no-images .pin-stem {
    background: #888;
}

.map-pin.no-images:hover .pin-head {
    background: #666;
}

/* Magnific Popup Customizations */
.mfp-gallery .mfp-title {
    text-align: center;
    padding: 10px 0;
    font-size: 16px;
}

.mfp-counter {
    color: #ccc;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .map-container {
        padding: 10px;
    }

    #map-wrapper {
        height: calc(100vh - 200px);
        min-height: 300px;
    }

    .map-controls {
        top: 20px;
        right: 20px;
    }

    .map-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .pin-stem {
        height: 15px;
    }

    .pin-head {
        width: 10px;
        height: 10px;
    }
}

/* No Images Notice */
.no-images-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.notice-content {
    background: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 300px;
}

.notice-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.notice-content p {
    margin: 0 0 20px 0;
    color: #888;
    font-size: 14px;
}

.notice-close {
    background: #da4d4d;
    color: #fff;
    border: none;
    padding: 10px 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.notice-close:hover {
    background: #c43c3c;
}
