/**
 * Stili per la mappa UserMap (frontend)
 */

.usermap-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

.usermap {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.usermap-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-size: 16px;
    font-weight: 500;
}

/* Popup utente */
.user-popup {
    max-width: 250px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.user-popup .avatar-container {
    text-align: center;
    margin-bottom: 15px;
}

.user-popup .avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e0e0e0;
}

.user-popup .avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: bold;
    border: 3px solid #e0e0e0;
}

.user-popup h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    text-align: center;
    color: #333;
}

.user-popup p {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.user-popup p strong {
    color: #333;
}

.user-popup a {
    color: #0066cc;
    text-decoration: none;
}

.user-popup a:hover {
    text-decoration: underline;
}

/* Campo di ricerca */
.usermap-search-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 350px;
    max-width: calc(100% - 20px);
}

.usermap-search-input {
    width: 100%;
    padding: 12px 45px 12px 40px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    background: white;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.usermap-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 2px 15px rgba(102, 126, 234, 0.3);
}

.usermap-search-icon {
    position: absolute;
    left: 12px;
    top: 12px;
    color: #999;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.usermap-search-clear {
    position: absolute;
    right: 8px;
    top: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    transition: color 0.2s ease;
}

.usermap-search-clear:hover {
    color: #333;
}

.usermap-search-clear .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.usermap-search-results {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 3px;
}

.search-result-item small {
    color: #666;
    font-size: 12px;
}

.search-no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-result-more {
    padding: 10px 15px;
    text-align: center;
    color: #667eea;
    font-size: 12px;
    font-weight: 500;
    border-top: 1px solid #f0f0f0;
}

/* Responsive */
@media (max-width: 768px) {
    .usermap-search-container {
        width: calc(100% - 20px);
    }

    .user-popup {
        max-width: 200px;
    }

    .user-popup .avatar,
    .user-popup .avatar-placeholder {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}
