/**
 * OpenSimulator WorldMap CSS Styles
 */

/* Main map container */
.opensim-worldmap {
    border: 2px solid #333;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #001122;
}

/* Region markers */
.opensim-region-marker {
    background: transparent;
    border: none;
    text-align: center;
}

.region-marker-inner {
    background: rgba(0, 255, 0, 0.8);
    border: 1px solid #00ff00;
    border-radius: 4px;
    padding: 2px 6px;
    color: #000;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 0 2px #fff;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.region-marker-inner:hover {
    background: rgba(0, 255, 0, 1);
    transform: scale(1.05);
    cursor: pointer;
}

/* Region popup */
.opensim-region-popup {
    min-width: 200px;
    font-family: Arial, sans-serif;
}

.opensim-region-popup h3 {
    margin: 0 0 10px 0;
    color: #00ff00;
    font-size: 14px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.opensim-region-popup p {
    margin: 5px 0;
    font-size: 12px;
}

.opensim-teleport-link {
    display: inline-block;
    background: #0066cc;
    color: white;
    padding: 4px 8px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 11px;
    margin-top: 5px;
}

.opensim-teleport-link:hover {
    background: #0052a3;
    color: white;
    text-decoration: none;
}

/* Map controls */
.opensim-home-control,
.opensim-region-toggle {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.opensim-home-control button,
.opensim-region-toggle button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    display: block;
    width: 100%;
}

.opensim-home-control button:hover,
.opensim-region-toggle button:hover {
    background: #f0f0f0;
}

/* Coordinate display */
.opensim-coord-display {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 11px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    min-width: 80px;
    text-align: center;
}

.opensim-coord-display span {
    color: #333;
    font-weight: bold;
}

/* Region boundaries */
.leaflet-interactive {
    cursor: crosshair;
}

/* Custom popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.leaflet-popup-content {
    margin: 12px;
    line-height: 1.4;
}

/* Search box styles (if added) */
.opensim-search-control {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    padding: 5px;
}

.opensim-search-control input {
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 4px;
    font-size: 12px;
    width: 150px;
}

.opensim-search-control button {
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 2px;
    padding: 4px 8px;
    margin-left: 2px;
    cursor: pointer;
    font-size: 11px;
}

.opensim-search-control button:hover {
    background: #0052a3;
}

/* Loading indicator */
.opensim-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    z-index: 1000;
}

.opensim-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #0066cc;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .opensim-worldmap {
        height: 400px !important;
    }
    
    .opensim-coord-display {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .opensim-search-control input {
        width: 100px;
        font-size: 11px;
    }
    
    .region-marker-inner {
        font-size: 10px;
        padding: 1px 4px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .opensim-worldmap {
        border-color: #555;
    }
    
    .opensim-coord-display {
        background: rgba(50, 50, 50, 0.9);
        border-color: #666;
    }
    
    .opensim-coord-display span {
        color: #fff;
    }
    
    .opensim-home-control,
    .opensim-region-toggle,
    .opensim-search-control {
        background: #333;
        border-color: #555;
    }
    
    .opensim-home-control button:hover,
    .opensim-region-toggle button:hover {
        background: #444;
    }
    
    .opensim-search-control input {
        background: #444;
        border-color: #666;
        color: #fff;
    }
}