body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Roboto', sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
}

#map-viewport {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: relative;
    cursor: grab;
    background-color: #0f0f0f;
}

#map-viewport:active {
    cursor: grabbing;
}

#map-container {
    position: absolute;
    transform-origin: 0 0;
    /* Transformation will be handled by JS */
}

#map-image {
    display: block;
    width: 1536px;
    /* Native size of the image */
    height: 1536px;
    pointer-events: none;
    user-select: none;
}

/* UI Overlay */
#ui-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(20, 20, 20, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    width: 300px;
    border: 1px solid #333;
}

h1 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    color: #ffcc00;
    /* DayZ-ish Yellow */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

button:hover {
    background: #444;
}

#search-input {
    background: #222;
    border: 1px solid #444;
    color: white;
    padding: 8px;
    border-radius: 4px;
}

#search-results {
    max-height: 150px;
    overflow-y: auto;
    background: #222;
    border: 1px solid #333;
    display: none;
    /* Hidden by default */
}

.result-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #333;
}

.result-item:hover {
    background: #333;
}

/* Legend */
.legend {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #444;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
    display: inline-block;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.dot.yellow {
    background-color: #ffd700;
    box-shadow: 0 0 8px #ffd700;
}

.dot.green {
    background-color: #00ff00;
    box-shadow: 0 0 8px #00ff00;
}

.dot.blue {
    background-color: #00bfff;
    box-shadow: 0 0 8px #00bfff;
}

.dot.purple {
    background-color: #9932cc;
    box-shadow: 0 0 8px #9932cc;
}

.dot.red {
    background-color: #ff4500;
    box-shadow: 0 0 8px #ff4500;
}

#coords-display {
    margin-top: 10px;
    font-family: monospace;
    font-size: 0.9rem;
    color: #888;
}

/* Markers */
.marker {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    /* Centering */
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 10;
}

.marker:hover {
    transform: translate(-50%, -50%) scale(1.5);
    z-index: 100;
}

.marker-popup {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    display: none;
    z-index: 101;
}

.marker:hover .marker-popup {
    display: block;
}

/* Auth & User UI */
#auth-section {
    margin-bottom: 10px;
}

#login-btn {
    background: #171a21;
    /* Steam color */
    color: #c7d5e0;
    width: 100%;
    font-weight: bold;
}

#login-btn:hover {
    background: #2a475e;
}

.user-marker {
    border: 2px solid #00ffcc;
    /* Cyan for user bases */
    background-color: rgba(0, 255, 204, 0.3);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #222;
    padding: 20px;
    border: 1px solid #444;
    border-radius: 8px;
    width: 300px;
    color: white;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    background: #333;
    border: 1px solid #555;
    color: white;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: white;
}

/* Labels */
.marker-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    text-shadow: 1px 1px 2px black;
    white-space: nowrap;
    pointer-events: none;
    font-size: 0.8rem;
    color: white;
}

/* City Markers */
.city-marker {
    position: absolute;
    background: black;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    border: 1px solid white;
    transform: translate(-50%, -50%);
    z-index: 20;
    /* Below hover items but above map */
    cursor: pointer;
}

.city-marker::before {
    content: '📍';
    /* Simple pin icon */
}

.city-marker.safezone {
    border-color: #00ff00;
    color: #00ff00;
    box-shadow: 0 0 5px #00ff00;
}