* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a2e;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    position: relative;
    background-color: #16213e;
}

.map-container:active {
    cursor: grabbing;
}

.map-wrapper {
    position: absolute;
    transform-origin: 0 0;
    will-change: transform;
}

.map-image {
    display: block;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

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

.pin {
    position: absolute;
    width: 32px;
    height: 32px;
    transform: translate(-50%, -100%);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s ease, filter 0.2s ease;
    z-index: 10;
}

.pin:hover {
    transform: translate(-50%, -100%) scale(1.2);
    filter: brightness(1.2);
}

.pin-icon {
    width: 100%;
    height: 100%;
    position: relative;
}

.pin-icon::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #e94560, #c23a51);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    top: 0;
    left: 4px;
    box-shadow: 0 3px 10px rgba(233, 69, 96, 0.4);
}

.pin-icon::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    top: 5px;
    left: 11px;
}

.pin.visited .pin-icon::before {
    background: linear-gradient(135deg, #7c7c7c, #5a5a5a);
    box-shadow: 0 3px 10px rgba(100, 100, 100, 0.4);
}

/* Popup Modal */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-modal {
    background: #1a1a2e;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.active .popup-modal {
    transform: scale(1);
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.popup-close:hover {
    background: rgba(233, 69, 96, 0.8);
}

.popup-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-right: 40px;
}

.popup-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.popup-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.popup-gallery img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.popup-description {
    color: #a0a0a0;
    font-size: 15px;
    line-height: 1.7;
}

/* Zoom Controls */
.zoom-controls {
    position: fixed;
    bottom: 100px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.zoom-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(26, 26, 46, 0.9);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.zoom-btn:hover {
    background: rgba(233, 69, 96, 0.8);
    transform: scale(1.05);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* Compass */
.compass {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
}

.compass-ring {
    width: 80px;
    height: 80px;
    background: rgba(26, 26, 46, 0.9);
    border-radius: 50%;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.compass-direction {
    position: absolute;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.compass-direction.north {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    color: #e94560;
}

.compass-direction.south {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-direction.east {
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-direction.west {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 36px;
}

.compass-needle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 18px solid #e94560;
    transform: translateX(-4px);
}

.compass-needle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 18px solid rgba(255, 255, 255, 0.4);
    transform: translateX(-4px);
}

/* Scrollbar Styling */
.popup-modal::-webkit-scrollbar {
    width: 6px;
}

.popup-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.popup-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.popup-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 600px) {
    .popup-modal {
        padding: 24px;
        margin: 16px;
    }

    .popup-title {
        font-size: 20px;
    }

    .compass-ring {
        width: 60px;
        height: 60px;
    }

    .compass-direction {
        font-size: 9px;
    }

    .compass-needle {
        height: 28px;
    }

    .compass-needle::before {
        border-bottom-width: 14px;
        border-left-width: 4px;
        border-right-width: 4px;
        transform: translateX(-2px);
    }

    .compass-needle::after {
        border-top-width: 14px;
        border-left-width: 4px;
        border-right-width: 4px;
        transform: translateX(-2px);
    }
}
